shithub: duke3d

Download patch

ref: 48ddd02b88aaaf4d78df2472ff7c115cc4bd5db4
parent: b0697be2af41889fedcaa7bcc3b1ddae8ef95b6a
author: Marshall Banana <djcj@gmx.de>
date: Sat May 2 19:20:43 EDT 2015

Fix compiling premap.o with -O0

--- a/.gitignore
+++ b/.gitignore
@@ -20,11 +20,13 @@
 *.a
 *~
 chocolate-duke3d
+duke3d.cfg
 duke3d.grp
 
 # GNU automake
 .deps
 /aclocal.m4
+/autom4te.cache
 /build-aux
 Makefile
 Makefile.in
--- a/Game/src/Makefile.am
+++ b/Game/src/Makefile.am
@@ -1,11 +1,14 @@
 SUBDIRS = audiolib midi
 
 noinst_LIBRARIES = libGame.a
+
 libGame_a_SOURCES = \
 	actors.c animlib.c config.c console.c control.c cvar_defs.c cvars.c dummy_audiolib.c game.c \
-	gamedef.c global.c keyboard.c menues.c player.c premap.c rts.c scriplib.c sector.c sounds.c
-libGame_a_LIBADD = audiolib/libaudio.a midi/libmidi.a
+	gamedef.c global.c keyboard.c menues.c player.c rts.c scriplib.c sector.c sounds.c
+libGame_a_LIBADD = premap.o
 libGame_a_CFLAGS = -I$(top_srcdir)/Engine/src
 
-# starting a new game will lead to a crash if built with -O1/-O2/-O3
-premap.o: CFLAGS+=-O0
+# Starting a new game will lead to a crash if premap.o was built with -O1/-O2/-O3,
+# that's why we're compiling it seperately with -O0
+premap.o: premap.c
+	$(AM_V_CC)$(CC) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -I$(top_srcdir)/Engine/src -O0 -c $^ -o $@