Removed STATIC and DEBUGBUILD options from makefiles, debug symbols are now generated by default and installed to a separate folder

git-svn-id: https://sfml.svn.sourceforge.net/svnroot/sfml/branches/sfml2@1279 4e206d99-4929-0410-ac5d-dfc041789085
This commit is contained in:
laurentgom 2009-11-19 23:31:33 +00:00
parent 548991d665
commit 877df21756
7 changed files with 63 additions and 115 deletions

View File

@ -1,12 +1,5 @@
export DEBUGBUILD = no
ifeq ($(DEBUGBUILD), yes)
DEBUGFLAGS = -g -DDEBUG
else
DEBUGFLAGS = -O2 -DNDEBUG
endif
export CC = g++
export CFLAGS = -W -Wall -ansi -I../../include $(DEBUGFLAGS)
export CFLAGS = -W -Wall -ansi -g -O2 -DNDEBUG -I../../include
export LDFLAGS =
export EXECPATH = ../bin

View File

@ -1,23 +1,15 @@
SRC = $(wildcard *.cpp)
OBJ = $(SRC:.cpp=.o)
ifeq ($(STATIC), yes)
LIB = libsfml-audio-s.a
LIBNAME = $(LIBPATH)/$(LIB)
INSTALL =
else
LIB = libsfml-audio.so
LIBNAME = $(LIBPATH)/$(LIB).$(VERSION)
INSTALL = && $(LN) $(LNFLAGS) $(LIB).$(VERSION) $(DESTLIBDIR)/$(LIB)
endif
LIB = libsfml-audio.so
LIBNAME = $(LIB).$(VERSION)
FULLLIBNAME = $(LIBPATH)/$(LIBNAME)
LINK = $(LN) $(LNFLAGS) $(LIBNAME) $(DESTLIBDIR)/$(LIB)
all: $(LIB)
libsfml-audio-s.a: $(OBJ)
$(AR) $(ARFLAGS) $(LIBNAME) $(OBJ)
libsfml-audio.so: $(OBJ) $(OBJVORBIS)
$(CPP) $(LDFLAGS) -Wl,-soname,$(LIB).$(VERSION) -o $(LIBNAME) $(OBJ) -lsndfile -lopenal
libsfml-audio.so: $(OBJ)
$(CPP) $(LDFLAGS) -Wl,-soname,$(LIBNAME) -o $(FULLLIBNAME) $(OBJ) -lsndfile -lopenal
$(OBJ): %.o: %.cpp
$(CPP) -o $@ -c $< $(CFLAGS)
@ -28,7 +20,9 @@ clean:
@rm -rf $(OBJ)
mrproper: clean
@rm -rf $(LIBNAME)
@rm -rf $(FULLLIBNAME)
install:
@($(CP) $(LIBNAME) $(DESTLIBDIR) $(INSTALL))
objcopy --only-keep-debug $(FULLLIBNAME) $(DESTDBGDIR)/$(LIBNAME)
objcopy --strip-unneeded $(FULLLIBNAME) $(DESTLIBDIR)/$(LIBNAME)
$(LINK)

View File

