X-Git-Url: http://gitweb.pgornicz.com/gitweb.cgi?a=blobdiff_plain;f=Makefile;h=8fb3377939ef62dd49526e0f7773abef68e0666b;hb=6029825fe57b4a07ab4782b338d5c427c9e6af06;hp=9b5a2f6bb2db17a0415d2cc5078d59f79fca1dd0;hpb=bb552d933ec4bc4484eb7868cb7993996833f3d3;p=physics.git diff --git a/Makefile b/Makefile index 9b5a2f6..8fb3377 100644 --- a/Makefile +++ b/Makefile @@ -1,12 +1,9 @@ -# set this on the command line to 1 to get a windows 32 build -WIN32 := 0 +# set this on the command line to get a WIN32 or a FINAL build +BUILD := DEBUG -# set this on the command line to 1 to get a final (none debug) build -FINAL := 0 - -ifeq (${WIN32},1) +ifeq (${BUILD},WIN32) LIBGL := -lopengl32 -lglu32 LIBSDL := `/usr/mingw32/bin/sdl-config --libs` else @@ -26,17 +23,17 @@ RPATH := libs/ VALFLAGS := --leak-check=full LNKFLAGS := -Wl,-rpath,${RPATH} -ifeq (${WIN32},1) - CXXFLAGS := ${OPTFLAGS} +ifeq (${BUILD},WIN32) + CXXFLAGS := ${MYFLAGS} ${OPTFLAGS} else -ifeq (${FINAL},1) - CXXFLAGS := ${OPTFLAGS} +ifeq (${BUILD},FINAL) + CXXFLAGS := ${MYFLAGS} ${OPTFLAGS} else CXXFLAGS := ${MYFLAGS} ${DBGFLAGS} endif endif -ifeq (${WIN32},1) +ifeq (${BUILD},WIN32) CXX := mingw32-g++ else CXX := g++ @@ -47,10 +44,10 @@ DIRS := # := start SRCSDIR := src/ SRCS := # := start -ifeq (${WIN32},1) +ifeq (${BUILD},WIN32) OBJSDIR := objs-mingw32/ else -ifeq (${FINAL},1) +ifeq (${BUILD},FINAL) OBJSDIR := objs/ else OBJSDIR := objsd/ @@ -65,10 +62,10 @@ DEPS := # := start DIRMK := dir.mk include ${SRCSDIR}${DIRMK} -ifeq (${WIN32},1) +ifeq (${BUILD},WIN32) WORKINGDIR := bin-mingw32/ else -ifeq (${FINAL},1) +ifeq (${BUILD},FINAL) WORKINGDIR := bin/ else WORKINGDIR := bind/ @@ -85,7 +82,11 @@ CFGS := $(addprefix ${DSTCFGDIR},${CFGS}) LIBSDIRNAME := libs/ SRCLIBSDIR := ${LIBSDIRNAME} -DSTLIBSDIR := ${WORKINGDIR}${LIBSDIRNAME} +ifeq (${BUILD},WIN32) + DSTLIBSDIR := ${WORKINGDIR} +else + DSTLIBSDIR := ${WORKINGDIR}${LIBSDIRNAME} +endif LIBSTXT := # := start LIBSTXT += COPYING-SDL @@ -94,8 +95,9 @@ LIBSTXT += VERSION-SDL LIBSTXT := $(addprefix ${DSTLIBSDIR},${LIBSTXT}) LIBSCPY := # := start -ifeq (${WIN32},1) +ifeq (${BUILD},WIN32) LIBSCPY += SDL.dll + LIBSCPY += pg.dll else LIBSCPY += libSDL-1.2.so.0 LIBSCPY += libpg.so.0 @@ -109,7 +111,7 @@ TXT := # := start TXT += COPYING TXT := $(addprefix ${DSTTXTDIR},${TXT}) -ifeq (${WIN32},1) +ifeq (${BUILD},WIN32) TARGETNAME := run_physics.exe else TARGETNAME := run_physics @@ -126,12 +128,17 @@ BLDDIRS += ${DEPSBLDDIRS} BLDDIRS += ${WORKINGDIR} BLDDIRS += ${DSTCFGDIR} BLDDIRS += ${DSTLIBSDIR} +BLDDIRS := $(sort ${BLDDIRS}) # remove possible duplicates INCDIRS := ${SRCSDIR} INCFLAGS := $(addprefix -I, ${INCDIRS}) -PRNTFMT := printf "%-5s: %s\n" +ifeq (${BUILD},WIN32) + PRNTFMT := printf "%-12s: %s\n" +else + PRNTFMT := printf "%-8s: %s\n" +endif VERBOSE := 0