summaryrefslogtreecommitdiff
path: root/apps/plugins/midi/Makefile
diff options
context:
space:
mode:
Diffstat (limited to 'apps/plugins/midi/Makefile')
-rw-r--r--apps/plugins/midi/Makefile74
1 files changed, 74 insertions, 0 deletions
diff --git a/apps/plugins/midi/Makefile b/apps/plugins/midi/Makefile
new file mode 100644
index 0000000000..0d81c87b4b
--- /dev/null
+++ b/apps/plugins/midi/Makefile
@@ -0,0 +1,74 @@
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)
12CFLAGS = $(INCLUDES) $(GCCOPTS) $(TARGET) $(EXTRA_DEFINES) \
13 -DTARGET_ID=$(TARGET_ID) -DMEM=${MEMORYSIZE} -DPLUGIN
14
15ifdef APPEXTRA
16 INCLUDES += $(patsubst %,-I$(APPSDIR)/%,$(subst :, ,$(APPEXTRA)))
17endif
18
19LINKFILE := $(OBJDIR)/link.lds
20DEPFILE = $(OBJDIR)/dep-midiplay
21
22# This sets up 'SRC' based on the files mentioned in SOURCES
23include $(TOOLSDIR)/makesrc.inc
24
25SOURCES = $(SRC)
26OBJS := $(SRC:%.c=$(OBJDIR)/%.o)
27DIRS = .
28
29ifndef SIMVER
30 LDS := ../plugin.lds
31 OUTPUT = $(OUTDIR)/midiplay.rock
32else ## simulators
33 OUTPUT = $(OUTDIR)/midiplay.rock
34endif
35
36all: $(OUTPUT)
37
38ifndef SIMVER
39$(OBJDIR)/midiplay.elf: $(OBJS) $(LINKFILE) $(BITMAPLIBS)
40 $(call PRINTS,LD $(@F))$(CC) $(CFLAGS) -o $@ $(OBJS) -L$(BUILDDIR) -lplugin -lgcc \
41 $(LINKBITMAPS) -T$(LINKFILE) -Wl,-Map,$(OBJDIR)/midiplay.map
42
43$(OUTPUT): $(OBJDIR)/midiplay.elf
44 $(call PRINTS,OBJCOPY $(@F))$(OC) -O binary $< $@
45else
46
47###################################################
48# This is the SDL simulator version
49
50$(OUTPUT): $(OBJS)
51 $(call PRINTS,LD $(@F))$(CC) $(CFLAGS) $(SHARED_FLAG) $(OBJS) -L$(BUILDDIR) -lplugin $(LINKBITMAPS) -o $@
52ifeq ($(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
56else
57 @chmod -x $@
58endif
59
60endif # end of simulator section
61
62include $(TOOLSDIR)/make.inc
63
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 - >$@
69
70clean:
71 $(call PRINTS,cleaning midiplay)rm -rf $(OBJDIR)/midiplay
72 $(SILENT)rm -f $(OBJDIR)/midiplay.* $(DEPFILE)
73
74-include $(DEPFILE)