summaryrefslogtreecommitdiff
path: root/apps/plugins/doom
diff options
context:
space:
mode:
authorBjörn Stenberg <bjorn@haxx.se>2008-11-20 11:27:31 +0000
committerBjörn Stenberg <bjorn@haxx.se>2008-11-20 11:27:31 +0000
commitc6b3d38a156dd624760a8eb1bb374affd43b4f2a (patch)
tree493eba929e2396d86cf4f077709aa09fe172cd35 /apps/plugins/doom
parentf66c30346783a400a029bedcd60ab67c81c34a07 (diff)
downloadrockbox-c6b3d38a156dd624760a8eb1bb374affd43b4f2a.tar.gz
rockbox-c6b3d38a156dd624760a8eb1bb374affd43b4f2a.zip
New makefile solution: A single invocation of 'make' to build the entire tree. Fully controlled dependencies give faster and more correct recompiles.
Many #include lines adjusted to conform to the new standards. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@19146 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps/plugins/doom')
-rw-r--r--apps/plugins/doom/Makefile173
-rw-r--r--apps/plugins/doom/SOURCES62
-rw-r--r--apps/plugins/doom/doom.make54
-rw-r--r--apps/plugins/doom/i_video.c2
4 files changed, 117 insertions, 174 deletions
diff --git a/apps/plugins/doom/Makefile b/apps/plugins/doom/Makefile
deleted file mode 100644
index df6baf704b..0000000000
--- a/apps/plugins/doom/Makefile
+++ /dev/null
@@ -1,173 +0,0 @@
1################################################################
2#
3# $Id$
4#
5# $Log: Makefile,v $
6# Revision 1.13 2006-12-13 06:52:09 kkurbjun
7# Free more plugin memory
8#
9# Revision 1.12 2006-12-13 05:46:51 kkurbjun
10# Will it fit?
11#
12# Revision 1.11 2006-12-13 04:44:17 kkurbjun
13# Dehacked and BEX support for Doom - currently only supports a DEHACKED file in a WAD (not as a standalone file yet).
14#
15# Revision 1.10 2006-10-27 21:47:55 amiconn
16# Next step of Makefile tuning: * Use 'make' internal commands for printing messages. Saves build time especially on cygwin. * SILENT variable used in more places. * Bitmap build system uses one Makefille less.
17#
18# Revision 1.9 2006-10-23 22:33:36 amiconn
19# Consistent style of 'make' messages. Always use ranlib after ar.
20#
21# Revision 1.8 2006-10-23 14:09:28 markun
22# rearrange compiler options to avoid conflicts with header files on FreeBSD
23#
24# Revision 1.7 2006-10-22 00:21:56 amiconn
25# Speed up build process in general by using internal functions of make instead of spawning sub-shells where possible.
26#
27# Revision 1.6 2006-09-29 20:04:35 barrywardell
28# Cleaner implementation of the recent OSX simulator build fix. No need to define SHARED_FLAG in each Makefile. Just have configure create it in the root Makefile instead.
29#
30# Revision 1.5 2006-09-29 16:15:08 barrywardell
31# Allow UI simulator to be build on OS (Slightly updated version of FS5767)
32#
33# Revision 1.4 2006-07-27 13:27:19 linus
34# Moved the X5 button driver to the target tree
35#
36# Revision 1.3 2006-04-14 21:07:56 kkurbjun
37# Start of profiling support for doom.
38#
39# Revision 1.2 2006-03-29 21:16:45 kkurbjun
40# Use rockbox endian defines
41#
42# Revision 1.1 2006-03-28 15:44:01 dave
43# Patch #2969 - Doom! Currently only working on the H300.
44#
45#
46
47INCLUDES = -I$(APPSDIR) -I.. -I. $(TARGET_INC) -I$(FIRMDIR)/include -I$(FIRMDIR)/export \
48 -I$(FIRMDIR)/common -I$(FIRMDIR)/drivers -I$(OUTDIR) -I$(BUILDDIR)
49CFLAGS = $(INCLUDES) $(GCCOPTS) $(TARGET) $(EXTRA_DEFINES) \
50 -DTARGET_ID=$(TARGET_ID) -DMEM=${MEMORYSIZE} -DPLUGIN \
51 -Wno-strict-prototypes $(PROFILE_OPTS)
52
53ifdef APPEXTRA
54 INCLUDES += $(patsubst %,-I$(APPSDIR)/%,$(subst :, ,$(APPEXTRA)))
55endif
56
57# The arm code compiles too large for the plugin buffer when set to optimize for speed
58ifeq ($(CPU), arm)
59 CFLAGS += -Os
60ifndef SIMVER
61ifeq ($(TARGET), IRIVER_H100)
62 CFLAGS += -mstructure-size-boundary=8
63endif
64endif
65else
66 CFLAGS += -O2
67endif
68
69LINKFILE := $(OBJDIR)/link.lds
70DEPFILE = $(OBJDIR)/dep-doom
71SRC = info.c doomdef.c doomstat.c dstrings.c tables.c \
72 f_finale.c f_wipe.c d_net.c d_items.c g_game.c m_menu.c m_argv.c \
73 m_cheat.c m_random.c am_map.c p_ceilng.c p_doors.c p_genlin.c \
74 p_enemy.c p_floor.c p_inter.c p_lights.c p_map.c p_maputl.c p_plats.c \
75 p_pspr.c p_setup.c p_sight.c p_spec.c p_switch.c p_mobj.c p_telept.c \
76 p_tick.c p_saveg.c p_user.c r_bsp.c r_data.c r_draw.c r_main.c \
77 r_plane.c r_segs.c r_sky.c r_things.c wi_stuff.c v_video.c st_lib.c \
78 st_stuff.c hu_stuff.c hu_lib.c s_sound.c z_zone.c z_bmalloc.c sounds.c \
79 d_main.c m_misc.c m_bbox.c i_system.c i_sound.c i_video.c \
80 w_wad.c rockdoom.c d_deh.c ../../../firmware/common/sscanf.c
81
82# sscanf isn't built into the core right now - should remove from here if that
83# changes
84
85SOURCES = $(SRC)
86OBJS := $(SRC:%.c=$(OBJDIR)/%.o)
87#OBJS2 := $(SRC:%.c=$(OBJDIR)/%.o)
88#OBJS = $(patsubst %.S, $(OBJDIR)/%.o, $(OBJS2))
89DIRS = .
90
91
92ifndef SIMVER
93 LDS := ../plugin.lds
94 OUTPUT = $(OUTDIR)/doom.rock
95else ## simulators
96 OUTPUT = $(OUTDIR)/doom.rock
97endif
98
99all: $(OUTPUT)
100
101ifndef SIMVER
102$(OBJDIR)/doom.elf: $(OBJS) $(LINKFILE)
103 $(call PRINTS,LD $(@F))$(CC) $(CFLAGS) -o $@ $(OBJS) -L$(BUILDDIR) -lplugin -lgcc\
104 -T$(LINKFILE) -Wl,--gc-sections -Wl,-Map,$(OBJDIR)/doom.map
105
106$(OUTPUT): $(OBJDIR)/doom.elf
107 $(call PRINTS,OBJCOPY $(@F))$(OC) -O binary $< $@
108else
109
110ifeq ($(SIMVER), x11)
111###################################################
112# This is the X11 simulator version
113
114$(OUTPUT): $(OBJS)
115 $(call PRINTS,LD $(@F))$(CC) $(CFLAGS) $(SHARED_FLAG) $(OBJS) -L$(BUILDDIR) -lplugin -o $@
116ifeq ($(findstring CYGWIN,$(UNAME)),CYGWIN)
117# 'x' must be kept or you'll have "Win32 error 5"
118# $ fgrep 5 /usr/include/w32api/winerror.h | head -1
119# #define ERROR_ACCESS_DENIED 5L
120else
121 @chmod -x $@
122endif
123
124else # end of x11-simulator
125ifeq ($(SIMVER), sdl)
126###################################################
127# This is the sdl simulator version
128
129$(OUTPUT): $(OBJS)
130 $(call PRINTS,LD $(@F))$(CC) $(CFLAGS) $(SHARED_FLAG) $(OBJS) -L$(BUILDDIR) -lplugin -o $@
131ifeq ($(findstring CYGWIN,$(UNAME)),CYGWIN)
132# 'x' must be kept or you'll have "Win32 error 5"
133# $ fgrep 5 /usr/include/w32api/winerror.h | head -1
134# #define ERROR_ACCESS_DENIED 5L
135else
136 @chmod -x $@
137endif
138
139else # end of sdl-simulator
140###################################################
141# This is the win32 simulator version
142DLLTOOLFLAGS = --export-all
143DLLWRAPFLAGS = -s --entry _DllMain@12 --target=i386-mingw32 -mno-cygwin
144
145$(OUTPUT): $(OBJS)
146 $(call PRINTS,DLL $(@F))$(DLLTOOL) $(DLLTOOLFLAGS) -z $(OBJDIR)/$*.def $(OBJS)
147 $(SILENT)$(DLLWRAP) $(DLLWRAPFLAGS) --def $(OBJDIR)/$*.def $(OBJS) \
148 $(BUILDDIR)/libplugin.a -o $@
149ifeq ($(findstring CYGWIN,$(UNAME)),CYGWIN)
150# 'x' must be kept or you'll have "Win32 error 5"
151# $ fgrep 5 /usr/include/w32api/winerror.h | head -1
152# #define ERROR_ACCESS_DENIED 5L
153else
154 @chmod -x $@
155endif
156endif # end of win32-simulator
157endif
158endif # end of simulator section
159
160
161include $(TOOLSDIR)/make.inc
162
163# MEMORYSIZE should be passed on to this makefile with the chosen memory size
164# given in number of MB
165$(LINKFILE): $(LDS)
166 $(call PRINTS,build $(@F))cat $< | $(CC) -DMEMORYSIZE=$(MEMORYSIZE) $(INCLUDES) $(TARGET) $(DEFINES) \
167 -E -P - >$@
168
169clean:
170 $(call PRINTS,cleaning doom)rm -rf $(OBJDIR)/doom
171 $(SILENT)rm -f $(OBJDIR)/doom.* $(DEPFILE)
172
173-include $(DEPFILE)
diff --git a/apps/plugins/doom/SOURCES b/apps/plugins/doom/SOURCES
new file mode 100644
index 0000000000..6cd69faee6
--- /dev/null
+++ b/apps/plugins/doom/SOURCES
@@ -0,0 +1,62 @@
1info.c
2doomdef.c
3doomstat.c
4dstrings.c
5tables.c
6f_finale.c
7f_wipe.c
8d_net.c
9d_items.c
10g_game.c
11m_menu.c
12m_argv.c
13m_cheat.c
14m_random.c
15am_map.c
16p_ceilng.c
17p_doors.c
18p_genlin.c
19p_enemy.c
20p_floor.c
21p_inter.c
22p_lights.c
23p_map.c
24p_maputl.c
25p_plats.c
26p_pspr.c
27p_setup.c
28p_sight.c
29p_spec.c
30p_switch.c
31p_mobj.c
32p_telept.c
33p_tick.c
34p_saveg.c
35p_user.c
36r_bsp.c
37r_data.c
38r_draw.c
39r_main.c
40r_plane.c
41r_segs.c
42r_sky.c
43r_things.c
44wi_stuff.c
45v_video.c
46st_lib.c
47st_stuff.c
48hu_stuff.c
49hu_lib.c
50s_sound.c
51z_zone.c
52z_bmalloc.c
53sounds.c
54d_main.c
55m_misc.c
56m_bbox.c
57i_system.c
58i_sound.c
59i_video.c
60w_wad.c
61rockdoom.c
62d_deh.c
diff --git a/apps/plugins/doom/doom.make b/apps/plugins/doom/doom.make
new file mode 100644
index 0000000000..d566f5307b
--- /dev/null
+++ b/apps/plugins/doom/doom.make
@@ -0,0 +1,54 @@
1# __________ __ ___.
2# Open \______ \ ____ ____ | | _\_ |__ _______ ___
3# Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
4# Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
5# Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
6# \/ \/ \/ \/ \/
7# $Id: Makefile 19082 2008-11-10 23:54:24Z zagor $
8#
9
10DOOMSRCDIR := $(APPSDIR)/plugins/doom
11DOOMBUILDDIR := $(BUILDDIR)/apps/plugins/doom
12
13ROCKS += $(DOOMBUILDDIR)/doom.rock
14
15DOOM_SRC := $(call preprocess, $(DOOMSRCDIR)/SOURCES)
16DOOM_OBJ := $(call c2obj, $(DOOM_SRC))
17DOOM_OBJ += $(DOOMBUILDDIR)/sscanf.o
18
19# add source files to OTHER_SRC to get automatic dependencies
20OTHER_SRC += $(DOOM_SRC)
21
22DOOMCFLAGS = $(PLUGINFLAGS) -Wno-strict-prototypes
23
24# The arm code compiles too large for the plugin buffer when set to optimize for speed
25ifeq ($(CPU), arm)
26 DOOMCFLAGS += -Os
27ifndef SIMVER
28ifeq ($(TARGET), IRIVER_H100)
29 DOOMCCFLAGS += -mstructure-size-boundary=8
30endif
31endif
32else
33 DOOMCFLAGS += -O2
34endif
35
36$(DOOMBUILDDIR)/sscanf.c: $(FIRMDIR)/common/sscanf.c
37 $(SILENT)mkdir -p $(dir $@)
38 $(call PRINTS,CP $<)cp $< $@
39
40$(DOOMBUILDDIR)/sscanf.o: $(DOOMBUILDDIR)/sscanf.c
41
42$(DOOMBUILDDIR)/doom.rock: $(DOOM_OBJ)
43# for some reason, this doesn't match the implicit rule in plugins.make,
44# so we have to duplicate the link command here
45 $(SILENT)$(CC) $(PLUGINFLAGS) -o $*.elf \
46 $(filter %.o, $^) \
47 $(filter %.a, $^) \
48 -lgcc $(PLUGINLDFLAGS)
49 $(call PRINTS,LD $(@F))$(OC) -O binary $*.elf $@
50
51# new rule needed to use extra compile flags
52$(DOOMBUILDDIR)/%.o: $(DOOMSRCDIR)/%.c $(DOOMSRCDIR)/doom.make
53 $(SILENT)mkdir -p $(dir $@)
54 $(call PRINTS,CC $(subst $(ROOTDIR)/,,$<))$(CC) $(DOOMCFLAGS) -c $< -o $@
diff --git a/apps/plugins/doom/i_video.c b/apps/plugins/doom/i_video.c
index 15d0166733..7713fe19f2 100644
--- a/apps/plugins/doom/i_video.c
+++ b/apps/plugins/doom/i_video.c
@@ -117,7 +117,7 @@
117#include "rockmacros.h" 117#include "rockmacros.h"
118 118
119#ifndef HAVE_LCD_COLOR 119#ifndef HAVE_LCD_COLOR
120#include "../lib/grey.h" 120#include "lib/grey.h"
121GREY_INFO_STRUCT_IRAM 121GREY_INFO_STRUCT_IRAM
122static unsigned char greybuffer[LCD_WIDTH] IBSS_ATTR; /* off screen buffer */ 122static unsigned char greybuffer[LCD_WIDTH] IBSS_ATTR; /* off screen buffer */
123static unsigned char *gbuf; 123static unsigned char *gbuf;