summaryrefslogtreecommitdiff
path: root/apps/plugins/databox/Makefile
diff options
context:
space:
mode:
Diffstat (limited to 'apps/plugins/databox/Makefile')
-rw-r--r--apps/plugins/databox/Makefile96
1 files changed, 96 insertions, 0 deletions
diff --git a/apps/plugins/databox/Makefile b/apps/plugins/databox/Makefile
new file mode 100644
index 0000000000..25457b8c6c
--- /dev/null
+++ b/apps/plugins/databox/Makefile
@@ -0,0 +1,96 @@
1# __________ __ ___.
2# Open \______ \ ____ ____ | | _\_ |__ _______ ___
3# Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
4# Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
5# Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
6# \/ \/ \/ \/ \/
7# $Id$
8#
9
10INCLUDES = -I$(APPSDIR) -I.. -I. -I$(FIRMDIR)/include -I$(FIRMDIR)/export \
11 -I$(FIRMDIR)/common -I$(FIRMDIR)/drivers -I$(OUTDIR)
12CFLAGS = $(GCCOPTS) -O3 $(INCLUDES) $(TARGET) $(EXTRA_DEFINES) \
13 -DMEM=${MEMORYSIZE} -DPLUGIN
14
15ifdef APPEXTRA
16 INCLUDES += -I$(APPSDIR)/$(APPEXTRA)
17endif
18
19LINKFILE := $(OBJDIR)/link.lds
20DEPFILE = $(OBJDIR)/dep-databox
21SRC = databox.c editparser.c edittoken.c
22
23SOURCES = $(SRC)
24OBJS := $(SRC:%.c=$(OBJDIR)/%.o)
25DIRS = .
26
27LDS := ../plugin.lds
28OUTPUT = $(OUTDIR)/databox.rock
29
30all: $(OUTPUT)
31
32ifndef SIMVER
33$(OBJDIR)/databox.elf: $(OBJS) $(LINKFILE) $(OUTDIR)/libplugin.a
34 @echo "LD $@"
35 @$(CC) $(GCCOPTS) -O -nostdlib -o $@ $(OBJS) -L$(OUTDIR) -lplugin -lgcc \
36 -T$(LINKFILE) -Wl,-Map,$(OBJDIR)/searchengine.map
37
38$(OUTPUT): $(OBJDIR)/databox.elf
39 @echo "OBJCOPY $<"
40 @$(OC) -O binary $< $@
41else
42
43ifeq ($(SIMVER), x11)
44###################################################
45# This is the X11 simulator version
46
47$(OUTPUT): $(OBJS) $(OUTDIR)/libplugin.a
48 @echo "LD $@"
49 @$(CC) $(CFLAGS) -shared $(OBJS) -L$(OUTDIR) -lplugin -o $@
50ifeq ($(findstring CYGWIN,$(UNAME)),CYGWIN)
51# 'x' must be kept or you'll have "Win32 error 5"
52# $ fgrep 5 /usr/include/w32api/winerror.h | head -1
53# #define ERROR_ACCESS_DENIED 5L
54else
55 @chmod -x $@
56endif
57
58else # end of x11-simulator
59###################################################
60# This is the win32 simulator version
61DLLTOOLFLAGS = --export-all
62DLLWRAPFLAGS = -s --entry _DllMain@12 --target=i386-mingw32 -mno-cygwin
63
64$(OUTPUT): $(OBJS) $(OUTDIR)/libplugin.a
65 @echo "DLL $@"
66 @$(DLLTOOL) $(DLLTOOLFLAGS) -z $(OBJDIR)/$*.def $(OBJS)
67 @$(DLLWRAP) $(DLLWRAPFLAGS) --def $(OBJDIR)/$*.def $(OBJS) \
68 $(OUTDIR)/libplugin.a -o $@
69ifeq ($(findstring CYGWIN,$(UNAME)),CYGWIN)
70# 'x' must be kept or you'll have "Win32 error 5"
71# $ fgrep 5 /usr/include/w32api/winerror.h | head -1
72# #define ERROR_ACCESS_DENIED 5L
73else
74 @chmod -x $@
75endif
76endif # end of win32-simulator
77
78endif # end of simulator section
79
80
81include $(TOOLSDIR)/make.inc
82
83# MEM should be passed on to this makefile with the chosen memory size given
84# in number of MB
85$(LINKFILE): $(LDS)
86 @echo "build $@"
87 @cat $< | $(CC) -DMEMORYSIZE=$(MEMORYSIZE) $(INCLUDES) $(TARGET) $(DEFINES) \
88 -E -P - >$@
89
90clean:
91 @echo "cleaning databox"
92 @rm -rf $(OBJDIR)/databox
93 @rm -f $(OBJDIR)/databox.* $(DEPFILE)
94
95-include $(DEPFILE)
96