summaryrefslogtreecommitdiff
path: root/apps/plugins/shortcuts/Makefile
diff options
context:
space:
mode:
Diffstat (limited to 'apps/plugins/shortcuts/Makefile')
-rw-r--r--apps/plugins/shortcuts/Makefile90
1 files changed, 90 insertions, 0 deletions
diff --git a/apps/plugins/shortcuts/Makefile b/apps/plugins/shortcuts/Makefile
new file mode 100644
index 0000000000..93089cc140
--- /dev/null
+++ b/apps/plugins/shortcuts/Makefile
@@ -0,0 +1,90 @@
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 -I$(BUILDDIR)/pluginbitmaps
13CFLAGS = $(INCLUDES) $(GCCOPTS) $(TARGET) $(EXTRA_DEFINES) \
14 -DTARGET_ID=$(TARGET_ID) -DMEM=${MEMORYSIZE} -DPLUGIN
15
16ifdef APPEXTRA
17 INCLUDES += $(patsubst %,-I$(APPSDIR)/%,$(subst :, ,$(APPEXTRA)))
18endif
19
20LINKFILE := $(OBJDIR)/link.lds
21DEPFILE = $(OBJDIR)/dep-shortcuts
22
23SOURCES := shortcuts_common.c shortcuts_view.c shortcuts_append.c
24VIEW_OBJS := $(OBJDIR)/shortcuts_common.o $(OBJDIR)/shortcuts_view.o
25APPEND_OBJS := $(OBJDIR)/shortcuts_common.o $(OBJDIR)/shortcuts_append.o
26DIRS = .
27
28ifndef SIMVER
29 LDS := ../plugin.lds
30endif
31
32OUTPUT = $(OUTDIR)/shortcuts_view.rock $(OUTDIR)/shortcuts_append.rock
33
34all: $(OUTPUT)
35
36ifndef SIMVER
37$(OBJDIR)/shortcuts_view.elf: $(VIEW_OBJS) $(LINKFILE) $(BITMAPLIBS)
38 $(call PRINTS,LD $(@F))$(CC) $(GCCOPTS) -O -nostdlib -o $@ $(VIEW_OBJS) -L$(BUILDDIR) -lplugin -lgcc \
39 $(LINKBITMAPS) -T$(LINKFILE) -Wl,-Map,$(OBJDIR)/shortcuts_view.map
40
41$(OUTDIR)/shortcuts_view.rock: $(OBJDIR)/shortcuts_view.elf
42 $(call PRINTS,OBJCOPY $(@F))$(OC) -O binary $< $@
43
44$(OBJDIR)/shortcuts_append.elf: $(APPEND_OBJS) $(LINKFILE) $(BITMAPLIBS)
45 $(call PRINTS,LD $(@F))$(CC) $(GCCOPTS) -O -nostdlib -o $@ $(APPEND_OBJS) -L$(BUILDDIR) -lplugin -lgcc \
46 $(LINKBITMAPS) -T$(LINKFILE) -Wl,-Map,$(OBJDIR)/shortcuts_append.map
47
48$(OUTDIR)/shortcuts_append.rock: $(OBJDIR)/shortcuts_append.elf
49 $(call PRINTS,OBJCOPY $(@F))$(OC) -O binary $< $@
50else
51
52###################################################
53# This is the SDL simulator version
54
55$(OUTDIR)/shortcuts_view.rock: $(VIEW_OBJS)
56 $(call PRINTS,LD $(@F))$(CC) $(CFLAGS) $(SHARED_FLAG) $(VIEW_OBJS) -L$(BUILDDIR) -lplugin $(LINKBITMAPS) -o $@
57ifeq ($(findstring CYGWIN,$(UNAME)),CYGWIN)
58# 'x' must be kept or you'll have "Win32 error 5"
59# $ fgrep 5 /usr/include/w32api/winerror.h | head -1
60# #define ERROR_ACCESS_DENIED 5L
61else
62 @chmod -x $@
63endif
64
65$(OUTDIR)/shortcuts_append.rock: $(APPEND_OBJS)
66 $(call PRINTS,LD $(@F))$(CC) $(CFLAGS) $(SHARED_FLAG) $(APPEND_OBJS) -L$(BUILDDIR) -lplugin $(LINKBITMAPS) -o $@
67ifeq ($(findstring CYGWIN,$(UNAME)),CYGWIN)
68# 'x' must be kept or you'll have "Win32 error 5"
69# $ fgrep 5 /usr/include/w32api/winerror.h | head -1
70# #define ERROR_ACCESS_DENIED 5L
71else
72 @chmod -x $@
73endif
74
75endif # end of simulator section
76
77
78include $(TOOLSDIR)/make.inc
79
80# MEMORYSIZE should be passed on to this makefile with the chosen memory size
81# given in number of MB
82$(LINKFILE): $(LDS)
83 $(call PRINTS,build $(@F))cat $< | $(CC) -DMEMORYSIZE=$(MEMORYSIZE) $(INCLUDES) $(TARGET) \
84 $(DEFINES) -E -P - >$@
85
86clean:
87 $(call PRINTS,cleaning shortcuts)rm -rf $(OBJDIR)/shortcuts
88 $(SILENT)rm -f $(OBJDIR)/shortcuts* $(DEPFILE)
89
90-include $(DEPFILE)