Overlay/games-fps/sauerbraten/files/sauerbraten-2013.01.04-QA.p...

51 lines
2.0 KiB
Diff

applied on top of sauerbraten-2013.01.04-system-enet.patch
respect LDFLAGS, CXXFLAGS and CPPFLAGS
--- sauerbraten/src/Makefile
+++ sauerbraten/src/Makefile
@@ -1,4 +1,4 @@
-CXXFLAGS= -O3 -fomit-frame-pointer
+CXXFLAGS ?= -O3 -fomit-frame-pointer
override CXXFLAGS+= -Wall -fsigned-char -fno-exceptions -fno-rtti
PLATFORM= $(shell uname -s)
@@ -139,11 +139,11 @@
-$(RM) $(CLIENT_PCH) $(CLIENT_OBJS) $(SERVER_OBJS) $(MASTER_OBJS) sauer_client sauer_server sauer_master
%.h.gch: %.h
- $(CXX) $(CXXFLAGS) -o $(subst .h.gch,.tmp.h.gch,$@) $(subst .h.gch,.h,$@)
+ $(CXX) $(CPPFLAGS) $(CXXFLAGS) -o $(subst .h.gch,.tmp.h.gch,$@) $(subst .h.gch,.h,$@)
$(MV) $(subst .h.gch,.tmp.h.gch,$@) $@
%-standalone.o: %.cpp
- $(CXX) $(CXXFLAGS) -c -o $@ $(subst -standalone.o,.cpp,$@)
+ $(CXX) $(CPPFLAGS) $(CXXFLAGS) -c -o $@ $(subst -standalone.o,.cpp,$@)
$(CLIENT_OBJS): CXXFLAGS += $(CLIENT_INCLUDES)
$(filter shared/%,$(CLIENT_OBJS)): $(filter shared/%,$(CLIENT_PCH))
@@ -168,19 +168,19 @@
install: all
else
client: $(CLIENT_OBJS)
- $(CXX) $(CXXFLAGS) -o sauer_client $(CLIENT_OBJS) $(CLIENT_LIBS)
+ $(CXX) $(CPPFLAGS) $(CXXFLAGS) $(LDFLAGS) -o sauer_client $(CLIENT_OBJS) $(CLIENT_LIBS)
server: $(SERVER_OBJS)
- $(CXX) $(CXXFLAGS) -o sauer_server $(SERVER_OBJS) $(SERVER_LIBS)
+ $(CXX) $(CPPFLAGS) $(CXXFLAGS) $(LDFLAGS) -o sauer_server $(SERVER_OBJS) $(SERVER_LIBS)
master: $(MASTER_OBJS)
- $(CXX) $(CXXFLAGS) -o sauer_master $(MASTER_OBJS) $(MASTER_LIBS)
+ $(CXX) $(CPPFLAGS) $(CXXFLAGS) $(LDFLAGS) -o sauer_master $(MASTER_OBJS) $(MASTER_LIBS)
shared/cube2font.o: shared/cube2font.c
- $(CXX) $(CXXFLAGS) -c -o $@ $< `freetype-config --cflags`
+ $(CXX) $(CPPFLAGS) $(CXXFLAGS) -c -o $@ $< `freetype-config --cflags`
cube2font: shared/cube2font.o
- $(CXX) $(CXXFLAGS) -o cube2font shared/cube2font.o `freetype-config --libs` -lz
+ $(CXX) $(CPPFLAGS) $(CXXFLAGS) $(LDFLAGS) -o cube2font shared/cube2font.o `freetype-config --libs` -lz
install: all
cp sauer_client ../bin_unix/$(PLATFORM_PREFIX)_client