@ -11,29 +11,24 @@ OBJPNG = $(SRCPNG:.c=.o)
OBJSOIL = $(SRCSOIL:.c=.o)
OBJZLIB = $(SRCZLIB:.c=.o)
ifeq ($(STATIC), yes)
LIB = libsfml-graphics-s.a
LIBNAME = $(LIBPATH)/$(LIB)
INSTALL =
else
LIB = libsfml-graphics.so
LIBNAME = $(LIBPATH)/$(LIB).$(VERSION)
INSTALL = && $(LN) $(LNFLAGS) $(LIB).$(VERSION) $(DESTLIBDIR)/$(LIB)
endif
LIB = libsfml-graphics.so
LIBNAME = $(LIB).$(VERSION)
FULLLIBNAME = $(LIBPATH)/$(LIBNAME)
LINK = $(LN) $(LNFLAGS) $(LIBNAME) $(DESTLIBDIR)/$(LIB)
all: $(LIB)
libsfml-graphics-s.a: $(OBJ) $(OBJGLEW) $(OBJJPEG) $(OBJPNG) $(OBJSOIL) $(OBJZLIB)
$(AR) $(ARFLAGS) $(LIBNAME) $(OBJ) $(OBJGLEW) $(OBJJPEG) $(OBJPNG) $(OBJSOIL) $(OBJZLIB)
libsfml-graphics.so: $(OBJ) $(OBJGLEW) $(OBJJPEG) $(OBJPNG) $(OBJSOIL) $(OBJZLIB)
$(CPP) $(LDFLAGS) -Wl,-soname,$(LIB).$(VERSION) -o $(LIBNAME) $(OBJ) $(OBJGLEW) $(OBJJPEG) $(OBJPNG) $(OBJSOIL) $(OBJZLIB) -lfreetype -lX11 -lGL
$(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
$(OBJGLEW) $(OBJJPEG) $(OBJPNG) $(OBJSOIL) $(OBJZLIB): %.o: %.c
$(CC) -o $@ -c $< $(CFLAGSEXT) -DSTBI_FAILURE_USERMSG
$(OBJSOIL): %.o: %.c
$(CC) -o $@ -c $< $(CFLAGSEXT) -DSTBI_FAILURE_USERMSG
$(OBJGLEW) $(OBJJPEG) $(OBJPNG) $(OBJZLIB): %.o: %.c
$(CC) -o $@ -c $< $(CFLAGSEXT)
.PHONY: clean mrproper
@ -41,7 +36,9 @@ clean:
@rm -rf $(OBJ) $(OBJGLEW) $(OBJJPEG) $(OBJPNG) $(OBJSOIL) $(OBJZLIB)
mrproper: clean
@rm -rf $(LIBNAME)
@rm -rf $(FULLLIBNAME)
install:
@($(CP) $(LIBNAME) $(DESTLIBDIR) $(INSTALL))
install:
objcopy --only-keep-debug $(FULLLIBNAME) $(DESTDBGDIR)/$(LIBNAME)
objcopy --strip-unneeded $(FULLLIBNAME) $(DESTLIBDIR)/$(LIBNAME)
$(LINK)

View File

@ -1,35 +1,17 @@
export DEBUGBUILD = no
export STATIC = no
ifeq ($(DEBUGBUILD), yes)
DEBUGFLAGS = -g -DDEBUG
else
DEBUGFLAGS = -O2 -DNDEBUG
endif
ifeq ($(STATIC), no)
BUILDFLAGS = -fPIC
LINKFLAGS = -shared
else
BUILDFLAGS =
LINKFLAGS =
endif
export CC = gcc
export CPP = g++
export CFLAGS = -W -Wall -pedantic -I../../../include -I../../ $(DEBUGFLAGS) $(BUILDFLAGS)
export CFLAGSEXT = -I../../../include -I../.. $(DEBUGFLAGS) $(BUILDFLAGS)
export LDFLAGS = $(LINKFLAGS)
export CFLAGS = -W -Wall -pedantic -g -O2 -DNDEBUG -I../../../include -I../../ -fPIC
export CFLAGSEXT = -I../../../include -I../.. -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 AR = ar
export ARFLAGS = rcs
export DESTDIR = /usr/local
export DESTLIBDIR = $(DESTDIR)/lib
export DESTINCDIR = $(DESTDIR)/include
export DESTINCDIR = $(DESTDIR)/include
export DESTDBGDIR = $(DESTLIBDIR)/debug/$(DESTLIBDIR)
all: sfml-system sfml-window sfml-network sfml-graphics sfml-audio
@ -64,4 +46,5 @@ mrproper: clean
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)/)
@(mkdir -p $(DESTDBGDIR))
@(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)

View File

