Gigabeat S: Make MIN_BRIGHTNESS_SETTING to be 1, not 0; the backlight already has...
[kugel-rb.git] / apps / plugins / rockboy / Makefile
blob4aa85261259c335ed79cb1b854b47d637c3a0e95
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 CFLAGS = $(INCLUDES) $(GCCOPTS) -O2 $(TARGET) $(EXTRA_DEFINES) \
13 -DTARGET_ID=$(TARGET_ID) -DMEM=${MEMORYSIZE} -DPLUGIN -finline-functions
15 ifdef APPEXTRA
16 INCLUDES += $(patsubst %,-I$(APPSDIR)/%,$(subst :, ,$(APPEXTRA)))
17 endif
19 LINKFILE := $(OBJDIR)/link.lds
20 DEPFILE = $(OBJDIR)/dep-rockboy
21 SRC = cpu.c emu.c events.c fastmem.c hw.c lcd.c lcdc.c loader.c \
22 mem.c menu.c rbsound.c rockboy.c rtc.c save.c sound.c sys_rockbox.c \
23 ../../../firmware/common/sscanf.c
25 #CFLAGS += -DDYNAREC
26 #SRC += dynarec.c
28 SOURCES = $(SRC)
29 OBJS := $(SRC:%.c=$(OBJDIR)/%.o)
30 DIRS = .
32 ifndef SIMVER
33 ifneq (,$(findstring RECORDER,$(TARGET))) ## Archos recorder targets
34 LDS := archos.lds
35 OUTPUT = $(OUTDIR)/rockboy.ovl
36 else ## iRiver target
37 LDS := ../plugin.lds
38 OUTPUT = $(OUTDIR)/rockboy.rock
39 endif
40 else ## simulators
41 OUTPUT = $(OUTDIR)/rockboy.rock
42 endif
44 all: $(OUTPUT)
46 ifndef SIMVER
47 $(OBJDIR)/rockboy.elf: $(OBJS) $(LINKFILE)
48 $(call PRINTS,LD $(@F))$(CC) $(CFLAGS) -o $@ $(OBJS) -L$(BUILDDIR) -lplugin -fast -lgcc \
49 -T$(LINKFILE) -Wl,--gc-sections -Wl,-Map,$(OBJDIR)/rockboy.map
51 $(OUTPUT): $(OBJDIR)/rockboy.elf
52 $(call PRINTS,OBJCOPY $(@F))$(OC) -O binary $< $@
53 else
55 ifeq ($(SIMVER), x11)
56 ###################################################
57 # This is the X11 simulator version
59 $(OUTPUT): $(OBJS)
60 $(call PRINTS,LD $(@F))$(CC) $(CFLAGS) $(SHARED_FLAG) $(OBJS) -L$(BUILDDIR) -lplugin -o $@
61 ifeq ($(findstring CYGWIN,$(UNAME)),CYGWIN)
62 # 'x' must be kept or you'll have "Win32 error 5"
63 # $ fgrep 5 /usr/include/w32api/winerror.h | head -1
64 # #define ERROR_ACCESS_DENIED 5L
65 else
66 @chmod -x $@
67 endif
69 else # end of x11-simulator
70 ifeq ($(SIMVER), sdl)
71 ###################################################
72 # This is the sdl simulator version
74 $(OUTPUT): $(OBJS)
75 $(call PRINTS,LD $(@F))$(CC) $(CFLAGS) $(SHARED_FLAG) $(OBJS) -L$(BUILDDIR) -lplugin -o $@
76 ifeq ($(findstring CYGWIN,$(UNAME)),CYGWIN)
77 # 'x' must be kept or you'll have "Win32 error 5"
78 # $ fgrep 5 /usr/include/w32api/winerror.h | head -1
79 # #define ERROR_ACCESS_DENIED 5L
80 else
81 @chmod -x $@
82 endif
84 else # end of sdl-simulator
85 ###################################################
86 # This is the win32 simulator version
87 DLLTOOLFLAGS = --export-all
88 DLLWRAPFLAGS = -s --entry _DllMain@12 --target=i386-mingw32 -mno-cygwin
90 $(OUTPUT): $(OBJS)
91 $(call PRINTS,DLL $(@F))$(DLLTOOL) $(DLLTOOLFLAGS) -z $(OBJDIR)/$*.def $(OBJS)
92 $(SILENT)$(DLLWRAP) $(DLLWRAPFLAGS) --def $(OBJDIR)/$*.def $(OBJS) \
93 $(BUILDDIR)/libplugin.a -o $@
94 ifeq ($(findstring CYGWIN,$(UNAME)),CYGWIN)
95 # 'x' must be kept or you'll have "Win32 error 5"
96 # $ fgrep 5 /usr/include/w32api/winerror.h | head -1
97 # #define ERROR_ACCESS_DENIED 5L
98 else
99 @chmod -x $@
100 endif
101 endif # end of win32-simulator
102 endif
103 endif # end of simulator section
106 include $(TOOLSDIR)/make.inc
108 # MEMORYSIZE should be passed on to this makefile with the chosen memory size
109 # given in number of MB
110 $(LINKFILE): $(LDS)
111 $(call PRINTS,build $(@F))cat $< | $(CC) -DMEMORYSIZE=$(MEMORYSIZE) $(INCLUDES) $(TARGET) $(DEFINES) \
112 -E -P - >$@
114 clean:
115 $(call PRINTS,cleaning rockboy)rm -rf $(OBJDIR)/rockboy
116 $(SILENT)rm -f $(OBJDIR)/rockboy.* $(DEPFILE)
118 -include $(DEPFILE)