summaryrefslogtreecommitdiff
path: root/apps/plugins/sdl/sdl.make
diff options
context:
space:
mode:
Diffstat (limited to 'apps/plugins/sdl/sdl.make')
-rw-r--r--apps/plugins/sdl/sdl.make40
1 files changed, 36 insertions, 4 deletions
diff --git a/apps/plugins/sdl/sdl.make b/apps/plugins/sdl/sdl.make
index 492284e333..a00948da28 100644
--- a/apps/plugins/sdl/sdl.make
+++ b/apps/plugins/sdl/sdl.make
@@ -13,34 +13,46 @@ SDL_OBJDIR := $(BUILDDIR)/apps/plugins/sdl
13SDL_SRC := $(call preprocess, $(SDL_SRCDIR)/SOURCES) 13SDL_SRC := $(call preprocess, $(SDL_SRCDIR)/SOURCES)
14DUKE3D_SRC := $(call preprocess, $(SDL_SRCDIR)/SOURCES.duke) 14DUKE3D_SRC := $(call preprocess, $(SDL_SRCDIR)/SOURCES.duke)
15WOLF3D_SRC := $(call preprocess, $(SDL_SRCDIR)/SOURCES.wolf) 15WOLF3D_SRC := $(call preprocess, $(SDL_SRCDIR)/SOURCES.wolf)
16QUAKE_SRC := $(call preprocess, $(SDL_SRCDIR)/SOURCES.quake)
16 17
17SDL_OBJ := $(call c2obj, $(SDL_SRC)) 18SDL_OBJ := $(call c2obj, $(SDL_SRC))
18DUKE3D_OBJ = $(call c2obj, $(DUKE3D_SRC)) 19DUKE3D_OBJ = $(call c2obj, $(DUKE3D_SRC))
19WOLF3D_OBJ = $(call c2obj, $(WOLF3D_SRC)) 20WOLF3D_OBJ = $(call c2obj, $(WOLF3D_SRC))
21QUAKE_OBJ = $(call c2obj, $(QUAKE_SRC))
20 22
21# add source files to OTHER_SRC to get automatic dependencies 23# add source files to OTHER_SRC to get automatic dependencies
22OTHER_SRC += $(SDL_SRC) $(DUKE3D_SRC) $(WOLF3D_SRC) 24OTHER_SRC += $(SDL_SRC) $(DUKE3D_SRC) $(WOLF3D_SRC) $(QUAKE_SRC)
23OTHER_INC += -I$(SDL_SRCDIR)/include 25OTHER_INC += -I$(SDL_SRCDIR)/include
24 26
25# include comes first because of possible system SDL headers taking 27# include comes first because of possible system SDL headers taking
26# precedence 28# precedence
27SDLFLAGS = -I$(SDL_SRCDIR)/include $(filter-out -O%,$(PLUGINFLAGS)) \ 29# some of these are for Quake only
28-O3 -Wno-unused-parameter -Xpreprocessor -Wno-undef -Wcast-align -w 30SDLFLAGS = -I$(SDL_SRCDIR)/include $(filter-out -O%,$(PLUGINFLAGS)) \
31-O3 -Wno-unused-parameter -Xpreprocessor -Wno-undef -Wcast-align \
32-ffast-math -funroll-loops -fomit-frame-pointer -fexpensive-optimizations \
33-D_GNU_SOURCE=1 -D_REENTRANT -DSDL -DELF -w # disable all warnings
29 34
35# use FPU on ARMv6
30ifeq ($(ARCH_VERSION),6) 36ifeq ($(ARCH_VERSION),6)
31 SDLFLAGS += -mfloat-abi=softfp 37 SDLFLAGS += -mfloat-abi=softfp
32endif 38endif
33 39
34ifndef APP_TYPE 40ifndef APP_TYPE
35 ### no target has a big enough plugin buffer 41 ### no target has a big enough plugin buffer
36 ROCKS += $(SDL_OBJDIR)/duke3d.ovl $(SDL_OBJDIR)/wolf3d.ovl 42 ROCKS += $(SDL_OBJDIR)/duke3d.ovl
43 ROCKS += $(SDL_OBJDIR)/wolf3d.ovl
44 ROCKS += $(SDL_OBJDIR)/quake.ovl
45
37 DUKE3D_OUTLDS = $(SDL_OBJDIR)/duke3d.link 46 DUKE3D_OUTLDS = $(SDL_OBJDIR)/duke3d.link
38 WOLF3D_OUTLDS = $(SDL_OBJDIR)/wolf3d.link 47 WOLF3D_OUTLDS = $(SDL_OBJDIR)/wolf3d.link
48 QUAKE_OUTLDS = $(SDL_OBJDIR)/quake.link
49
39 SDL_OVLFLAGS = -Wl,--gc-sections -Wl,-Map,$(basename $@).map 50 SDL_OVLFLAGS = -Wl,--gc-sections -Wl,-Map,$(basename $@).map
40else 51else
41 ### simulator 52 ### simulator
42 ROCKS += $(SDL_OBJDIR)/duke3d.rock 53 ROCKS += $(SDL_OBJDIR)/duke3d.rock
43 ROCKS += $(SDL_OBJDIR)/wolf3d.rock 54 ROCKS += $(SDL_OBJDIR)/wolf3d.rock
55 ROCKS += $(SDL_OBJDIR)/quake.rock
44endif 56endif
45 57
46# Duke3D 58# Duke3D
@@ -77,6 +89,26 @@ $(SDL_OBJDIR)/wolf3d.ovl: $(SDL_OBJ) $(WOLF3D_OBJ) $(TLSFLIB) $(WOLF3D_OUTLDS)
77 -lgcc -T$(WOLF3D_OUTLDS) $(SDL_OVLFLAGS) 89 -lgcc -T$(WOLF3D_OUTLDS) $(SDL_OVLFLAGS)
78 $(call PRINTS,LD $(@F))$(call objcopy,$(basename $@).elf,$@) 90 $(call PRINTS,LD $(@F))$(call objcopy,$(basename $@).elf,$@)
79 91
92# Quake
93###
94
95$(SDL_OBJDIR)/quake.rock: $(SDL_OBJ) $(QUAKE_OBJ) $(TLSFLIB)
96
97$(SDL_OBJDIR)/quake.refmap: $(SDL_OBJ) $(QUAKE_OBJ) $(TLSFLIB)
98
99$(QUAKE_OUTLDS): $(PLUGIN_LDS) $(SDL_OBJDIR)/quake.refmap
100 $(call PRINTS,PP $(@F))$(call preprocess2file,$<,$@,-DOVERLAY_OFFSET=$(shell \
101 $(TOOLSDIR)/ovl_offset.pl $(SDL_OBJDIR)/quake.refmap))
102
103$(SDL_OBJDIR)/quake.ovl: $(SDL_OBJ) $(QUAKE_OBJ) $(TLSFLIB) $(QUAKE_OUTLDS)
104 $(SILENT)$(CC) $(PLUGINFLAGS) -o $(basename $@).elf \
105 $(filter %.o, $^) \
106 $(filter %.a, $+) \
107 -lgcc -T$(QUAKE_OUTLDS) $(SDL_OVLFLAGS)
108 $(call PRINTS,LD $(@F))$(call objcopy,$(basename $@).elf,$@)
109
110###
111
80# common 112# common
81 113
82$(SDL_OBJDIR)/%.o: $(SDL_SRCDIR)/%.c $(SDL_SRCDIR)/sdl.make $(BUILDDIR)/sysfont.h 114$(SDL_OBJDIR)/%.o: $(SDL_SRCDIR)/%.c $(SDL_SRCDIR)/sdl.make $(BUILDDIR)/sysfont.h