- 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
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 :=
# 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}"