2 # Open \______ \ ____ ____ | | _\_ |__ _______ ___
3 # Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
4 # Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
5 # Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
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
)
19 CFLAGS
= $(INCLUDES
) $(GCCOPTS
) $(TARGET
) $(EXTRA_DEFINES
) $(MIDIOPTS
) \
20 -DTARGET_ID
=$(TARGET_ID
) -DMEM
=${MEMORYSIZE} -DPLUGIN
23 INCLUDES
+= $(patsubst %,-I
$(APPSDIR
)/%,$(subst :, ,$(APPEXTRA
)))
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
33 OBJS
:= $(SRC
:%.c
=$(OBJDIR
)/%.o
)
38 OUTPUT
= $(OUTDIR
)/midiplay.rock
40 OUTPUT
= $(OUTDIR
)/midiplay.rock
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
$< $@
54 ###################################################
55 # This is the SDL simulator version
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
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
74 $(call PRINTS
,build
$(@F
))cat
$< |
$(CC
) -DMEMORYSIZE
=$(MEMORYSIZE
) $(INCLUDES
) $(TARGET
) \
75 $(DEFINES
) -E
-P
- >$@
78 $(call PRINTS
,cleaning midiplay
)rm -rf
$(OBJDIR
)/midiplay
79 $(SILENT
)rm -f
$(OBJDIR
)/midiplay.
* $(DEPFILE
)