From c0b84d3469d99481005cbe30d6e2f3de5b74d430 Mon Sep 17 00:00:00 2001 From: laurentgom Date: Wed, 7 Apr 2010 10:34:35 +0000 Subject: [PATCH] Moved CSFML Linux makefiles outside the source tree git-svn-id: https://sfml.svn.sourceforge.net/svnroot/sfml/branches/sfml2@1498 4e206d99-4929-0410-ac5d-dfc041789085 --- CSFML/Makefile | 14 ++---- CSFML/build/make/Makefile | 46 ++++++++++++++++++ .../Makefile => build/make/Makefile.audio} | 12 ++--- .../Makefile => build/make/Makefile.graphics} | 14 +++--- .../Makefile => build/make/Makefile.network} | 12 ++--- .../Makefile => build/make/Makefile.system} | 12 ++--- .../Makefile => build/make/Makefile.window} | 14 +++--- CSFML/src/SFML/Graphics/RenderWindow.cpp | 2 +- CSFML/src/SFML/Makefile | 48 ------------------- build/make/Makefile.audio | 5 +- build/make/Makefile.network | 5 +- build/make/Makefile.system | 5 +- build/make/Makefile.window | 5 +- 13 files changed, 90 insertions(+), 104 deletions(-) create mode 100644 CSFML/build/make/Makefile rename CSFML/{src/SFML/Audio/Makefile => build/make/Makefile.audio} (83%) rename CSFML/{src/SFML/Graphics/Makefile => build/make/Makefile.graphics} (84%) rename CSFML/{src/SFML/Network/Makefile => build/make/Makefile.network} (83%) rename CSFML/{src/SFML/System/Makefile => build/make/Makefile.system} (83%) rename CSFML/{src/SFML/Window/Makefile => build/make/Makefile.window} (83%) delete mode 100644 CSFML/src/SFML/Makefile diff --git a/CSFML/Makefile b/CSFML/Makefile index 96ddc42d2..54ecd6da7 100644 --- a/CSFML/Makefile +++ b/CSFML/Makefile @@ -1,14 +1,6 @@ all: csfml -csfml: - @(cd ./src/SFML && $(MAKE)) - -install: - @(cd ./src/SFML && $(MAKE) $@) - -clean: - @(cd ./src/SFML && $(MAKE) $@) - -mrproper: - @(cd ./src/SFML && $(MAKE) $@) +csfml install clean mrproper: + cd ./build/make && $(MAKE) $@ + diff --git a/CSFML/build/make/Makefile b/CSFML/build/make/Makefile new file mode 100644 index 000000000..508e5f56d --- /dev/null +++ b/CSFML/build/make/Makefile @@ -0,0 +1,46 @@ +export SRCROOT = ../../src/SFML +export DESTDIR = /usr/local +export DESTLIBDIR = $(DESTDIR)/lib +export DESTINCDIR = $(DESTDIR)/include +export DESTDBGDIR = $(DESTLIBDIR)/debug/$(DESTLIBDIR) +export CC = gcc +export CPP = g++ +export CFLAGS = -W -Wall -pedantic -Wno-unused -DCSFML_EXPORTS -g -O2 -DNDEBUG -I../../include -I../../src -fPIC +export CFLAGSEXT = -I../../include -I../../src -g -O2 -DNDEBUG -fPIC +export LDFLAGS = -shared +export LIBPATH = ../../lib +export VERSION = 2.0 +export CP = cp +export LN = ln +export LNFLAGS = -s -f +export LIBS = system window graphics audio network + +all: csfml + +csfml: $(LIBS) + +$(LIBS): + mkdir -p $(LIBPATH) + $(MAKE) -f Makefile.$@ + +install: + mkdir -p $(DESTLIBDIR) + mkdir -p $(DESTINCDIR) + mkdir -p $(DESTDBGDIR) + $(CP) -r ../../include/SFML/ $(DESTINCDIR)/ + find $(DESTINCDIR)/SFML -name .svn -type d -print0 | xargs -0 /bin/rm -rf + $(MAKE) $@ -f Makefile.system + $(MAKE) $@ -f Makefile.window + $(MAKE) $@ -f Makefile.graphics + $(MAKE) $@ -f Makefile.audio + $(MAKE) $@ -f Makefile.network + +clean mrproper: + $(MAKE) $@ -f Makefile.system + $(MAKE) $@ -f Makefile.window + $(MAKE) $@ -f Makefile.graphics + $(MAKE) $@ -f Makefile.audio + $(MAKE) $@ -f Makefile.network + +.PHONY: clean mrproper + diff --git a/CSFML/src/SFML/Audio/Makefile b/CSFML/build/make/Makefile.audio similarity index 83% rename from CSFML/src/SFML/Audio/Makefile rename to CSFML/build/make/Makefile.audio index 9b121e575..5e010f43a 100644 --- a/CSFML/src/SFML/Audio/Makefile +++ b/CSFML/build/make/Makefile.audio @@ -1,9 +1,9 @@ -LIB = libcsfml-audio.so -SRC = $(wildcard *.cpp) +SRC = $(wildcard $(SRCROOT)/Audio/*.cpp) OBJ = $(SRC:.cpp=.o) +LIB = libcsfml-audio.so LIBNAME = $(LIB).$(VERSION) FULLLIBNAME = $(LIBPATH)/$(LIBNAME) -LINK = $(LN) $(LNFLAGS) $(LIBNAME) $(DESTLIBDIR)/$(LIB) +LINK = $(LN) $(LNFLAGS) $(LIBNAME) $(DESTLIBDIR)/$(LIB) all: $(LIB) @@ -16,12 +16,12 @@ $(OBJ): %.o: %.cpp .PHONY: clean mrproper clean: - @rm -rf $(OBJ) + rm -rf $(OBJ) mrproper: clean - @rm -rf $(FULLLIBNAME) + rm -rf $(FULLLIBNAME) install: - objcopy --only-keep-debug $(FULLLIBNAME) $(DESTDBGDIR)/$(LIBNAME) + objcopy --only-keep-debug $(FULLLIBNAME) $(DESTDBGDIR)/$(LIBNAME) objcopy --strip-unneeded $(FULLLIBNAME) $(DESTLIBDIR)/$(LIBNAME) $(LINK) diff --git a/CSFML/src/SFML/Graphics/Makefile b/CSFML/build/make/Makefile.graphics similarity index 84% rename from CSFML/src/SFML/Graphics/Makefile rename to CSFML/build/make/Makefile.graphics index cd9e6b66c..163fe337e 100644 --- a/CSFML/src/SFML/Graphics/Makefile +++ b/CSFML/build/make/Makefile.graphics @@ -1,6 +1,6 @@ -LIB = libcsfml-graphics.so -SRC = $(wildcard *.cpp) +SRC = $(wildcard $(SRCROOT)/Graphics/*.cpp) OBJ = $(SRC:.cpp=.o) +LIB = libcsfml-graphics.so LIBNAME = $(LIB).$(VERSION) FULLLIBNAME = $(LIBPATH)/$(LIBNAME) LINK = $(LN) $(LNFLAGS) $(LIBNAME) $(DESTLIBDIR)/$(LIB) @@ -8,7 +8,7 @@ LINK = $(LN) $(LNFLAGS) $(LIBNAME) $(DESTLIBDIR)/$(LIB) all: $(LIB) libcsfml-graphics.so: $(OBJ) - $(CPP) $(LDFLAGS) -Wl,-soname,$(LIBNAME) -o $(FULLLIBNAME) $(OBJ) -lsfml-graphics -lsfml-window -lsfml-system + $(CPP) $(LDFLAGS) -Wl,-soname,$(LIBNAME) -o $(FULLLIBNAME) $(OBJ) -lsfml-graphics -lsfml-window -lsfml-system $(OBJ): %.o: %.cpp $(CPP) -o $@ -c $< $(CFLAGS) @@ -16,12 +16,12 @@ $(OBJ): %.o: %.cpp .PHONY: clean mrproper clean: - @rm -rf $(OBJ) + rm -rf $(OBJ) mrproper: clean - @rm -rf $(FULLLIBNAME) + rm -rf $(FULLLIBNAME) -install: - objcopy --only-keep-debug $(FULLLIBNAME) $(DESTDBGDIR)/$(LIBNAME) +install: + objcopy --only-keep-debug $(FULLLIBNAME) $(DESTDBGDIR)/$(LIBNAME) objcopy --strip-unneeded $(FULLLIBNAME) $(DESTLIBDIR)/$(LIBNAME) $(LINK) diff --git a/CSFML/src/SFML/Network/Makefile b/CSFML/build/make/Makefile.network similarity index 83% rename from CSFML/src/SFML/Network/Makefile rename to CSFML/build/make/Makefile.network index c45a34fa1..69bf6049c 100644 --- a/CSFML/src/SFML/Network/Makefile +++ b/CSFML/build/make/Makefile.network @@ -1,9 +1,9 @@ -LIB = libcsfml-network.so -SRC = $(wildcard *.cpp) +SRC = $(wildcard $(SRCROOT)/Network/*.cpp) OBJ = $(SRC:.cpp=.o) +LIB = libcsfml-network.so LIBNAME = $(LIB).$(VERSION) FULLLIBNAME = $(LIBPATH)/$(LIBNAME) -LINK = $(LN) $(LNFLAGS) $(LIBNAME) $(DESTLIBDIR)/$(LIB) +LINK = $(LN) $(LNFLAGS) $(LIBNAME) $(DESTLIBDIR)/$(LIB) all: $(LIB) @@ -16,12 +16,12 @@ $(OBJ): %.o: %.cpp .PHONY: clean mrproper clean: - @rm -rf $(OBJ) + rm -rf $(OBJ) mrproper: clean - @rm -rf $(FULLLIBNAME) + rm -rf $(FULLLIBNAME) install: - objcopy --only-keep-debug $(FULLLIBNAME) $(DESTDBGDIR)/$(LIBNAME) + objcopy --only-keep-debug $(FULLLIBNAME) $(DESTDBGDIR)/$(LIBNAME) objcopy --strip-unneeded $(FULLLIBNAME) $(DESTLIBDIR)/$(LIBNAME) $(LINK) diff --git a/CSFML/src/SFML/System/Makefile b/CSFML/build/make/Makefile.system similarity index 83% rename from CSFML/src/SFML/System/Makefile rename to CSFML/build/make/Makefile.system index 2753ed55f..9bed33fd1 100644 --- a/CSFML/src/SFML/System/Makefile +++ b/CSFML/build/make/Makefile.system @@ -1,9 +1,9 @@ -LIB = libcsfml-system.so -SRC = $(wildcard *.cpp) +SRC = $(wildcard $(SRCROOT)/System/*.cpp) OBJ = $(SRC:.cpp=.o) +LIB = libcsfml-system.so LIBNAME = $(LIB).$(VERSION) FULLLIBNAME = $(LIBPATH)/$(LIBNAME) -LINK = $(LN) $(LNFLAGS) $(LIBNAME) $(DESTLIBDIR)/$(LIB) +LINK = $(LN) $(LNFLAGS) $(LIBNAME) $(DESTLIBDIR)/$(LIB) all: $(LIB) @@ -16,12 +16,12 @@ $(OBJ): %.o: %.cpp .PHONY: clean mrproper clean: - @rm -rf $(OBJ) + rm -rf $(OBJ) mrproper: clean - @rm -rf $(FULLLIBNAME) + rm -rf $(FULLLIBNAME) install: - objcopy --only-keep-debug $(FULLLIBNAME) $(DESTDBGDIR)/$(LIBNAME) + objcopy --only-keep-debug $(FULLLIBNAME) $(DESTDBGDIR)/$(LIBNAME) objcopy --strip-unneeded $(FULLLIBNAME) $(DESTLIBDIR)/$(LIBNAME) $(LINK) diff --git a/CSFML/src/SFML/Window/Makefile b/CSFML/build/make/Makefile.window similarity index 83% rename from CSFML/src/SFML/Window/Makefile rename to CSFML/build/make/Makefile.window index 9317de691..c5f88173e 100644 --- a/CSFML/src/SFML/Window/Makefile +++ b/CSFML/build/make/Makefile.window @@ -1,9 +1,9 @@ -LIB = libcsfml-window.so -SRC = $(wildcard *.cpp) +SRC = $(wildcard $(SRCROOT)/Window/*.cpp) OBJ = $(SRC:.cpp=.o) +LIB = libcsfml-window.so LIBNAME = $(LIB).$(VERSION) FULLLIBNAME = $(LIBPATH)/$(LIBNAME) -LINK = $(LN) $(LNFLAGS) $(LIBNAME) $(DESTLIBDIR)/$(LIB) +LINK = $(LN) $(LNFLAGS) $(LIBNAME) $(DESTLIBDIR)/$(LIB) all: $(LIB) @@ -12,16 +12,16 @@ libcsfml-window.so: $(OBJ) $(OBJ): %.o: %.cpp $(CPP) -o $@ -c $< $(CFLAGS) - + .PHONY: clean mrproper clean: - @rm -rf $(OBJ) + rm -rf $(OBJ) mrproper: clean - @rm -rf $(FULLLIBNAME) + rm -rf $(FULLLIBNAME) install: - objcopy --only-keep-debug $(FULLLIBNAME) $(DESTDBGDIR)/$(LIBNAME) + objcopy --only-keep-debug $(FULLLIBNAME) $(DESTDBGDIR)/$(LIBNAME) objcopy --strip-unneeded $(FULLLIBNAME) $(DESTLIBDIR)/$(LIBNAME) $(LINK) diff --git a/CSFML/src/SFML/Graphics/RenderWindow.cpp b/CSFML/src/SFML/Graphics/RenderWindow.cpp index fd0410c4d..543e3a117 100644 --- a/CSFML/src/SFML/Graphics/RenderWindow.cpp +++ b/CSFML/src/SFML/Graphics/RenderWindow.cpp @@ -142,7 +142,7 @@ unsigned int sfRenderWindow_GetHeight(const sfRenderWindow* renderWindow) //////////////////////////////////////////////////////////// sfContextSettings sfRenderWindow_GetSettings(const sfRenderWindow* renderWindow) { - sfContextSettings settings = {0, 0, 0}; + sfContextSettings settings = {0, 0, 0, 2, 0}; CSFML_CHECK_RETURN(renderWindow, settings); const sf::ContextSettings& params = renderWindow->This.GetSettings(); diff --git a/CSFML/src/SFML/Makefile b/CSFML/src/SFML/Makefile deleted file mode 100644 index 209c217e4..000000000 --- a/CSFML/src/SFML/Makefile +++ /dev/null @@ -1,48 +0,0 @@ -export CC = gcc -export CPP = g++ -export CFLAGS = -W -Wall -pedantic -Wno-unused -I../.. -I../../../include -g -O2 -DNDEBUG -fPIC -DCSFML_EXPORTS -export LDFLAGS = -shared -export LIBPATH = ../../../lib -export VERSION = 2.0 -export CP = cp -export LN = ln -export LNFLAGS = -s -f -export DESTDIR = /usr/local -export DESTLIBDIR = $(DESTDIR)/lib -export DESTINCDIR = $(DESTDIR)/include -export DESTDBGDIR = $(DESTLIBDIR)/debug/$(DESTLIBDIR) - -all: csfml-system csfml-window csfml-network csfml-graphics csfml-audio - -csfml-system: - @(mkdir -p ../../lib) - @(cd ./System && $(MAKE)) - -csfml-window: - @(mkdir -p ../../lib) - @(cd ./Window && $(MAKE)) - -csfml-network: - @(mkdir -p ../../lib) - @(cd ./Network && $(MAKE)) - -csfml-graphics: - @(mkdir -p ../../lib) - @(cd ./Graphics && $(MAKE)) - -csfml-audio: - @(mkdir -p ../../lib) - @(cd ./Audio && $(MAKE)) - -.PHONY: clean mrproper - -clean: - @(cd ./System && $(MAKE) $@ && cd ../Window && $(MAKE) $@ && cd ../Network && $(MAKE) $@ && cd ../Graphics && $(MAKE) $@ && cd ../Audio && $(MAKE) $@) - -mrproper: clean - @(cd ./System && $(MAKE) $@ && cd ../Window && $(MAKE) $@ && cd ../Network && $(MAKE) $@ && cd ../Graphics && $(MAKE) $@ && cd ../Audio && $(MAKE) $@) - -install: - @(mkdir -p $(DESTLIBDIR)) - @(mkdir -p $(DESTINCDIR)) - @(cd ./System && $(MAKE) $@ && cd ../Window && $(MAKE) $@ && cd ../Network && $(MAKE) $@ && cd ../Graphics && $(MAKE) $@ && cd ../Audio && $(MAKE) $@ && $(CP) -r ../../../include/SFML/ $(DESTINCDIR) && find $(DESTINCDIR)/SFML -name .svn -type d -print0 | xargs -0 /bin/rm -rf) diff --git a/build/make/Makefile.audio b/build/make/Makefile.audio index dfe3385dc..95facde2a 100644 --- a/build/make/Makefile.audio +++ b/build/make/Makefile.audio @@ -1,6 +1,5 @@ -SRC = $(wildcard $(SRCROOT)/Audio/*.cpp) -OBJ = $(SRC:.cpp=.o) - +SRC = $(wildcard $(SRCROOT)/Audio/*.cpp) +OBJ = $(SRC:.cpp=.o) LIB = libsfml-audio.so LIBNAME = $(LIB).$(VERSION) FULLLIBNAME = $(LIBPATH)/$(LIBNAME) diff --git a/build/make/Makefile.network b/build/make/Makefile.network index 63a9368a5..c07d9cf58 100644 --- a/build/make/Makefile.network +++ b/build/make/Makefile.network @@ -1,6 +1,5 @@ -SRC = $(wildcard $(SRCROOT)/Network/*.cpp $(SRCROOT)/Network/Unix/*.cpp) -OBJ = $(SRC:.cpp=.o) - +SRC = $(wildcard $(SRCROOT)/Network/*.cpp $(SRCROOT)/Network/Unix/*.cpp) +OBJ = $(SRC:.cpp=.o) LIB = libsfml-network.so LIBNAME = $(LIB).$(VERSION) FULLLIBNAME = $(LIBPATH)/$(LIBNAME) diff --git a/build/make/Makefile.system b/build/make/Makefile.system index e13078450..fd3e55914 100644 --- a/build/make/Makefile.system +++ b/build/make/Makefile.system @@ -1,6 +1,5 @@ -SRC = $(wildcard $(SRCROOT)/System/*.cpp $(SRCROOT)/System/Unix/*.cpp) -OBJ = $(SRC:.cpp=.o) - +SRC = $(wildcard $(SRCROOT)/System/*.cpp $(SRCROOT)/System/Unix/*.cpp) +OBJ = $(SRC:.cpp=.o) LIB = libsfml-system.so LIBNAME = $(LIB).$(VERSION) FULLLIBNAME = $(LIBPATH)/$(LIBNAME) diff --git a/build/make/Makefile.window b/build/make/Makefile.window index 96ec7ff73..c86bb5433 100644 --- a/build/make/Makefile.window +++ b/build/make/Makefile.window @@ -1,6 +1,5 @@ -SRC = $(wildcard $(SRCROOT)/Window/*.cpp $(SRCROOT)/Window/Linux/*.cpp) -OBJ = $(SRC:.cpp=.o) - +SRC = $(wildcard $(SRCROOT)/Window/*.cpp $(SRCROOT)/Window/Linux/*.cpp) +OBJ = $(SRC:.cpp=.o) LIB = libsfml-window.so LIBNAME = $(LIB).$(VERSION) FULLLIBNAME = $(LIBPATH)/$(LIBNAME)