From: Patrik Gornicz Date: Fri, 1 May 2009 23:10:29 +0000 (-0400) Subject: Merge branch 'master' into libpg X-Git-Url: http://gitweb.pgornicz.com/gitweb.cgi?p=physics.git;a=commitdiff_plain;h=41379c9cf8b7128f23a9c285d3e50cad0d5d2de4 Merge branch 'master' into libpg Conflicts: Makefile --- 41379c9cf8b7128f23a9c285d3e50cad0d5d2de4 diff --cc Makefile index f7e490d,9d523b5..6faa1df --- a/Makefile +++ b/Makefile @@@ -1,22 -1,42 +1,46 @@@ - LIBGL := -lGL -lGLU - LIBSDL := `sdl-config --libs` - LIBS := ${LIBSDL} ${LIBGL} -lpg + # set this on the command line to 1 to get a windows 32 build + WIN32 := 0 + + # set this on the command line to 1 to get a final (none debug) build + FINAL := 0 + + + ifeq (${WIN32},1) + LIBGL := -lopengl32 -lglu32 + LIBSDL := `/usr/mingw32/bin/sdl-config --libs` + else + LIBGL := -lGL -lGLU + LIBSDL := `sdl-config --libs` + endif -LIBS := ${LIBSDL} ${LIBGL} - ++LIBMY := -lpg ++LIBS := ${LIBSDL} ${LIBGL} ${LIBMY} OPTFLAGS := -O2 DBGFLAGS := -ggdb PRFFLAGS := ${DBGFLAGS} -pg MYFLAGS := -Wall -pedantic -ansi +RPATH := libs/ + VALFLAGS := --leak-check=full - CXXFLAGS := ${MYFLAGS} ${DBGFLAGS} +LNKFLAGS := -Wl,-rpath,${RPATH} + - CXX := g++ + ifeq (${WIN32},1) + CXXFLAGS := ${OPTFLAGS} + else ifeq (${FINAL},1) + CXXFLAGS := ${OPTFLAGS} + else + CXXFLAGS := ${MYFLAGS} ${DBGFLAGS} + endif + + ifeq (${WIN32},1) + CXX := mingw32-g++ + else + CXX := g++ + endif -DIRS := # := start +DIRS := # := start SRCSDIR := src/ SRCS := # := start @@@ -52,8 -83,11 +88,12 @@@ LIBSTXT += VERSION-SD LIBSTXT := $(addprefix ${DSTLIBSDIR},${LIBSTXT}) LIBSCPY := # := start - LIBSCPY += libSDL-1.2.so.0 - LIBSCPY += libpg.so.0 + ifeq (${WIN32},1) + LIBSCPY += SDL.dll + else - LIBSCPY += libSDL.so ++ LIBSCPY += libSDL-1.2.so.0 ++ LIBSCPY += libpg.so.0 + endif LIBSCPY := $(addprefix ${DSTLIBSDIR},${LIBSCPY}) SRCTXTDIR := @@@ -143,9 -174,11 +187,11 @@@ ${OBJSDIR}%.o: ${SRCSDIR}%.cpp | $$(di # DON'T simply use another sed delimiter or it can't appear in the file paths ${DEPSDIR}%.d: ${SRCSDIR}%.cpp | $$(dir $$@) ${Q1}${PRNTFMT} "DEP" "$@" - ${Q2}${CXX} -MM ${CXXFLAGS} $< -I "${INCDIRS}" | \ + ${Q2}${CXX} -MM ${CXXFLAGS} $< ${INCFLAGS} | \ sed 's/\(^.*\):/$(subst /,\/,${OBJSDIR}\1 $@):/' > $@ + CLEANCMDS := cleanbin cleanobjs cleandeps clean cleanall + .PHONY: cleanbin cleanbin: ${Q1}${PRNTFMT} "rm" "${WORKINGDIR}"