summaryrefslogtreecommitdiff
path: root/apps/plugins/midi
diff options
context:
space:
mode:
Diffstat (limited to 'apps/plugins/midi')
-rw-r--r--apps/plugins/midi/Makefile77
-rw-r--r--apps/plugins/midi/midi.make28
2 files changed, 28 insertions, 77 deletions
diff --git a/apps/plugins/midi/Makefile b/apps/plugins/midi/Makefile
deleted file mode 100644
index 03d6bc69bb..0000000000
--- a/apps/plugins/midi/Makefile
+++ /dev/null
@@ -1,77 +0,0 @@
1# __________ __ ___.
2# Open \______ \ ____ ____ | | _\_ |__ _______ ___
3# Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
4# Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
5# Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
6# \/ \/ \/ \/ \/
7# $Id $
8#
9
10INCLUDES = -I$(APPSDIR) -I.. -I. $(TARGET_INC) -I$(FIRMDIR)/include -I$(FIRMDIR)/export \
11 -I$(FIRMDIR)/common -I$(FIRMDIR)/drivers -I$(OUTDIR) -I$(BUILDDIR)
12
13 MIDIOPTS = -O2
14
15CFLAGS = $(INCLUDES) $(GCCOPTS) $(TARGET) $(EXTRA_DEFINES) $(MIDIOPTS) \
16 -DTARGET_ID=$(TARGET_ID) -DMEM=${MEMORYSIZE} -DPLUGIN
17
18ifdef APPEXTRA
19 INCLUDES += $(patsubst %,-I$(APPSDIR)/%,$(subst :, ,$(APPEXTRA)))
20endif
21
22LINKFILE := $(OBJDIR)/link.lds
23DEPFILE = $(OBJDIR)/dep-midiplay
24
25# This sets up 'SRC' based on the files mentioned in SOURCES
26include $(TOOLSDIR)/makesrc.inc
27
28SOURCES = $(SRC)
29OBJS := $(SRC:%.c=$(OBJDIR)/%.o)
30DIRS = .
31
32ifndef SIMVER
33 LDS := ../plugin.lds
34 OUTPUT = $(OUTDIR)/midiplay.rock
35else ## simulators
36 OUTPUT = $(OUTDIR)/midiplay.rock
37endif
38
39all: $(OUTPUT)
40
41ifndef 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
45
46$(OUTPUT): $(OBJDIR)/midiplay.elf
47 $(call PRINTS,OBJCOPY $(@F))$(OC) -O binary $< $@
48else
49
50###################################################
51# This is the SDL simulator version
52
53$(OUTPUT): $(OBJS)
54 $(call PRINTS,LD $(@F))$(CC) $(CFLAGS) $(SHARED_FLAG) $(OBJS) -L$(BUILDDIR) -lplugin $(LINKBITMAPS) -o $@
55ifeq ($(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
59else
60 @chmod -x $@
61endif
62
63endif # end of simulator section
64
65include $(TOOLSDIR)/make.inc
66
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 - >$@
72
73clean:
74 $(call PRINTS,cleaning midiplay)rm -rf $(OBJDIR)/midiplay
75 $(SILENT)rm -f $(OBJDIR)/midiplay.* $(DEPFILE)
76
77-include $(DEPFILE)
diff --git a/apps/plugins/midi/midi.make b/apps/plugins/midi/midi.make
new file mode 100644
index 0000000000..9100764974
--- /dev/null
+++ b/apps/plugins/midi/midi.make
@@ -0,0 +1,28 @@
1# __________ __ ___.
2# Open \______ \ ____ ____ | | _\_ |__ _______ ___
3# Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
4# Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
5# Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
6# \/ \/ \/ \/ \/
7# $Id: Makefile 19082 2008-11-10 23:54:24Z zagor $
8#
9
10MIDISRCDIR := $(APPSDIR)/plugins/midi
11MIDIBUILDDIR := $(BUILDDIR)/apps/plugins/midi
12
13ROCKS += $(MIDIBUILDDIR)/midi.rock
14
15MIDI_SRC := $(call preprocess, $(MIDISRCDIR)/SOURCES)
16MIDI_OBJ := $(call c2obj, $(MIDI_SRC))
17
18# add source files to OTHER_SRC to get automatic dependencies
19OTHER_SRC += $(MIDI_SRC)
20
21$(MIDIBUILDDIR)/midi.rock: $(MIDI_OBJ)
22# for some reason, this doesn't match the implicit rule in plugins.make,
23# so we have to duplicate the link command here
24 $(SILENT)$(CC) $(PLUGINFLAGS) -o $*.elf \
25 $(filter %.o, $^) \
26 $(filter %.a, $^) \
27 -lgcc $(PLUGINLDFLAGS)
28 $(call PRINTS,LD $(@F))$(OC) -O binary $*.elf $@