updated to build and install from MSYS

git-svn-id: svn://anubis/dwscr/trunk@119 5bef9df8-b654-44bb-925b-0ff18baa8f8c
This commit is contained in:
josh 2009-10-16 13:45:54 +00:00
parent e87905c268
commit 40627ed425
3 changed files with 28 additions and 30 deletions

View File

@ -5,45 +5,44 @@
# set this to compile in "debug" mode
#DEBUG := 1
WINCHECK := $(shell which msys-1.0.dll >/dev/null 2>&1; if [ $$? -eq 0 ]; then echo MSYS; fi)
ifeq ($(strip $(WINCHECK)),)
WINDOWS := 0
else
WINDOWS := 1
endif
OBJS = dwscr.o wfobj/WFObj.o LoadFile/LoadFile.o ss/ss.a
TARGET = dwscr
export CXXFLAGS := -O2 -Wall
export CPPFLAGS
ifdef DEBUG
CPPFLAGS += -DDEBUG
CPPFLAGS += -g
endif
ifdef WITHOUT_ODE
CPPFLAGS += -DWITHOUT_ODE
endif
ifdef WIN32
export CP := copy
export MV := rename
export CC := mingw32-gcc
export CXX := mingw32-g++
export CPPFLAGS += $(shell sdl-config --cflags)
ifndef WITHOUT_ODE
export CPPFLAGS += $(shell ode-config --cflags)
endif
LDFLAGS += -lopengl32 -lglu32 -lmingw32 $(shell sdl-config --libs)
ifndef WITHOUT_ODE
LDFLAGS += $(shell ode-config --libs)
endif
ifeq ($(WINDOWS),1)
LDFLAGS += -lopengl32 -lglu32 -lmingw32
TARGET := $(TARGET).exe
SSNAME := dwscr.scr
INSTALLDIR := C:\WINDOWS
OBJS += displayinfo-win32.o
else
export CP := cp
export MV := mv
export CC := gcc
export CXX := g++
export AR := ar
export CPPFLAGS += `sdl-config --cflags` `ode-config --cflags`
LDFLAGS += `sdl-config --libs` `ode-config --libs` -lGL -lGLU
LDFLAGS += -lGL -lGLU
OBJS += displayinfo.o
endif
LDFLAGS += $(shell sdl-config --libs)
export CPPFLAGS += $(shell sdl-config --cflags)
ifdef WITHOUT_ODE
CPPFLAGS += -DWITHOUT_ODE
else
CPPFLAGS += $(shell ode-config --cflags)
LDFLAGS += $(shell ode-config --libs)
endif
all: $(TARGET)
@ -62,10 +61,10 @@ LoadFile/LoadFile.o:
ss/ss.a:
$(MAKE) -C ss
ifdef WIN32
ifeq ($(WINDOWS),1)
.PHONY: install
install:
$(CP) $(TARGET) $(INSTALLDIR)\$(SSNAME)
cp $(TARGET) $(INSTALLDIR)\$(SSNAME)
endif
.PHONY: clean

View File

@ -1 +0,0 @@
mingw32-make WIN32=1 %*