Gigabeat S: Make MIN_BRIGHTNESS_SETTING to be 1, not 0; the backlight already has...
[kugel-rb.git] / apps / plugins / doom / Makefile
blobdf6baf704bd0cdd06d76bb00a75a6b7a1b4276bd
1 ################################################################
3 # $Id$
5 # $Log: Makefile,v $
6 # Revision 1.13 2006-12-13 06:52:09 kkurbjun
7 # Free more plugin memory
9 # Revision 1.12 2006-12-13 05:46:51 kkurbjun
10 # Will it fit?
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).
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.
18 # Revision 1.9 2006-10-23 22:33:36 amiconn
19 # Consistent style of 'make' messages. Always use ranlib after ar.
21 # Revision 1.8 2006-10-23 14:09:28 markun
22 # rearrange compiler options to avoid conflicts with header files on FreeBSD
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.
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.
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)
33 # Revision 1.4 2006-07-27 13:27:19 linus
34 # Moved the X5 button driver to the target tree
36 # Revision 1.3 2006-04-14 21:07:56 kkurbjun
37 # Start of profiling support for doom.
39 # Revision 1.2 2006-03-29 21:16:45 kkurbjun
40 # Use rockbox endian defines
42 # Revision 1.1 2006-03-28 15:44:01 dave
43 # Patch #2969 - Doom! Currently only working on the H300.
47 INCLUDES = -I$(APPSDIR) -I.. -I. $(TARGET_INC) -I$(FIRMDIR)/include -I$(FIRMDIR)/export \
48 -I$(FIRMDIR)/common -I$(FIRMDIR)/drivers -I$(OUTDIR) -I$(BUILDDIR)
49 CFLAGS = $(INCLUDES) $(GCCOPTS) $(TARGET) $(EXTRA_DEFINES) \
50 -DTARGET_ID=$(TARGET_ID) -DMEM=${MEMORYSIZE} -DPLUGIN \
51 -Wno-strict-prototypes $(PROFILE_OPTS)
53 ifdef APPEXTRA
54 INCLUDES += $(patsubst %,-I$(APPSDIR)/%,$(subst :, ,$(APPEXTRA)))
55 endif
57 # The arm code compiles too large for the plugin buffer when set to optimize for speed
58 ifeq ($(CPU), arm)
59 CFLAGS += -Os
60 ifndef SIMVER
61 ifeq ($(TARGET), IRIVER_H100)
62 CFLAGS += -mstructure-size-boundary=8
63 endif
64 endif
65 else
66 CFLAGS += -O2
67 endif
69 LINKFILE := $(OBJDIR)/link.lds
70 DEPFILE = $(OBJDIR)/dep-doom
71 SRC = 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
82 # sscanf isn't built into the core right now - should remove from here if that
83 # changes
85 SOURCES = $(SRC)
86 OBJS := $(SRC:%.c=$(OBJDIR)/%.o)
87 #OBJS2 := $(SRC:%.c=$(OBJDIR)/%.o)
88 #OBJS = $(patsubst %.S, $(OBJDIR)/%.o, $(OBJS2))
89 DIRS = .
92 ifndef SIMVER
93 LDS := ../plugin.lds
94 OUTPUT = $(OUTDIR)/doom.rock
95 else ## simulators
96 OUTPUT = $(OUTDIR)/doom.rock
97 endif
99 all: $(OUTPUT)
101 ifndef 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
106 $(OUTPUT): $(OBJDIR)/doom.elf
107 $(call PRINTS,OBJCOPY $(@F))$(OC) -O binary $< $@
108 else
110 ifeq ($(SIMVER), x11)
111 ###################################################
112 # This is the X11 simulator version
114 $(OUTPUT): $(OBJS)
115 $(call PRINTS,LD $(@F))$(CC) $(CFLAGS) $(SHARED_FLAG) $(OBJS) -L$(BUILDDIR) -lplugin -o $@
116 ifeq ($(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
120 else
121 @chmod -x $@
122 endif
124 else # end of x11-simulator
125 ifeq ($(SIMVER), sdl)
126 ###################################################
127 # This is the sdl simulator version
129 $(OUTPUT): $(OBJS)
130 $(call PRINTS,LD $(@F))$(CC) $(CFLAGS) $(SHARED_FLAG) $(OBJS) -L$(BUILDDIR) -lplugin -o $@
131 ifeq ($(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
135 else
136 @chmod -x $@
137 endif
139 else # end of sdl-simulator
140 ###################################################
141 # This is the win32 simulator version
142 DLLTOOLFLAGS = --export-all
143 DLLWRAPFLAGS = -s --entry _DllMain@12 --target=i386-mingw32 -mno-cygwin
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 $@
149 ifeq ($(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
153 else
154 @chmod -x $@
155 endif
156 endif # end of win32-simulator
157 endif
158 endif # end of simulator section
161 include $(TOOLSDIR)/make.inc
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 - >$@
169 clean:
170 $(call PRINTS,cleaning doom)rm -rf $(OBJDIR)/doom
171 $(SILENT)rm -f $(OBJDIR)/doom.* $(DEPFILE)
173 -include $(DEPFILE)