diff options
Diffstat (limited to 'apps/plugins/doom/Makefile')
-rw-r--r-- | apps/plugins/doom/Makefile | 145 |
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 | |||
11 | INCLUDES = -I$(APPSDIR) -I.. -I. -I$(FIRMDIR)/include -I$(FIRMDIR)/export \ | ||
12 | -I$(FIRMDIR)/common -I$(FIRMDIR)/drivers -I$(OUTDIR) -I$(BUILDDIR) | ||
13 | CFLAGS = $(GCCOPTS) $(INCLUDES) $(TARGET) $(EXTRA_DEFINES) \ | ||
14 | -DTARGET_ID=$(TARGET_ID) -DMEM=${MEMORYSIZE} -DPLUGIN \ | ||
15 | -Wno-strict-prototypes -O2 | ||
16 | |||
17 | ifdef APPEXTRA | ||
18 | INCLUDES += $(patsubst %,-I$(APPSDIR)/%,$(subst :, ,$(APPEXTRA))) | ||
19 | endif | ||
20 | |||
21 | ifneq (,$(strip $(foreach tgt,IPOD_NANO IPOD_COLOR IPOD_VIDEO,$(findstring $(tgt),$(TARGET))))) | ||
22 | ifndef SIMVER | ||
23 | CFLAGS += -mstructure-size-boundary=8 | ||
24 | endif | ||
25 | else | ||
26 | ifndef SIMVER | ||
27 | CFLAGS += -D__BIG_ENDIAN__ | ||
28 | endif | ||
29 | endif | ||
30 | |||
31 | LINKFILE := $(OBJDIR)/link.lds | ||
32 | DEPFILE = $(OBJDIR)/dep-doom | ||
33 | SRC = 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 | |||
45 | SOURCES = $(SRC) | ||
46 | OBJS := $(SRC:%.c=$(OBJDIR)/%.o) | ||
47 | #OBJS2 := $(SRC:%.c=$(OBJDIR)/%.o) | ||
48 | #OBJS = $(patsubst %.S, $(OBJDIR)/%.o, $(OBJS2)) | ||
49 | DIRS = . | ||
50 | |||
51 | |||
52 | ifndef SIMVER | ||
53 | ifneq (,$(findstring RECORDER,$(TARGET))) ## Archos recorder targets | ||
54 | LDS := archos.lds | ||
55 | OUTPUT = $(OUTDIR)/doom.ovl | ||
56 | else ## iRiver target | ||
57 | LDS := ../plugin.lds | ||
58 | OUTPUT = $(OUTDIR)/doom.rock | ||
59 | endif | ||
60 | else ## simulators | ||
61 | OUTPUT = $(OUTDIR)/doom.rock | ||
62 | endif | ||
63 | |||
64 | all: $(OUTPUT) | ||
65 | |||
66 | ifndef 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 $< $@ | ||
75 | else | ||
76 | |||
77 | ifeq ($(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 $@ | ||
84 | ifeq ($(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 | ||
88 | else | ||
89 | @chmod -x $@ | ||
90 | endif | ||
91 | |||
92 | else # end of x11-simulator | ||
93 | ifeq ($(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 $@ | ||
100 | ifeq ($(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 | ||
104 | else | ||
105 | @chmod -x $@ | ||
106 | endif | ||
107 | |||
108 | else # end of sdl-simulator | ||
109 | ################################################### | ||
110 | # This is the win32 simulator version | ||
111 | DLLTOOLFLAGS = --export-all | ||
112 | DLLWRAPFLAGS = -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 $@ | ||
119 | ifeq ($(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 | ||
123 | else | ||
124 | @chmod -x $@ | ||
125 | endif | ||
126 | endif # end of win32-simulator | ||
127 | endif | ||
128 | endif # end of simulator section | ||
129 | |||
130 | |||
131 | include $(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 | |||
140 | clean: | ||
141 | @echo "cleaning doom" | ||
142 | @rm -rf $(OBJDIR)/doom | ||
143 | @rm -f $(OBJDIR)/doom.* $(DEPFILE) | ||
144 | |||
145 | -include $(DEPFILE) | ||