From 2e58db1a5ee9ccbc1ef395ec496ad9fa100f16fb Mon Sep 17 00:00:00 2001 From: Patrik Gornicz Date: Sat, 2 May 2009 15:04:38 -0400 Subject: [PATCH] create rules for win32 and final builds --- .gitignore | 6 +++++ Makefile | 79 ++++++++++++++++++++++++++++++++++++++++++++++++++------------ 2 files changed, 70 insertions(+), 15 deletions(-) diff --git a/.gitignore b/.gitignore index 638949d..bba6fcb 100644 --- a/.gitignore +++ b/.gitignore @@ -2,3 +2,9 @@ deps objsd bind + +objs +bin + +objs-mingw32 +bin-mingw32 diff --git a/Makefile b/Makefile index 1d4fa02..7cab422 100644 --- a/Makefile +++ b/Makefile @@ -1,25 +1,56 @@ -LIBGL := -lGL -lGLU -LIBSDL := `sdl-config --libs` -LIBS := ${LIBSDL} ${LIBGL} +# 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} OPTFLAGS := -O2 DBGFLAGS := -ggdb PRFFLAGS := ${DBGFLAGS} -pg -MYFLAGS := -Wall -pedantic -ansi -fPIC +MYFLAGS := -Wall -pedantic -ansi -VALFLAGS := --leak-check=full -CXXFLAGS := ${MYFLAGS} ${DBGFLAGS} +ifeq (${WIN32},1) + CXXFLAGS := ${OPTFLAGS} +else +ifeq (${FINAL},1) + CXXFLAGS := ${OPTFLAGS} -fPIC +else + CXXFLAGS := ${MYFLAGS} ${DBGFLAGS} -fPIC +endif +endif -CXX := g++ +ifeq (${WIN32},1) + CXX := mingw32-g++ +else + CXX := g++ +endif -DIRS := # := start +DIRS := # := start SRCSDIR := src/ SRCS := # := start -OBJSDIR := objsd/ -OBJS := # := start +ifeq (${WIN32},1) + OBJSDIR := objs-mingw32/ +else +ifeq (${FINAL},1) + OBJSDIR := objs/ +else + OBJSDIR := objsd/ +endif +endif +OBJS := # := start DEPSDIR := deps/ DEPS := # := start @@ -28,18 +59,36 @@ DEPS := # := start DIRMK := dir.mk include ${SRCSDIR}${DIRMK} -WORKINGDIR := bind/ +ifeq (${WIN32},1) + WORKINGDIR := bin-mingw32/ +else +ifeq (${FINAL},1) + WORKINGDIR := bin/ +else + WORKINGDIR := bind/ +endif +endif -LINKERNAME := libpg.so -SONAME := libpg.so.0 -REALNAME := libpg.so.0.0 +ifeq (${WIN32},1) + LINKERNAME := pg.dll + SONAME := pg.dll + REALNAME := pg.dll +else + LINKERNAME := libpg.so + SONAME := libpg.so.0 + REALNAME := libpg.so.0.0 +endif TARGETTMP := ${OBJSDIR}${REALNAME} TARGET := ${WORKINGDIR}${REALNAME} DEPSBLDDIRS := ${DEPSDIR} $(addprefix ${DEPSDIR},${DIRS}) OBJSBLDDIRS := ${OBJSDIR} $(addprefix ${OBJSDIR},${DIRS}) -BLDDIRS := ${OBJSBLDDIRS} ${DEPSBLDDIRS} ${WORKINGDIR} ${DSTCFGDIR} + +BLDDIRS := # := start +BLDDIRS += ${OBJSBLDDIRS} +BLDDIRS += ${DEPSBLDDIRS} +BLDDIRS += ${WORKINGDIR} INCDIRS := ${SRCSDIR} inc/ INCFLAGS := $(addprefix -I, ${INCDIRS}) -- 2.10.2