Gigabeat S: Make MIN_BRIGHTNESS_SETTING to be 1, not 0; the backlight already has...
[kugel-rb.git] / apps / plugins / beatbox / Makefile
blob9465c420d20b6afd0c5d7204b95b0f1b167b220d
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) $(TARGET) $(EXTRA_DEFINES) \
13 -DTARGET_ID=$(TARGET_ID) -DMEM=${MEMORYSIZE} -DPLUGIN -O3
15 ifdef APPEXTRA
16 INCLUDES += $(patsubst %,-I$(APPSDIR)/%,$(subst :, ,$(APPEXTRA)))
17 endif
19 LINKFILE := $(OBJDIR)/link.lds
20 DEPFILE = $(OBJDIR)/dep-beatbox
22 # This sets up 'SRC' based on the files mentioned in SOURCES
23 include $(TOOLSDIR)/makesrc.inc
25 SOURCES = $(SRC)
26 OBJS := $(SRC:%.c=$(OBJDIR)/%.o)
27 DIRS = .
29 ifndef SIMVER
30 LDS := ../plugin.lds
31 OUTPUT = $(OUTDIR)/beatbox.rock
32 else ## simulators
33 OUTPUT = $(OUTDIR)/beatbox.rock
34 endif
36 all: $(OUTPUT)
38 ifndef SIMVER
39 $(OBJDIR)/beatbox.elf: $(OBJS) $(LINKFILE) $(BITMAPLIBS)
40 $(call PRINTS,LD $(@F))$(CC) $(CFLAGS) -o $@ $(OBJS) -L$(BUILDDIR) -lplugin -lgcc \
41 $(LINKBITMAPS) -T$(LINKFILE) -Wl,--gc-sections -Wl,-Map,$(OBJDIR)/beatbox.map
43 $(OUTPUT): $(OBJDIR)/beatbox.elf
44 $(call PRINTS,OBJCOPY $(@F))$(OC) -O binary $< $@
45 else
47 ###################################################
48 # This is the SDL simulator version
50 $(OUTPUT): $(OBJS)
51 $(call PRINTS,LD $(@F))$(CC) $(CFLAGS) $(SHARED_FLAG) $(OBJS) -L$(BUILDDIR) -lplugin $(LINKBITMAPS) -o $@
52 ifeq ($(findstring CYGWIN,$(UNAME)),CYGWIN)
53 # 'x' must be kept or you'll have "Win32 error 5"
54 # $ fgrep 5 /usr/include/w32api/winerror.h | head -1
55 # #define ERROR_ACCESS_DENIED 5L
56 else
57 @chmod -x $@
58 endif
60 endif # end of simulator section
62 include $(TOOLSDIR)/make.inc
64 # MEMORYSIZE should be passed on to this makefile with the chosen memory size
65 # given in number of MB
66 $(LINKFILE): $(LDS)
67 $(call PRINTS,build $(@F))cat $< | $(CC) -DMEMORYSIZE=$(MEMORYSIZE) $(INCLUDES) $(TARGET) \
68 $(DEFINES) -E -P - >$@
70 clean:
71 $(call PRINTS,cleaning beatbox)rm -rf $(OBJDIR)/beatbox
72 $(SILENT)rm -f $(OBJDIR)/beatbox.* $(DEPFILE)
74 -include $(DEPFILE)