use the list context in credits which has to be defined for every target
[Rockbox.git] / apps / plugins / midi / Makefile
blob94359024f18dea1089db78af9f7161004ce2851a
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 ifeq ($(CPU),coldfire)
14 MIDIOPTS = -O2
15 else
16 MIDIOPTS = -O
17 endif
19 CFLAGS = $(INCLUDES) $(GCCOPTS) $(TARGET) $(EXTRA_DEFINES) $(MIDIOPTS) \
20 -DTARGET_ID=$(TARGET_ID) -DMEM=${MEMORYSIZE} -DPLUGIN
22 ifdef APPEXTRA
23 INCLUDES += $(patsubst %,-I$(APPSDIR)/%,$(subst :, ,$(APPEXTRA)))
24 endif
26 LINKFILE := $(OBJDIR)/link.lds
27 DEPFILE = $(OBJDIR)/dep-midiplay
29 # This sets up 'SRC' based on the files mentioned in SOURCES
30 include $(TOOLSDIR)/makesrc.inc
32 SOURCES = $(SRC)
33 OBJS := $(SRC:%.c=$(OBJDIR)/%.o)
34 DIRS = .
36 ifndef SIMVER
37 LDS := ../plugin.lds
38 OUTPUT = $(OUTDIR)/midiplay.rock
39 else ## simulators
40 OUTPUT = $(OUTDIR)/midiplay.rock
41 endif
43 all: $(OUTPUT)
45 ifndef SIMVER
46 $(OBJDIR)/midiplay.elf: $(OBJS) $(LINKFILE) $(BITMAPLIBS)
47 $(call PRINTS,LD $(@F))$(CC) $(CFLAGS) -o $@ $(OBJS) -L$(BUILDDIR) -lplugin -lgcc \
48 $(LINKBITMAPS) -T$(LINKFILE) -Wl,-Map,$(OBJDIR)/midiplay.map
50 $(OUTPUT): $(OBJDIR)/midiplay.elf
51 $(call PRINTS,OBJCOPY $(@F))$(OC) -O binary $< $@
52 else
54 ###################################################
55 # This is the SDL simulator version
57 $(OUTPUT): $(OBJS)
58 $(call PRINTS,LD $(@F))$(CC) $(CFLAGS) $(SHARED_FLAG) $(OBJS) -L$(BUILDDIR) -lplugin $(LINKBITMAPS) -o $@
59 ifeq ($(findstring CYGWIN,$(UNAME)),CYGWIN)
60 # 'x' must be kept or you'll have "Win32 error 5"
61 # $ fgrep 5 /usr/include/w32api/winerror.h | head -1
62 # #define ERROR_ACCESS_DENIED 5L
63 else
64 @chmod -x $@
65 endif
67 endif # end of simulator section
69 include $(TOOLSDIR)/make.inc
71 # MEMORYSIZE should be passed on to this makefile with the chosen memory size
72 # given in number of MB
73 $(LINKFILE): $(LDS)
74 $(call PRINTS,build $(@F))cat $< | $(CC) -DMEMORYSIZE=$(MEMORYSIZE) $(INCLUDES) $(TARGET) \
75 $(DEFINES) -E -P - >$@
77 clean:
78 $(call PRINTS,cleaning midiplay)rm -rf $(OBJDIR)/midiplay
79 $(SILENT)rm -f $(OBJDIR)/midiplay.* $(DEPFILE)
81 -include $(DEPFILE)