Gigabeat S: Make MIN_BRIGHTNESS_SETTING to be 1, not 0; the backlight already has...
[kugel-rb.git] / apps / plugins / reversi / Makefile
blob97a042e0f7ccec0271702fcace31e69b79406fb7
1 # __________ __ ___.
2 # Open \______ \ ____ ____ | | _\_ |__ _______ ___
3 # Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
4 # Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
5 # Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
6 # \/ \/ \/ \/ \/
7 # $$Id: $$
10 INCLUDES = -I$(APPSDIR) -I.. -I. $(TARGET_INC) -I$(FIRMDIR)/include -I$(FIRMDIR)/export \
11 -I$(FIRMDIR)/common -I$(FIRMDIR)/drivers -I$(OUTDIR) -I$(BUILDDIR) \
12 -I$(BUILDDIR)/pluginbitmaps
13 CFLAGS = $(INCLUDES) $(GCCOPTS) $(TARGET) $(EXTRA_DEFINES) \
14 -DTARGET_ID=$(TARGET_ID) -DMEM=${MEMORYSIZE} -DPLUGIN
16 ifdef APPEXTRA
17 INCLUDES += $(patsubst %,-I$(APPSDIR)/%,$(subst :, ,$(APPEXTRA)))
18 endif
20 LINKFILE := $(OBJDIR)/link.lds
21 DEPFILE = $(OBJDIR)/dep-reversi
23 # This sets up 'SRC' based on the files mentioned in SOURCES
24 include $(TOOLSDIR)/makesrc.inc
26 SOURCES = $(SRC)
27 OBJS := $(SRC:%.c=$(OBJDIR)/%.o)
28 DIRS = .
30 ifndef SIMVER
31 LDS := ../plugin.lds
32 OUTPUT = $(OUTDIR)/reversi.rock
33 else ## simulators
34 OUTPUT = $(OUTDIR)/reversi.rock
35 endif
37 all: $(OUTPUT)
39 ifndef SIMVER
40 $(OBJDIR)/reversi.elf: $(OBJS) $(LINKFILE) $(BITMAPLIBS)
41 $(call PRINTS,LD $(@F))$(CC) $(GCCOPTS) -O -nostdlib -o $@ $(OBJS) -L$(BUILDDIR) -lplugin -lgcc \
42 $(LINKBITMAPS) -T$(LINKFILE) -Wl,--gc-sections -Wl,-Map,$(OBJDIR)/reversi.map
44 $(OUTPUT): $(OBJDIR)/reversi.elf
45 $(call PRINTS,OBJCOPY $(@F))$(OC) -O binary $< $@
46 else
48 ifeq ($(SIMVER), x11)
49 ###################################################
50 # This is the X11 simulator version
52 $(OUTPUT): $(OBJS)
53 $(call PRINTS,LD $(@F))$(CC) $(CFLAGS) $(SHARED_FLAG) $(OBJS) -L$(BUILDDIR) -lplugin $(LINKBITMAPS) -o $@
54 ifeq ($(findstring CYGWIN,$(UNAME)),CYGWIN)
55 # 'x' must be kept or you'll have "Win32 error 5"
56 # $ fgrep 5 /usr/include/w32api/winerror.h | head -1
57 # #define ERROR_ACCESS_DENIED 5L
58 else
59 @chmod -x $@
60 endif
62 else # end of x11-simulator
63 ifeq ($(SIMVER), sdl)
64 ###################################################
65 # This is the SDL simulator version
67 $(OUTPUT): $(OBJS)
68 $(call PRINTS,LD $(@F))$(CC) $(CFLAGS) $(SHARED_FLAG) $(OBJS) -L$(BUILDDIR) -lplugin $(LINKBITMAPS) -o $@
69 ifeq ($(findstring CYGWIN,$(UNAME)),CYGWIN)
70 # 'x' must be kept or you'll have "Win32 error 5"
71 # $ fgrep 5 /usr/include/w32api/winerror.h | head -1
72 # #define ERROR_ACCESS_DENIED 5L
73 else
74 @chmod -x $@
75 endif
77 else # end of sdl-simulator
78 ###################################################
79 # This is the win32 simulator version
80 DLLTOOLFLAGS = --export-all
81 DLLWRAPFLAGS = -s --entry _DllMain@12 --target=i386-mingw32 -mno-cygwin
83 $(OUTPUT): $(OBJS)
84 $(call PRINTS,DLL $(@F))$(DLLTOOL) $(DLLTOOLFLAGS) -z $(OBJDIR)/$*.def $(OBJS)
85 $(SILENT)$(DLLWRAP) $(DLLWRAPFLAGS) --def $(OBJDIR)/$*.def $(OBJS) \
86 $(BUILDDIR)/libplugin.a $(BITMAPLIBS) -o $@
87 ifeq ($(findstring CYGWIN,$(UNAME)),CYGWIN)
88 # 'x' must be kept or you'll have "Win32 error 5"
89 # $ fgrep 5 /usr/include/w32api/winerror.h | head -1
90 # #define ERROR_ACCESS_DENIED 5L
91 else
92 @chmod -x $@
93 endif
94 endif # end of win32-simulator
95 endif
96 endif # end of simulator section
99 include $(TOOLSDIR)/make.inc
101 # MEMORYSIZE should be passed on to this makefile with the chosen memory size
102 # given in number of MB
103 $(LINKFILE): $(LDS)
104 $(call PRINTS,build $(@F))cat $< | $(CC) -DMEMORYSIZE=$(MEMORYSIZE) $(INCLUDES) $(TARGET) \
105 $(DEFINES) -E -P - >$@
107 clean:
108 $(call PRINTS,cleaning reversi)rm -rf $(OBJDIR)/reversi
109 $(SILENT)rm -f $(OBJDIR)/reversi.* $(DEPFILE)
111 -include $(DEPFILE)