From ca5489a5d682adcf3682b0b7d169051e2afd763f Mon Sep 17 00:00:00 2001 From: laurentgom Date: Tue, 23 Mar 2010 15:55:07 +0000 Subject: [PATCH] Modified the Linux build system so that makefiles are now outside the source tree git-svn-id: https://sfml.svn.sourceforge.net/svnroot/sfml/branches/sfml2@1477 4e206d99-4929-0410-ac5d-dfc041789085 --- Makefile | 21 +++------- build/make/Makefile | 50 +++++++++++++++++++++++ build/make/Makefile.audio | 28 +++++++++++++ build/make/Makefile.graphics | 44 ++++++++++++++++++++ build/make/Makefile.network | 28 +++++++++++++ build/make/Makefile.system | 28 +++++++++++++ build/make/Makefile.window | 28 +++++++++++++ samples/build/make/Makefile | 17 ++++++++ samples/build/make/Makefile.X11 | 20 +++++++++ samples/build/make/Makefile.ftp | 20 +++++++++ samples/build/make/Makefile.opengl | 21 ++++++++++ samples/build/make/Makefile.pong | 20 +++++++++ samples/build/make/Makefile.qt | 21 ++++++++++ samples/build/make/Makefile.shader | 20 +++++++++ samples/build/make/Makefile.sockets | 20 +++++++++ samples/build/make/Makefile.sound | 20 +++++++++ samples/build/make/Makefile.sound_capture | 20 +++++++++ samples/build/make/Makefile.voip | 20 +++++++++ samples/build/make/Makefile.window | 20 +++++++++ samples/build/make/Makefile.wxwidgets | 21 ++++++++++ src/SFML/Audio/SoundBuffer.cpp | 11 ++--- 21 files changed, 477 insertions(+), 21 deletions(-) create mode 100644 build/make/Makefile create mode 100644 build/make/Makefile.audio create mode 100644 build/make/Makefile.graphics create mode 100644 build/make/Makefile.network create mode 100644 build/make/Makefile.system create mode 100644 build/make/Makefile.window create mode 100644 samples/build/make/Makefile create mode 100644 samples/build/make/Makefile.X11 create mode 100644 samples/build/make/Makefile.ftp create mode 100644 samples/build/make/Makefile.opengl create mode 100644 samples/build/make/Makefile.pong create mode 100644 samples/build/make/Makefile.qt create mode 100644 samples/build/make/Makefile.shader create mode 100644 samples/build/make/Makefile.sockets create mode 100644 samples/build/make/Makefile.sound create mode 100644 samples/build/make/Makefile.sound_capture create mode 100644 samples/build/make/Makefile.voip create mode 100644 samples/build/make/Makefile.window create mode 100644 samples/build/make/Makefile.wxwidgets diff --git a/Makefile b/Makefile index 1b0f851e..8a9037b8 100644 --- a/Makefile +++ b/Makefile @@ -1,19 +1,8 @@ all: sfml -sfml: - @(cd ./src/SFML && $(MAKE)) - -sfml-samples: - @(cd ./samples && $(MAKE)) - -install: - @(cd ./src/SFML && $(MAKE) $@) - -clean: - @(cd ./src/SFML && $(MAKE) $@) - @(cd ./samples && $(MAKE) $@) - -mrproper: - @(cd ./src/SFML && $(MAKE) $@) - @(cd ./samples && $(MAKE) $@) +sfml samples install clean mrproper: + cd ./build/make && $(MAKE) $@ + +.PHONY: samples + diff --git a/build/make/Makefile b/build/make/Makefile new file mode 100644 index 00000000..ec29440d --- /dev/null +++ b/build/make/Makefile @@ -0,0 +1,50 @@ +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 -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: sfml + +sfml: $(LIBS) + +samples: + cd ../../samples/build/make && $(MAKE) + +$(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 + cd ../../samples/build/make && $(MAKE) $@ + +.PHONY: clean mrproper + diff --git a/build/make/Makefile.audio b/build/make/Makefile.audio new file mode 100644 index 00000000..dfe3385d --- /dev/null +++ b/build/make/Makefile.audio @@ -0,0 +1,28 @@ +SRC = $(wildcard $(SRCROOT)/Audio/*.cpp) +OBJ = $(SRC:.cpp=.o) + +LIB = libsfml-audio.so +LIBNAME = $(LIB).$(VERSION) +FULLLIBNAME = $(LIBPATH)/$(LIBNAME) +LINK = $(LN) $(LNFLAGS) $(LIBNAME) $(DESTLIBDIR)/$(LIB) + +all: $(LIB) + +libsfml-audio.so: $(OBJ) + $(CPP) $(LDFLAGS) -Wl,-soname,$(LIBNAME) -o $(FULLLIBNAME) $(OBJ) -lsndfile -lopenal + +$(OBJ): %.o: %.cpp + $(CPP) -o $@ -c $< $(CFLAGS) + +.PHONY: clean mrproper + +clean: + rm -rf $(OBJ) + +mrproper: clean + rm -rf $(FULLLIBNAME) + +install: + objcopy --only-keep-debug $(FULLLIBNAME) $(DESTDBGDIR)/$(LIBNAME) + objcopy --strip-unneeded $(FULLLIBNAME) $(DESTLIBDIR)/$(LIBNAME) + $(LINK) diff --git a/build/make/Makefile.graphics b/build/make/Makefile.graphics new file mode 100644 index 00000000..530e6dfb --- /dev/null +++ b/build/make/Makefile.graphics @@ -0,0 +1,44 @@ +SRC = $(wildcard $(SRCROOT)/Graphics/*.cpp $(SRCROOT)/Graphics/Linux/*.cpp) +SRCGLEW = $(wildcard $(SRCROOT)/Graphics/GLEW/*.c) +SRCJPEG = $(wildcard $(SRCROOT)/Graphics/libjpeg/*.c) +SRCPNG = $(wildcard $(SRCROOT)/Graphics/libpng/*.c) +SRCSOIL = $(wildcard $(SRCROOT)/Graphics/SOIL/*.c) +SRCZLIB = $(wildcard $(SRCROOT)/Graphics/zlib/*.c) +OBJ = $(SRC:.cpp=.o) +OBJGLEW = $(SRCGLEW:.c=.o) +OBJJPEG = $(SRCJPEG:.c=.o) +OBJPNG = $(SRCPNG:.c=.o) +OBJSOIL = $(SRCSOIL:.c=.o) +OBJZLIB = $(SRCZLIB:.c=.o) + +LIB = libsfml-graphics.so +LIBNAME = $(LIB).$(VERSION) +FULLLIBNAME = $(LIBPATH)/$(LIBNAME) +LINK = $(LN) $(LNFLAGS) $(LIBNAME) $(DESTLIBDIR)/$(LIB) + +all: $(LIB) + +libsfml-graphics.so: $(OBJ) $(OBJGLEW) $(OBJJPEG) $(OBJPNG) $(OBJSOIL) $(OBJZLIB) + $(CPP) $(LDFLAGS) -Wl,-soname,$(LIBNAME) -o $(FULLLIBNAME) $(OBJ) $(OBJGLEW) $(OBJJPEG) $(OBJPNG) $(OBJSOIL) $(OBJZLIB) -lfreetype -lX11 -lGL + +$(OBJ): %.o: %.cpp + $(CPP) -o $@ -c $< $(CFLAGS) -I/usr/include/freetype2 + +$(OBJSOIL): %.o: %.c + $(CC) -o $@ -c $< $(CFLAGSEXT) -DSTBI_FAILURE_USERMSG + +$(OBJGLEW) $(OBJJPEG) $(OBJPNG) $(OBJZLIB): %.o: %.c + $(CC) -o $@ -c $< $(CFLAGSEXT) + +.PHONY: clean mrproper + +clean: + rm -rf $(OBJ) $(OBJGLEW) $(OBJJPEG) $(OBJPNG) $(OBJSOIL) $(OBJZLIB) + +mrproper: clean + rm -rf $(FULLLIBNAME) + +install: + objcopy --only-keep-debug $(FULLLIBNAME) $(DESTDBGDIR)/$(LIBNAME) + objcopy --strip-unneeded $(FULLLIBNAME) $(DESTLIBDIR)/$(LIBNAME) + $(LINK) diff --git a/build/make/Makefile.network b/build/make/Makefile.network new file mode 100644 index 00000000..63a9368a --- /dev/null +++ b/build/make/Makefile.network @@ -0,0 +1,28 @@ +SRC = $(wildcard $(SRCROOT)/Network/*.cpp $(SRCROOT)/Network/Unix/*.cpp) +OBJ = $(SRC:.cpp=.o) + +LIB = libsfml-network.so +LIBNAME = $(LIB).$(VERSION) +FULLLIBNAME = $(LIBPATH)/$(LIBNAME) +LINK = $(LN) $(LNFLAGS) $(LIBNAME) $(DESTLIBDIR)/$(LIB) + +all: $(LIB) + +libsfml-network.so: $(OBJ) + $(CPP) $(LDFLAGS) -Wl,-soname,$(LIBNAME) -o $(FULLLIBNAME) $(OBJ) + +$(OBJ): %.o: %.cpp + $(CPP) -o $@ -c $< $(CFLAGS) + +.PHONY: clean mrproper + +clean: + rm -rf $(OBJ) + +mrproper: clean + rm -rf $(FULLLIBNAME) + +install: + objcopy --only-keep-debug $(FULLLIBNAME) $(DESTDBGDIR)/$(LIBNAME) + objcopy --strip-unneeded $(FULLLIBNAME) $(DESTLIBDIR)/$(LIBNAME) + $(LINK) diff --git a/build/make/Makefile.system b/build/make/Makefile.system new file mode 100644 index 00000000..e1307845 --- /dev/null +++ b/build/make/Makefile.system @@ -0,0 +1,28 @@ +SRC = $(wildcard $(SRCROOT)/System/*.cpp $(SRCROOT)/System/Unix/*.cpp) +OBJ = $(SRC:.cpp=.o) + +LIB = libsfml-system.so +LIBNAME = $(LIB).$(VERSION) +FULLLIBNAME = $(LIBPATH)/$(LIBNAME) +LINK = $(LN) $(LNFLAGS) $(LIBNAME) $(DESTLIBDIR)/$(LIB) + +all: $(LIB) + +libsfml-system.so: $(OBJ) + $(CPP) $(LDFLAGS) -Wl,-soname,$(LIBNAME) -o $(FULLLIBNAME) $(OBJ) -lpthread + +$(OBJ): %.o: %.cpp + $(CPP) -o $@ -c $< $(CFLAGS) + +.PHONY: clean mrproper + +clean: + rm -rf $(OBJ) + +mrproper: clean + rm -rf $(FULLLIBNAME) + +install: + objcopy --only-keep-debug $(FULLLIBNAME) $(DESTDBGDIR)/$(LIBNAME) + objcopy --strip-unneeded $(FULLLIBNAME) $(DESTLIBDIR)/$(LIBNAME) + $(LINK) diff --git a/build/make/Makefile.window b/build/make/Makefile.window new file mode 100644 index 00000000..96ec7ff7 --- /dev/null +++ b/build/make/Makefile.window @@ -0,0 +1,28 @@ +SRC = $(wildcard $(SRCROOT)/Window/*.cpp $(SRCROOT)/Window/Linux/*.cpp) +OBJ = $(SRC:.cpp=.o) + +LIB = libsfml-window.so +LIBNAME = $(LIB).$(VERSION) +FULLLIBNAME = $(LIBPATH)/$(LIBNAME) +LINK = $(LN) $(LNFLAGS) $(LIBNAME) $(DESTLIBDIR)/$(LIB) + +all: $(LIB) + +libsfml-window.so: $(OBJ) + $(CPP) $(LDFLAGS) -Wl,-soname,$(LIBNAME) -o $(FULLLIBNAME) $(OBJ) -lX11 -lXrandr -lGL + +$(OBJ): %.o: %.cpp + $(CPP) -o $@ -c $< $(CFLAGS) + +.PHONY: clean mrproper + +clean: + rm -rf $(OBJ) + +mrproper: clean + rm -rf $(FULLLIBNAME) + +install: + objcopy --only-keep-debug $(FULLLIBNAME) $(DESTDBGDIR)/$(LIBNAME) + objcopy --strip-unneeded $(FULLLIBNAME) $(DESTLIBDIR)/$(LIBNAME) + $(LINK) diff --git a/samples/build/make/Makefile b/samples/build/make/Makefile new file mode 100644 index 00000000..c88d6fec --- /dev/null +++ b/samples/build/make/Makefile @@ -0,0 +1,17 @@ +export SRCROOT = ../.. +export BINPATH = ../../bin +export CPP = g++ +export CFLAGS = -W -Wall -ansi -g -O2 -DNDEBUG -I../../include +export SAMPLES = ftp opengl pong qt shader sockets sound sound_capture voip window wxwidgets X11 + +all: $(SAMPLES) + +$(SAMPLES): + mkdir -p $(BINPATH) + $(MAKE) -f Makefile.$@ + +clean mrproper: + for sample in $(SAMPLES); do $(MAKE) $@ -f Makefile.$${sample}; done + +.PHONY: clean mrproper + diff --git a/samples/build/make/Makefile.X11 b/samples/build/make/Makefile.X11 new file mode 100644 index 00000000..06a69b1f --- /dev/null +++ b/samples/build/make/Makefile.X11 @@ -0,0 +1,20 @@ +EXE = X11 +SRC = $(wildcard $(SRCROOT)/$(EXE)/*.cpp) +OBJ = $(SRC:.cpp=.o) +LDFLAGS = -lsfml-window -lsfml-system -lGLU -lGL -lX11 + +all: $(EXE) + +$(EXE): $(OBJ) + $(CPP) -o $(BINPATH)/$(EXE) $(OBJ) $(LDFLAGS) + +$(OBJ): %.o: %.cpp + $(CPP) -o $@ -c $< $(CFLAGS) + +.PHONY: clean mrproper + +clean: + @rm -rf $(OBJ) + +mrproper: clean + @rm -rf $(BINPATH)/$(EXE) diff --git a/samples/build/make/Makefile.ftp b/samples/build/make/Makefile.ftp new file mode 100644 index 00000000..36590edd --- /dev/null +++ b/samples/build/make/Makefile.ftp @@ -0,0 +1,20 @@ +EXE = ftp +SRC = $(wildcard $(SRCROOT)/$(EXE)/*.cpp) +OBJ = $(SRC:.cpp=.o) +LDFLAGS = -lsfml-network -lsfml-system + +all: $(EXE) + +$(EXE): $(OBJ) + $(CPP) -o $(BINPATH)/$(EXE) $(OBJ) $(LDFLAGS) + +$(OBJ): %.o: %.cpp + $(CPP) -o $@ -c $< $(CFLAGS) + +.PHONY: clean mrproper + +clean: + @rm -rf $(OBJ) + +mrproper: clean + @rm -rf $(BINPATH)/$(EXE) diff --git a/samples/build/make/Makefile.opengl b/samples/build/make/Makefile.opengl new file mode 100644 index 00000000..a3d1ca75 --- /dev/null +++ b/samples/build/make/Makefile.opengl @@ -0,0 +1,21 @@ +EXE = opengl +SRC = $(wildcard $(SRCROOT)/$(EXE)/*.cpp) +OBJ = $(SRC:.cpp=.o) +LDFLAGS = -lsfml-graphics -lsfml-window -lsfml-system -lGLU -lGL + +all: $(EXE) + +$(EXE): $(OBJ) + $(CPP) -o $(BINPATH)/$(EXE) $(OBJ) $(LDFLAGS) + +$(OBJ): %.o: %.cpp + $(CPP) -o $@ -c $< $(CFLAGS) + +.PHONY: clean mrproper + +clean: + @rm -rf $(OBJ) + +mrproper: clean + @rm -rf $(BINPATH)/$(EXE) + diff --git a/samples/build/make/Makefile.pong b/samples/build/make/Makefile.pong new file mode 100644 index 00000000..6c9850fa --- /dev/null +++ b/samples/build/make/Makefile.pong @@ -0,0 +1,20 @@ +EXE = pong +SRC = $(wildcard $(SRCROOT)/$(EXE)/*.cpp) +OBJ = $(SRC:.cpp=.o) +LDFLAGS = -lsfml-audio -lsfml-graphics -lsfml-window -lsfml-system + +all: $(EXE) + +$(EXE): $(OBJ) + $(CPP) -o $(BINPATH)/$(EXE) $(OBJ) $(LDFLAGS) + +$(OBJ): %.o: %.cpp + $(CPP) -o $@ -c $< $(CFLAGS) + +.PHONY: clean mrproper + +clean: + @rm -rf $(OBJ) + +mrproper: clean + @rm -rf $(BINPATH)/$(EXE) diff --git a/samples/build/make/Makefile.qt b/samples/build/make/Makefile.qt new file mode 100644 index 00000000..5d048c30 --- /dev/null +++ b/samples/build/make/Makefile.qt @@ -0,0 +1,21 @@ +EXE = qt +SRC = $(wildcard $(SRCROOT)/$(EXE)/*.cpp) +OBJ = $(SRC:.cpp=.o) +LDFLAGS = -lsfml-graphics -lsfml-window -lsfml-system -lQtCore -lQtGui -lX11 +CFLAGS += -I/usr/include/qt4 -I/usr/include/qt4/QtCore -I/usr/include/qt4/QtGui + +all: $(EXE) + +$(EXE): $(OBJ) + $(CPP) -o $(BINPATH)/$(EXE) $(OBJ) $(LDFLAGS) + +$(OBJ): %.o: %.cpp + $(CPP) -o $@ -c $< $(CFLAGS) + +.PHONY: clean mrproper + +clean: + @rm -rf $(OBJ) + +mrproper: clean + @rm -rf $(BINPATH)/$(EXE) diff --git a/samples/build/make/Makefile.shader b/samples/build/make/Makefile.shader new file mode 100644 index 00000000..30abebea --- /dev/null +++ b/samples/build/make/Makefile.shader @@ -0,0 +1,20 @@ +EXE = shader +SRC = $(wildcard $(SRCROOT)/$(EXE)/*.cpp) +OBJ = $(SRC:.cpp=.o) +LDFLAGS = -lsfml-graphics -lsfml-window -lsfml-system + +all: $(EXE) + +$(EXE): $(OBJ) + $(CPP) -o $(BINPATH)/$(EXE) $(OBJ) $(LDFLAGS) + +$(OBJ): %.o: %.cpp + $(CPP) -o $@ -c $< $(CFLAGS) + +.PHONY: clean mrproper + +clean: + @rm -rf $(OBJ) + +mrproper: clean + @rm -rf $(BINPATH)/$(EXE) diff --git a/samples/build/make/Makefile.sockets b/samples/build/make/Makefile.sockets new file mode 100644 index 00000000..71f32b14 --- /dev/null +++ b/samples/build/make/Makefile.sockets @@ -0,0 +1,20 @@ +EXE = sockets +SRC = $(wildcard $(SRCROOT)/$(EXE)/*.cpp) +OBJ = $(SRC:.cpp=.o) +LDFLAGS = -lsfml-network -lsfml-system + +all: $(EXE) + +$(EXE): $(OBJ) + $(CPP) -o $(BINPATH)/$(EXE) $(OBJ) $(LDFLAGS) + +$(OBJ): %.o: %.cpp + $(CPP) -o $@ -c $< $(CFLAGS) + +.PHONY: clean mrproper + +clean: + @rm -rf $(OBJ) + +mrproper: clean + @rm -rf $(BINPATH)/$(EXE) diff --git a/samples/build/make/Makefile.sound b/samples/build/make/Makefile.sound new file mode 100644 index 00000000..58cb4505 --- /dev/null +++ b/samples/build/make/Makefile.sound @@ -0,0 +1,20 @@ +EXE = sound +SRC = $(wildcard $(SRCROOT)/$(EXE)/*.cpp) +OBJ = $(SRC:.cpp=.o) +LDFLAGS = -lsfml-audio -lsfml-system + +all: $(EXE) + +$(EXE): $(OBJ) + $(CPP) -o $(BINPATH)/$(EXE) $(OBJ) $(LDFLAGS) + +$(OBJ): %.o: %.cpp + $(CPP) -o $@ -c $< $(CFLAGS) + +.PHONY: clean mrproper + +clean: + @rm -rf $(OBJ) + +mrproper: clean + @rm -rf $(BINPATH)/$(EXE) diff --git a/samples/build/make/Makefile.sound_capture b/samples/build/make/Makefile.sound_capture new file mode 100644 index 00000000..28e4e483 --- /dev/null +++ b/samples/build/make/Makefile.sound_capture @@ -0,0 +1,20 @@ +EXE = sound_capture +SRC = $(wildcard $(SRCROOT)/$(EXE)/*.cpp) +OBJ = $(SRC:.cpp=.o) +LDFLAGS = -lsfml-audio -lsfml-system + +all: $(EXE) + +$(EXE): $(OBJ) + $(CPP) -o $(BINPATH)/$(EXE) $(OBJ) $(LDFLAGS) + +$(OBJ): %.o: %.cpp + $(CPP) -o $@ -c $< $(CFLAGS) + +.PHONY: clean mrproper + +clean: + @rm -rf $(OBJ) + +mrproper: clean + @rm -rf $(BINPATH)/$(EXE) diff --git a/samples/build/make/Makefile.voip b/samples/build/make/Makefile.voip new file mode 100644 index 00000000..7c647ca9 --- /dev/null +++ b/samples/build/make/Makefile.voip @@ -0,0 +1,20 @@ +EXE = voip +SRC = $(wildcard $(SRCROOT)/$(EXE)/*.cpp) +OBJ = $(SRC:.cpp=.o) +LDFLAGS = -lsfml-audio -lsfml-network -lsfml-system + +all: $(EXE) + +$(EXE): $(OBJ) + $(CPP) -o $(BINPATH)/$(EXE) $(OBJ) $(LDFLAGS) + +$(OBJ): %.o: %.cpp + $(CPP) -o $@ -c $< $(CFLAGS) + +.PHONY: clean mrproper + +clean: + @rm -rf $(OBJ) + +mrproper: clean + @rm -rf $(BINPATH)/$(EXE) diff --git a/samples/build/make/Makefile.window b/samples/build/make/Makefile.window new file mode 100644 index 00000000..e2443f6c --- /dev/null +++ b/samples/build/make/Makefile.window @@ -0,0 +1,20 @@ +EXE = window +SRC = $(wildcard $(SRCROOT)/$(EXE)/*.cpp) +OBJ = $(SRC:.cpp=.o) +LDFLAGS = -lsfml-window -lsfml-system -lGLU -lGL + +all: $(EXE) + +$(EXE): $(OBJ) + $(CPP) -o $(BINPATH)/$(EXE) $(OBJ) $(LDFLAGS) + +$(OBJ): %.o: %.cpp + $(CPP) -o $@ -c $< $(CFLAGS) + +.PHONY: clean mrproper + +clean: + @rm -rf $(OBJ) + +mrproper: clean + @rm -rf $(BINPATH)/$(EXE) diff --git a/samples/build/make/Makefile.wxwidgets b/samples/build/make/Makefile.wxwidgets new file mode 100644 index 00000000..054f0fb1 --- /dev/null +++ b/samples/build/make/Makefile.wxwidgets @@ -0,0 +1,21 @@ +EXE = wxwidgets +SRC = $(wildcard $(SRCROOT)/$(EXE)/*.cpp) +OBJ = $(SRC:.cpp=.o) +LDFLAGS = -lsfml-graphics -lsfml-window -lsfml-system `wx-config --libs` `pkg-config --libs gtk+-2.0` +CFLAGS += -I/usr/include/gtk-2.0 `wx-config --cppflags` `pkg-config --cflags gtk+-2.0` + +all: $(EXE) + +$(EXE): $(OBJ) + $(CPP) -o $(BINPATH)/$(EXE) $(OBJ) $(LDFLAGS) + +$(OBJ): %.o: %.cpp + $(CPP) -o $@ -c $< $(CFLAGS) + +.PHONY: clean mrproper + +clean: + @rm -rf $(OBJ) + +mrproper: clean + @rm -rf $(BINPATH)/$(EXE) diff --git a/src/SFML/Audio/SoundBuffer.cpp b/src/SFML/Audio/SoundBuffer.cpp index 2b3a0f2b..48366f9d 100644 --- a/src/SFML/Audio/SoundBuffer.cpp +++ b/src/SFML/Audio/SoundBuffer.cpp @@ -49,11 +49,12 @@ myDuration(0.f) //////////////////////////////////////////////////////////// -SoundBuffer::SoundBuffer(const SoundBuffer& copy) : -myBuffer (0), -mySamples (copy.mySamples), -myDuration(copy.myDuration), -mySounds () // don't copy the attached sounds +SoundBuffer::SoundBuffer(const SoundBuffer& copy) : +Resource(), +myBuffer (0), +mySamples (copy.mySamples), +myDuration (copy.myDuration), +mySounds () // don't copy the attached sounds { // Create the buffer ALCheck(alGenBuffers(1, &myBuffer));