summaryrefslogtreecommitdiff
path: root/apps/plugins/doom/Makefile
diff options
context:
space:
mode:
authorDave Chapman <dave@dchapman.com>2006-03-28 15:44:01 +0000
committerDave Chapman <dave@dchapman.com>2006-03-28 15:44:01 +0000
commit47f4a458d636a889e955e68f896708f1276febc0 (patch)
tree99f770c02ef606f0abbdcd332ac39e69830d8007 /apps/plugins/doom/Makefile
parentfff7d6157d56f233cad5c2003475e47a5ff809a7 (diff)
downloadrockbox-47f4a458d636a889e955e68f896708f1276febc0.tar.gz
rockbox-47f4a458d636a889e955e68f896708f1276febc0.zip
Patch #2969 - Doom! Currently only working on the H300.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@9312 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps/plugins/doom/Makefile')
-rw-r--r--apps/plugins/doom/Makefile145
1 files changed, 145 insertions, 0 deletions
diff --git a/apps/plugins/doom/Makefile b/apps/plugins/doom/Makefile
new file mode 100644
index 0000000000..c45ffe78da
--- /dev/null
+++ b/apps/plugins/doom/Makefile
@@ -0,0 +1,145 @@
1################################################################
2#
3# $Id$
4#
5# $Log$
6# Revision 1.1 2006/03/28 15:44:01 dave
7# Patch #2969 - Doom! Currently only working on the H300.
8#
9#
10
11INCLUDES = -I$(APPSDIR) -I.. -I. -I$(FIRMDIR)/include -I$(FIRMDIR)/export \
12 -I$(FIRMDIR)/common -I$(FIRMDIR)/drivers -I$(OUTDIR) -I$(BUILDDIR)
13CFLAGS = $(GCCOPTS) $(INCLUDES) $(TARGET) $(EXTRA_DEFINES) \
14 -DTARGET_ID=$(TARGET_ID) -DMEM=${MEMORYSIZE} -DPLUGIN \
15 -Wno-strict-prototypes -O2
16
17ifdef APPEXTRA
18 INCLUDES += $(patsubst %,-I$(APPSDIR)/%,$(subst :, ,$(APPEXTRA)))
19endif
20
21ifneq (,$(strip $(foreach tgt,IPOD_NANO IPOD_COLOR IPOD_VIDEO,$(findstring $(tgt),$(TARGET)))))
22ifndef SIMVER
23 CFLAGS += -mstructure-size-boundary=8
24endif
25else
26ifndef SIMVER
27 CFLAGS += -D__BIG_ENDIAN__
28endif
29endif
30
31LINKFILE := $(OBJDIR)/link.lds
32DEPFILE = $(OBJDIR)/dep-doom
33SRC = info.c doomdef.c doomstat.c dstrings.c tables.c \
34 f_finale.c f_wipe.c d_net.c d_items.c g_game.c m_menu.c m_argv.c \
35 m_cheat.c m_random.c am_map.c p_ceilng.c p_doors.c p_genlin.c \
36 p_enemy.c p_floor.c p_inter.c p_lights.c p_map.c p_maputl.c p_plats.c \
37 p_pspr.c p_setup.c p_sight.c p_spec.c p_switch.c p_mobj.c p_telept.c \
38 p_tick.c p_saveg.c p_user.c r_bsp.c r_data.c r_draw.c r_main.c \
39 r_plane.c r_segs.c r_sky.c r_things.c wi_stuff.c v_video.c st_lib.c \
40 st_stuff.c hu_stuff.c hu_lib.c s_sound.c z_zone.c z_bmalloc.c sounds.c \
41 d_main.c m_misc.c m_bbox.c i_system.c i_sound.c i_video.c \
42 w_wad.c rockdoom.c
43# fixmath2.S
44
45SOURCES = $(SRC)
46OBJS := $(SRC:%.c=$(OBJDIR)/%.o)
47#OBJS2 := $(SRC:%.c=$(OBJDIR)/%.o)
48#OBJS = $(patsubst %.S, $(OBJDIR)/%.o, $(OBJS2))
49DIRS = .
50
51
52ifndef SIMVER
53ifneq (,$(findstring RECORDER,$(TARGET))) ## Archos recorder targets
54 LDS := archos.lds
55 OUTPUT = $(OUTDIR)/doom.ovl
56else ## iRiver target
57 LDS := ../plugin.lds
58 OUTPUT = $(OUTDIR)/doom.rock
59endif
60else ## simulators
61 OUTPUT = $(OUTDIR)/doom.rock
62endif
63
64all: $(OUTPUT)
65
66ifndef SIMVER
67$(OBJDIR)/doom.elf: $(OBJS) $(LINKFILE)
68 @echo "LD "`basename $@`
69 @$(CC) $(GCCOPTS) $(LDFLAGS) -nostdlib -o $@ $(OBJS) -L$(BUILDDIR) -lplugin -lgcc\
70 -T$(LINKFILE) -Wl,-Map,$(OBJDIR)/doom.map
71
72$(OUTPUT): $(OBJDIR)/doom.elf
73 @echo "OBJCOPY "`basename $@`
74 @$(OC) -O binary $< $@
75else
76
77ifeq ($(SIMVER), x11)
78###################################################
79# This is the X11 simulator version
80
81$(OUTPUT): $(OBJS)
82 @echo "LD $@"
83 @$(CC) $(CFLAGS) -shared $(OBJS) -L$(BUILDDIR) -lplugin -o $@
84ifeq ($(findstring CYGWIN,$(UNAME)),CYGWIN)
85# 'x' must be kept or you'll have "Win32 error 5"
86# $ fgrep 5 /usr/include/w32api/winerror.h | head -1
87# #define ERROR_ACCESS_DENIED 5L
88else
89 @chmod -x $@
90endif
91
92else # end of x11-simulator
93ifeq ($(SIMVER), sdl)
94###################################################
95# This is the sdl simulator version
96
97$(OUTPUT): $(OBJS)
98 @echo "LD $@"
99 @$(CC) $(CFLAGS) -shared $(OBJS) -L$(BUILDDIR) -lplugin -o $@
100ifeq ($(findstring CYGWIN,$(UNAME)),CYGWIN)
101# 'x' must be kept or you'll have "Win32 error 5"
102# $ fgrep 5 /usr/include/w32api/winerror.h | head -1
103# #define ERROR_ACCESS_DENIED 5L
104else
105 @chmod -x $@
106endif
107
108else # end of sdl-simulator
109###################################################
110# This is the win32 simulator version
111DLLTOOLFLAGS = --export-all
112DLLWRAPFLAGS = -s --entry _DllMain@12 --target=i386-mingw32 -mno-cygwin
113
114$(OUTPUT): $(OBJS)
115 @echo "DLL "`basename $@`
116 @$(DLLTOOL) $(DLLTOOLFLAGS) -z $(OBJDIR)/$*.def $(OBJS)
117 @$(DLLWRAP) $(DLLWRAPFLAGS) --def $(OBJDIR)/$*.def $(OBJS) \
118 $(BUILDDIR)/libplugin.a -o $@
119ifeq ($(findstring CYGWIN,$(UNAME)),CYGWIN)
120# 'x' must be kept or you'll have "Win32 error 5"
121# $ fgrep 5 /usr/include/w32api/winerror.h | head -1
122# #define ERROR_ACCESS_DENIED 5L
123else
124 @chmod -x $@
125endif
126endif # end of win32-simulator
127endif
128endif # end of simulator section
129
130
131include $(TOOLSDIR)/make.inc
132
133# MEMORYSIZE should be passed on to this makefile with the chosen memory size
134# given in number of MB
135$(LINKFILE): $(LDS)
136 @echo "build "`basename $@`
137 @cat $< | $(CC) -DMEMORYSIZE=$(MEMORYSIZE) $(INCLUDES) $(TARGET) $(DEFINES) \
138 -E -P - >$@
139
140clean:
141 @echo "cleaning doom"
142 @rm -rf $(OBJDIR)/doom
143 @rm -f $(OBJDIR)/doom.* $(DEPFILE)
144
145-include $(DEPFILE)