summaryrefslogtreecommitdiff
path: root/apps/plugins/pacbox/Makefile
diff options
context:
space:
mode:
Diffstat (limited to 'apps/plugins/pacbox/Makefile')
-rw-r--r--apps/plugins/pacbox/Makefile113
1 files changed, 113 insertions, 0 deletions
diff --git a/apps/plugins/pacbox/Makefile b/apps/plugins/pacbox/Makefile
new file mode 100644
index 0000000000..817c6d451a
--- /dev/null
+++ b/apps/plugins/pacbox/Makefile
@@ -0,0 +1,113 @@
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) -I$(BUILDDIR)
12CFLAGS = $(INCLUDES) $(GCCOPTS) -O2 $(TARGET) $(EXTRA_DEFINES) \
13 -DTARGET_ID=$(TARGET_ID) -DMEM=${MEMORYSIZE} -DPLUGIN
14
15
16ifdef APPEXTRA
17 INCLUDES += $(patsubst %,-I$(APPSDIR)/%,$(subst :, ,$(APPEXTRA)))
18endif
19
20LINKFILE := $(OBJDIR)/link.lds
21DEPFILE = $(OBJDIR)/dep-pacbox
22SRC = arcade.c pacbox.c hardware.c z80.c
23
24SOURCES = $(SRC)
25OBJS := $(SRC:%.c=$(OBJDIR)/%.o)
26DIRS = .
27
28LDS := ../plugin.lds
29OUTPUT = $(OUTDIR)/pacbox.rock
30
31all: $(OUTPUT)
32
33ifndef SIMVER
34$(OBJDIR)/pacbox.elf: $(OBJS) $(LINKFILE)
35 @echo "LD "`basename $@`
36 @$(CC) $(GCCOPTS) -O -nostdlib -o $@ $(OBJS) -L$(BUILDDIR) -lplugin -lgcc \
37 -T$(LINKFILE) -Wl,-Map,$(OBJDIR)/pacbox.map
38
39$(OUTPUT): $(OBJDIR)/pacbox.elf
40 @echo "OBJCOPY "`basename $@`
41 @$(OC) -O binary $< $@
42else
43
44ifeq ($(SIMVER), x11)
45###################################################
46# This is the X11 simulator version
47
48$(OUTPUT): $(OBJS)
49 @echo "LD $<"
50 @$(CC) $(CFLAGS) -shared $(OBJS) -L$(BUILDDIR) -lplugin -o $@
51ifeq ($(findstring CYGWIN,$(UNAME)),CYGWIN)
52# 'x' must be kept or you'll have "Win32 error 5"
53# $ fgrep 5 /usr/include/w32api/winerror.h | head -1
54# #define ERROR_ACCESS_DENIED 5L
55else
56 @chmod -x $@
57endif
58
59else # end of x11-simulator
60ifeq ($(SIMVER), sdl)
61###################################################
62# This is the SDL simulator version
63
64$(OUTPUT): $(OBJS)
65 @echo "LD $<"
66 @$(CC) $(CFLAGS) -shared $(OBJS) -L$(BUILDDIR) -lplugin -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
75else # end of sdl-simulator
76###################################################
77# This is the win32 simulator version
78DLLTOOLFLAGS = --export-all
79DLLWRAPFLAGS = -s --entry _DllMain@12 --target=i386-mingw32 -mno-cygwin
80
81$(OUTPUT): $(OBJS)
82 @echo "DLL "`basename $@`
83 @$(DLLTOOL) $(DLLTOOLFLAGS) -z $(OBJDIR)/$*.def $(OBJS)
84 @$(DLLWRAP) $(DLLWRAPFLAGS) --def $(OBJDIR)/$*.def $(OBJS) \
85 $(BUILDDIR)/libplugin.a -o $@
86ifeq ($(findstring CYGWIN,$(UNAME)),CYGWIN)
87# 'x' must be kept or you'll have "Win32 error 5"
88# $ fgrep 5 /usr/include/w32api/winerror.h | head -1
89# #define ERROR_ACCESS_DENIED 5L
90else
91 @chmod -x $@
92endif
93endif # end of win32-simulator
94endif
95endif # end of simulator section
96
97
98include $(TOOLSDIR)/make.inc
99
100# MEMORYSIZE should be passed on to this makefile with the chosen memory size
101# given in number of MB
102$(LINKFILE): $(LDS)
103 @echo "build "`basename $@`
104 @cat $< | $(CC) -DMEMORYSIZE=$(MEMORYSIZE) $(INCLUDES) $(TARGET) \
105 $(DEFINES) -E -P - >$@
106
107clean:
108 @echo "cleaning pacbox"
109 @rm -rf $(OBJDIR)/pacbox
110 @rm -f $(OBJDIR)/pacbox.* $(DEPFILE)
111
112-include $(DEPFILE)
113