diff options
Diffstat (limited to 'apps/plugins/sudoku/Makefile')
-rw-r--r-- | apps/plugins/sudoku/Makefile | 117 |
1 files changed, 117 insertions, 0 deletions
diff --git a/apps/plugins/sudoku/Makefile b/apps/plugins/sudoku/Makefile new file mode 100644 index 0000000000..9b9c1c6b2e --- /dev/null +++ b/apps/plugins/sudoku/Makefile | |||
@@ -0,0 +1,117 @@ | |||
1 | # __________ __ ___. | ||
2 | # Open \______ \ ____ ____ | | _\_ |__ _______ ___ | ||
3 | # Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / | ||
4 | # Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < | ||
5 | # Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ | ||
6 | # \/ \/ \/ \/ \/ | ||
7 | # $Id$ | ||
8 | # | ||
9 | |||
10 | INCLUDES = -I$(APPSDIR) -I.. -I. -I$(FIRMDIR)/include -I$(FIRMDIR)/export \ | ||
11 | -I$(FIRMDIR)/common -I$(FIRMDIR)/drivers -I$(OUTDIR) -I$(BUILDDIR) | ||
12 | CFLAGS = $(GCCOPTS) $(INCLUDES) $(TARGET) $(EXTRA_DEFINES) \ | ||
13 | -DTARGET_ID=$(TARGET_ID) -DMEM=${MEMORYSIZE} -DPLUGIN | ||
14 | |||
15 | ifdef APPEXTRA | ||
16 | INCLUDES += $(patsubst %,-I$(APPSDIR)/%,$(subst :, ,$(APPEXTRA))) | ||
17 | endif | ||
18 | |||
19 | LINKFILE := $(OBJDIR)/link.lds | ||
20 | DEPFILE = $(OBJDIR)/dep-sudoku | ||
21 | |||
22 | # This sets up 'SRC' based on the files mentioned in SOURCES | ||
23 | include $(TOOLSDIR)/makesrc.inc | ||
24 | |||
25 | SOURCES = $(SRC) | ||
26 | OBJS := $(SRC:%.c=$(OBJDIR)/%.o) | ||
27 | DIRS = . | ||
28 | |||
29 | ifndef SIMVER | ||
30 | LDS := ../plugin.lds | ||
31 | OUTPUT = $(OUTDIR)/sudoku.rock | ||
32 | else ## simulators | ||
33 | OUTPUT = $(OUTDIR)/sudoku.rock | ||
34 | endif | ||
35 | |||
36 | all: $(OUTPUT) | ||
37 | |||
38 | ifndef SIMVER | ||
39 | $(OBJDIR)/sudoku.elf: $(OBJS) $(LINKFILE) $(BITMAPLIBS) | ||
40 | @echo "LD "`basename $@` | ||
41 | @$(CC) $(GCCOPTS) -O -nostdlib -o $@ $(OBJS) -L$(BUILDDIR) -lplugin -lgcc \ | ||
42 | $(LINKBITMAPS) -T$(LINKFILE) -Wl,-Map,$(OBJDIR)/sudoku.map | ||
43 | |||
44 | $(OUTPUT): $(OBJDIR)/sudoku.elf | ||
45 | @echo "OBJCOPY "`basename $@` | ||
46 | @$(OC) -O binary $< $@ | ||
47 | else | ||
48 | |||
49 | ifeq ($(SIMVER), x11) | ||
50 | ################################################### | ||
51 | # This is the X11 simulator version | ||
52 | |||
53 | $(OUTPUT): $(OBJS) | ||
54 | @echo "LD $<" | ||
55 | @$(CC) $(CFLAGS) -shared $(OBJS) -L$(BUILDDIR) -lplugin $(LINKBITMAPS) -o $@ | ||
56 | ifeq ($(findstring CYGWIN,$(UNAME)),CYGWIN) | ||
57 | # 'x' must be kept or you'll have "Win32 error 5" | ||
58 | # $ fgrep 5 /usr/include/w32api/winerror.h | head -1 | ||
59 | # #define ERROR_ACCESS_DENIED 5L | ||
60 | else | ||
61 | @chmod -x $@ | ||
62 | endif | ||
63 | |||
64 | else # end of x11-simulator | ||
65 | ifeq ($(SIMVER), sdl) | ||
66 | ################################################### | ||
67 | # This is the SDL simulator version | ||
68 | |||
69 | $(OUTPUT): $(OBJS) | ||
70 | @echo "LD $<" | ||
71 | @$(CC) $(CFLAGS) -shared $(OBJS) -L$(BUILDDIR) -lplugin $(LINKBITMAPS) -o $@ | ||
72 | ifeq ($(findstring CYGWIN,$(UNAME)),CYGWIN) | ||
73 | # 'x' must be kept or you'll have "Win32 error 5" | ||
74 | # $ fgrep 5 /usr/include/w32api/winerror.h | head -1 | ||
75 | # #define ERROR_ACCESS_DENIED 5L | ||
76 | else | ||
77 | @chmod -x $@ | ||
78 | endif | ||
79 | |||
80 | else # end of sdl-simulator | ||
81 | ################################################### | ||
82 | # This is the win32 simulator version | ||
83 | DLLTOOLFLAGS = --export-all | ||
84 | DLLWRAPFLAGS = -s --entry _DllMain@12 --target=i386-mingw32 -mno-cygwin | ||
85 | |||
86 | $(OUTPUT): $(OBJS) | ||
87 | @echo "DLL "`basename $@` | ||
88 | @$(DLLTOOL) $(DLLTOOLFLAGS) -z $(OBJDIR)/$*.def $(OBJS) | ||
89 | @$(DLLWRAP) $(DLLWRAPFLAGS) --def $(OBJDIR)/$*.def $(OBJS) \ | ||
90 | $(BUILDDIR)/libplugin.a $(BITMAPLIBS) -o $@ | ||
91 | ifeq ($(findstring CYGWIN,$(UNAME)),CYGWIN) | ||
92 | # 'x' must be kept or you'll have "Win32 error 5" | ||
93 | # $ fgrep 5 /usr/include/w32api/winerror.h | head -1 | ||
94 | # #define ERROR_ACCESS_DENIED 5L | ||
95 | else | ||
96 | @chmod -x $@ | ||
97 | endif | ||
98 | endif # end of win32-simulator | ||
99 | endif | ||
100 | endif # end of simulator section | ||
101 | |||
102 | |||
103 | include $(TOOLSDIR)/make.inc | ||
104 | |||
105 | # MEMORYSIZE should be passed on to this makefile with the chosen memory size | ||
106 | # given in number of MB | ||
107 | $(LINKFILE): $(LDS) | ||
108 | @echo "build "`basename $@` | ||
109 | @cat $< | $(CC) -DMEMORYSIZE=$(MEMORYSIZE) $(INCLUDES) $(TARGET) \ | ||
110 | $(DEFINES) -E -P - >$@ | ||
111 | |||
112 | clean: | ||
113 | @echo "cleaning sudoku" | ||
114 | @rm -rf $(OBJDIR)/sudoku | ||
115 | @rm -f $(OBJDIR)/sudoku.* $(DEPFILE) | ||
116 | |||
117 | -include $(DEPFILE) | ||