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