@ -1,23 +1,15 @@
SRC = $(wildcard *.cpp ./Unix/*.cpp)
OBJ = $(SRC:.cpp=.o)
ifeq ($(STATIC), yes)
LIB = libsfml-network-s.a
LIBNAME = $(LIBPATH)/$(LIB)
INSTALL =
else
LIB = libsfml-network.so
LIBNAME = $(LIBPATH)/$(LIB).$(VERSION)
INSTALL = && $(LN) $(LNFLAGS) $(LIB).$(VERSION) $(DESTLIBDIR)/$(LIB)
endif
LIB = libsfml-network.so
LIBNAME = $(LIB).$(VERSION)
FULLLIBNAME = $(LIBPATH)/$(LIBNAME)
LINK = $(LN) $(LNFLAGS) $(LIBNAME) $(DESTLIBDIR)/$(LIB)
all: $(LIB)
libsfml-network-s.a: $(OBJ)
$(AR) $(ARFLAGS) $(LIBNAME) $(OBJ)
libsfml-network.so: $(OBJ)
$(CPP) $(LDFLAGS) -Wl,-soname,$(LIB).$(VERSION) -o $(LIBNAME) $(OBJ)
$(CPP) $(LDFLAGS) -Wl,-soname,$(LIBNAME) -o $(FULLLIBNAME) $(OBJ)
$(OBJ): %.o: %.cpp
$(CPP) -o $@ -c $< $(CFLAGS)
@ -28,7 +20,9 @@ clean:
@rm -rf $(OBJ)
mrproper: clean
@rm -rf $(LIBNAME)
@rm -rf $(FULLLIBNAME)
install:
@($(CP) $(LIBNAME) $(DESTLIBDIR) $(INSTALL))
objcopy --only-keep-debug $(FULLLIBNAME) $(DESTDBGDIR)/$(LIBNAME)
objcopy --strip-unneeded $(FULLLIBNAME) $(DESTLIBDIR)/$(LIBNAME)
$(LINK)

View File

@ -1,23 +1,15 @@
SRC = $(wildcard *.cpp ./Unix/*.cpp)
OBJ = $(SRC:.cpp=.o)
ifeq ($(STATIC), yes)
LIB = libsfml-system-s.a
LIBNAME = $(LIBPATH)/$(LIB)
INSTALL =
else
LIB = libsfml-system.so
LIBNAME = $(LIBPATH)/$(LIB).$(VERSION)
INSTALL = && $(LN) $(LNFLAGS) $(LIB).$(VERSION) $(DESTLIBDIR)/$(LIB)
endif
LIB = libsfml-system.so
LIBNAME = $(LIB).$(VERSION)
FULLLIBNAME = $(LIBPATH)/$(LIBNAME)
LINK = $(LN) $(LNFLAGS) $(LIBNAME) $(DESTLIBDIR)/$(LIB)
all: $(LIB)
libsfml-system-s.a: $(OBJ)
$(AR) $(ARFLAGS) $(LIBNAME) $(OBJ)
libsfml-system.so: $(OBJ)
$(CPP) $(LDFLAGS) -Wl,-soname,$(LIB).$(VERSION) -o $(LIBNAME) $(OBJ) -lpthread
$(CPP) $(LDFLAGS) -Wl,-soname,$(LIBNAME) -o $(FULLLIBNAME) $(OBJ) -lpthread
$(OBJ): %.o: %.cpp
$(CPP) -o $@ -c $< $(CFLAGS)
@ -28,7 +20,9 @@ clean:
@rm -rf $(OBJ)
mrproper: clean
@rm -rf $(LIBNAME)
@rm -rf $(FULLLIBNAME)
install:
@($(CP) $(LIBNAME) $(DESTLIBDIR) $(INSTALL))
objcopy --only-keep-debug $(FULLLIBNAME) $(DESTDBGDIR)/$(LIBNAME)
objcopy --strip-unneeded $(FULLLIBNAME) $(DESTLIBDIR)/$(LIBNAME)
$(LINK)

View File

@ -1,35 +1,28 @@
SRC = $(wildcard *.cpp ./Linux/*.cpp)
OBJ = $(SRC:.cpp=.o)
OBJGLEW = $(SRCGLEW:.c=.o)
SRC = $(wildcard *.cpp ./Linux/*.cpp)
OBJ = $(SRC:.cpp=.o)
ifeq ($(STATIC), yes)
LIB = libsfml-window-s.a
LIBNAME = $(LIBPATH)/$(LIB)
INSTALL =
else
LIB = libsfml-window.so
LIBNAME = $(LIBPATH)/$(LIB).$(VERSION)
INSTALL = && $(LN) $(LNFLAGS) $(LIB).$(VERSION) $(DESTLIBDIR)/$(LIB)
endif
LIB = libsfml-window.so
LIBNAME = $(LIB).$(VERSION)
FULLLIBNAME = $(LIBPATH)/$(LIBNAME)
LINK = $(LN) $(LNFLAGS) $(LIBNAME) $(DESTLIBDIR)/$(LIB)
all: $(LIB)
libsfml-window-s.a: $(OBJ)
$(AR) $(ARFLAGS) $(LIBNAME) $(OBJ)
libsfml-window.so: $(OBJ)
$(CPP) $(LDFLAGS) -Wl,-soname,$(LIB).$(VERSION) -o $(LIBNAME) $(OBJ) $(OBJGLEW) -lX11 -lXrandr -lGL
$(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 $(LIBNAME)
@rm -rf $(FULLLIBNAME)
install:
@($(CP) $(LIBNAME) $(DESTLIBDIR) $(INSTALL))
objcopy --only-keep-debug $(FULLLIBNAME) $(DESTDBGDIR)/$(LIBNAME)
objcopy --strip-unneeded $(FULLLIBNAME) $(DESTLIBDIR)/$(LIBNAME)
$(LINK)