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
This commit is contained in:
parent
fd8fa4e2f8
commit
ca5489a5d6
21 changed files with 477 additions and 21 deletions
17
samples/build/make/Makefile
Normal file
17
samples/build/make/Makefile
Normal file
|
@ -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
|
||||
|
20
samples/build/make/Makefile.X11
Normal file
20
samples/build/make/Makefile.X11
Normal file
|
@ -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)
|
20
samples/build/make/Makefile.ftp
Normal file
20
samples/build/make/Makefile.ftp
Normal file
|
@ -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)
|
21
samples/build/make/Makefile.opengl
Normal file
21
samples/build/make/Makefile.opengl
Normal file
|
@ -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)
|
||||
|
20
samples/build/make/Makefile.pong
Normal file
20
samples/build/make/Makefile.pong
Normal file
|
@ -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)
|
21
samples/build/make/Makefile.qt
Normal file
21
samples/build/make/Makefile.qt
Normal file
|
@ -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)
|
20
samples/build/make/Makefile.shader
Normal file
20
samples/build/make/Makefile.shader
Normal file
|
@ -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)
|
20
samples/build/make/Makefile.sockets
Normal file
20
samples/build/make/Makefile.sockets
Normal file
|
@ -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)
|
20
samples/build/make/Makefile.sound
Normal file
20
samples/build/make/Makefile.sound
Normal file
|
@ -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)
|
20
samples/build/make/Makefile.sound_capture
Normal file
20
samples/build/make/Makefile.sound_capture
Normal file
|
@ -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)
|
20
samples/build/make/Makefile.voip
Normal file
20
samples/build/make/Makefile.voip
Normal file
|
@ -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)
|
20
samples/build/make/Makefile.window
Normal file
20
samples/build/make/Makefile.window
Normal file
|
@ -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)
|
21
samples/build/make/Makefile.wxwidgets
Normal file
21
samples/build/make/Makefile.wxwidgets
Normal file
|
@ -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)
|
Loading…
Add table
Add a link
Reference in a new issue