Commit 3d578b0e authored by Oliver Bock's avatar Oliver Bock
Browse files

Optimized makefiles (e.g. make sure LDFLAGS isn't emptied by concatenation)

parent 5a4a7dc9
......@@ -26,7 +26,7 @@ FRAMEWORK_INSTALL?=$(PWD)
CXX?=g++
# variables
CPPFLAGS = $(shell $(FRAMEWORK_INSTALL)/bin/sdl-config --cflags)
CPPFLAGS += $(shell $(FRAMEWORK_INSTALL)/bin/sdl-config --cflags)
CPPFLAGS += $(shell $(FRAMEWORK_INSTALL)/bin/freetype-config --cflags)
CPPFLAGS += $(shell $(FRAMEWORK_INSTALL)/bin/xml2-config --cflags)
CPPFLAGS += -I$(FRAMEWORK_INSTALL)/include/BOINC -I/usr/include
......@@ -47,7 +47,6 @@ release: clean libframework.a
# target specific options
debug: CPPFLAGS += -pg -ggdb3 -O0 -Wall -Wno-switch-enum
release: CPPFLAGS += -DNDEBUG -ggdb3 -O3 -Wall -Wno-switch-enum
release: LDFLAGS +=
# file based targets
libframework.a: $(OBJS)
......@@ -55,19 +54,19 @@ libframework.a: $(OBJS)
AbstractGraphicsEngine.o: $(DEPS) $(FRAMEWORK_SRC)/AbstractGraphicsEngine.cpp $(FRAMEWORK_SRC)/AbstractGraphicsEngine.h
$(CXX) -g ${CPPFLAGS} -c $(FRAMEWORK_SRC)/AbstractGraphicsEngine.cpp
GraphicsEngineFactory.o: $(DEPS) $(FRAMEWORK_SRC)/GraphicsEngineFactory.cpp $(FRAMEWORK_SRC)/GraphicsEngineFactory.h
$(CXX) -g ${CPPFLAGS} -c $(FRAMEWORK_SRC)/GraphicsEngineFactory.cpp
WindowManager.o: $(DEPS) $(FRAMEWORK_SRC)/WindowManager.cpp $(FRAMEWORK_SRC)/WindowManager.h
$(CXX) -g ${CPPFLAGS} -c $(FRAMEWORK_SRC)/WindowManager.cpp
BOINCClientAdapter.o: $(DEPS) $(FRAMEWORK_SRC)/BOINCClientAdapter.cpp $(FRAMEWORK_SRC)/BOINCClientAdapter.h
$(CXX) -g ${CPPFLAGS} -c $(FRAMEWORK_SRC)/BOINCClientAdapter.cpp
ResourceFactory.o: $(DEPS) $(FRAMEWORK_SRC)/ResourceFactory.cpp $(FRAMEWORK_SRC)/ResourceFactory.h
$(CXX) -g ${CPPFLAGS} -c $(FRAMEWORK_SRC)/ResourceFactory.cpp
Resource.o: $(DEPS) $(FRAMEWORK_SRC)/Resource.cpp $(FRAMEWORK_SRC)/Resource.h
$(CXX) -g ${CPPFLAGS} -c $(FRAMEWORK_SRC)/Resource.cpp
......
......@@ -26,7 +26,7 @@ FRAMEWORK_INSTALL?=$(PWD)
CXX?=g++
# variables
CPPFLAGS = $(shell $(FRAMEWORK_INSTALL)/bin/sdl-config --cflags)
CPPFLAGS += $(shell $(FRAMEWORK_INSTALL)/bin/sdl-config --cflags)
CPPFLAGS += $(shell $(FRAMEWORK_INSTALL)/bin/freetype-config --cflags)
CPPFLAGS += $(shell $(FRAMEWORK_INSTALL)/bin/xml2-config --cflags)
CPPFLAGS += -I$(FRAMEWORK_INSTALL)/include/BOINC -I$(FRAMEWORK_INSTALL)/include
......@@ -47,7 +47,6 @@ release: clean libframework.a
# target specific options
debug: CPPFLAGS += -pg -gstabs3 -O0 -Wall -Wno-switch-enum
release: CPPFLAGS += -DNDEBUG -gstabs3 -O3 -Wall -Wno-switch-enum
release: LDFLAGS +=
# file based targets
libframework.a: $(OBJS)
......@@ -55,19 +54,19 @@ libframework.a: $(OBJS)
AbstractGraphicsEngine.o: $(DEPS) $(FRAMEWORK_SRC)/AbstractGraphicsEngine.cpp $(FRAMEWORK_SRC)/AbstractGraphicsEngine.h
$(CXX) -g ${CPPFLAGS} -c $(FRAMEWORK_SRC)/AbstractGraphicsEngine.cpp
GraphicsEngineFactory.o: $(DEPS) $(FRAMEWORK_SRC)/GraphicsEngineFactory.cpp $(FRAMEWORK_SRC)/GraphicsEngineFactory.h
$(CXX) -g ${CPPFLAGS} -c $(FRAMEWORK_SRC)/GraphicsEngineFactory.cpp
WindowManager.o: $(DEPS) $(FRAMEWORK_SRC)/WindowManager.cpp $(FRAMEWORK_SRC)/WindowManager.h
$(CXX) -g ${CPPFLAGS} -c $(FRAMEWORK_SRC)/WindowManager.cpp
BOINCClientAdapter.o: $(DEPS) $(FRAMEWORK_SRC)/BOINCClientAdapter.cpp $(FRAMEWORK_SRC)/BOINCClientAdapter.h
$(CXX) -g ${CPPFLAGS} -c $(FRAMEWORK_SRC)/BOINCClientAdapter.cpp
ResourceFactory.o: $(DEPS) $(FRAMEWORK_SRC)/ResourceFactory.cpp $(FRAMEWORK_SRC)/ResourceFactory.h
$(CXX) -g ${CPPFLAGS} -c $(FRAMEWORK_SRC)/ResourceFactory.cpp
Resource.o: $(DEPS) $(FRAMEWORK_SRC)/Resource.cpp $(FRAMEWORK_SRC)/Resource.h
$(CXX) -g ${CPPFLAGS} -c $(FRAMEWORK_SRC)/Resource.cpp
......
......@@ -26,15 +26,19 @@ STARSPHERE_INSTALL?=$(PWD)
CXX ?= g++
# variables
LIBS = -Wl,-Bstatic -lframework -loglft -L$(STARSPHERE_INSTALL)/lib
LIBS += -Wl,-Bstatic -lframework -loglft -L$(STARSPHERE_INSTALL)/lib
LIBS += $(shell $(STARSPHERE_INSTALL)/bin/freetype-config --libs)
LIBS += $(shell $(STARSPHERE_INSTALL)/bin/xml2-config --libs)
LIBS += -lboinc_api -lboinc -L/usr/lib
LIBS += -Wl,-Bdynamic $(shell $(STARSPHERE_INSTALL)/bin/sdl-config --static-libs) -lGL -lGLU
LIBS += -lboinc_api -lboinc
LIBS += -lstdc++
LIBS += -L/usr/lib
LIBS += -Wl,-Bdynamic $(shell $(STARSPHERE_INSTALL)/bin/sdl-config --static-libs)
LIBS += -lGL -lGLU
LIBS += -lpthread -lm -lc
LDFLAGS = -static-libgcc
LDFLAGS += -static-libgcc
CPPFLAGS = -I$(STARSPHERE_INSTALL)/include
CPPFLAGS += -I$(STARSPHERE_INSTALL)/include
CPPFLAGS += $(shell $(STARSPHERE_INSTALL)/bin/sdl-config --cflags)
CPPFLAGS += $(shell $(STARSPHERE_INSTALL)/bin/freetype-config --cflags)
CPPFLAGS += $(shell $(STARSPHERE_INSTALL)/bin/xml2-config --cflags)
......@@ -58,7 +62,6 @@ callgrind: clean debug starsphere
# target specific options
debug: CPPFLAGS += -pg -ggdb3 -O0 -Wall -Wno-switch-enum
release: CPPFLAGS += -DNDEBUG -ggdb3 -O3 -Wall -Wno-switch-enum
release: LDFLAGS +=
starsphere_EinsteinS5R3: CPPFLAGS += -D SCIENCE_APP=EinsteinS5R3
starsphere_EinsteinRadio: CPPFLAGS += -D SCIENCE_APP=EinsteinRadio
memcheck: CPPFLAGS += $(DEBUGFLAGSCPP) -D DEBUG_VALGRIND
......@@ -73,7 +76,7 @@ starsphere_EinsteinRadio: $(DEPS) $(STARSPHERE_SRC)/main.cpp $(OBJS)
Starsphere.o: $(DEPS) $(STARSPHERE_SRC)/Starsphere.cpp $(STARSPHERE_SRC)/Starsphere.h
$(CXX) -g $(CPPFLAGS) -c $(STARSPHERE_SRC)/Starsphere.cpp
StarsphereS5R3.o: $(DEPS) $(STARSPHERE_SRC)/StarsphereS5R3.cpp $(STARSPHERE_SRC)/StarsphereS5R3.h
$(CXX) -g $(CPPFLAGS) -c $(STARSPHERE_SRC)/StarsphereS5R3.cpp
......
......@@ -26,15 +26,17 @@ STARSPHERE_INSTALL?=$(PWD)
CXX ?= g++
# variables
LIBS = -lframework -loglft -L$(STARSPHERE_INSTALL)/lib
LIBS += -lframework -loglft -L$(STARSPHERE_INSTALL)/lib
LIBS += $(shell $(STARSPHERE_INSTALL)/bin/freetype-config --libs)
LIBS += $(shell $(STARSPHERE_INSTALL)/bin/xml2-config --libs)
LIBS += -lboinc_graphics2 -lboinc_api -lboinc -L$(STARSPHERE_INSTALL)/lib
LIBS += $(shell $(STARSPHERE_INSTALL)/bin/sdl-config --static-libs)
LIBS += -lstdc++
LIBS += -lpthread -lm -lc
LDFLAGS = -static-libgcc
LDFLAGS += -static-libgcc
CPPFLAGS = -I$(STARSPHERE_INSTALL)/include
CPPFLAGS += -I$(STARSPHERE_INSTALL)/include
CPPFLAGS += $(shell $(STARSPHERE_INSTALL)/bin/sdl-config --cflags)
CPPFLAGS += $(shell $(STARSPHERE_INSTALL)/bin/freetype-config --cflags)
CPPFLAGS += $(shell $(STARSPHERE_INSTALL)/bin/xml2-config --cflags)
......@@ -59,7 +61,6 @@ callgrind: clean debug starsphere
# target specific options
debug: CPPFLAGS += -pg -ggdb3 -O0 -Wall -Wno-switch-enum
release: CPPFLAGS += -DNDEBUG -ggdb3 -O3 -Wall -Wno-switch-enum
release: LDFLAGS +=
starsphere_EinsteinS5R3: CPPFLAGS += -D SCIENCE_APP=EinsteinS5R3
starsphere_EinsteinRadio: CPPFLAGS += -D SCIENCE_APP=EinsteinRadio
memcheck: CPPFLAGS += $(DEBUGFLAGSCPP) -D DEBUG_VALGRIND
......
......@@ -26,7 +26,7 @@ STARSPHERE_INSTALL?=$(PWD)
CXX ?= g++
# variables
LIBS = -Wl,-Bstatic
LIBS += -Wl,-Bstatic
LIBS += -lframework -loglft -L$(STARSPHERE_INSTALL)/lib
LIBS += $(shell $(STARSPHERE_INSTALL)/bin/freetype-config --libs)
LIBS += $(shell $(STARSPHERE_INSTALL)/bin/xml2-config --libs)
......@@ -36,9 +36,9 @@ LIBS += -Wl,-Bdynamic
LIBS += $(shell $(STARSPHERE_INSTALL)/bin/sdl-config --static-libs)
LIBS += -lopengl32 -lglu32
LDFLAGS = -static-libgcc
LDFLAGS += -static-libgcc
CPPFLAGS = -I$(STARSPHERE_INSTALL)/include
CPPFLAGS += -I$(STARSPHERE_INSTALL)/include
CPPFLAGS += $(shell $(STARSPHERE_INSTALL)/bin/sdl-config --cflags)
CPPFLAGS += $(shell $(STARSPHERE_INSTALL)/bin/freetype-config --cflags)
CPPFLAGS += $(shell $(STARSPHERE_INSTALL)/bin/xml2-config --cflags)
......@@ -62,7 +62,6 @@ callgrind: clean debug starsphere
# target specific options
debug: CPPFLAGS += -pg -gstabs3 -O0 -Wall -Wno-switch-enum
release: CPPFLAGS += -DNDEBUG -gstabs3 -O3 -Wall -Wno-switch-enum
release: LDFLAGS +=
starsphere_EinsteinS5R3: CPPFLAGS += -D SCIENCE_APP=EinsteinS5R3
starsphere_EinsteinRadio: CPPFLAGS += -D SCIENCE_APP=EinsteinRadio
memcheck: CPPFLAGS += $(DEBUGFLAGSCPP) -D DEBUG_VALGRIND
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment