diff --git a/LoadFile/genLoadFile.pl b/LoadFile/genLoadFile.pl index 46885b6..9d19068 100755 --- a/LoadFile/genLoadFile.pl +++ b/LoadFile/genLoadFile.pl @@ -28,7 +28,7 @@ foreach my $fileName (@fileList) my $length = length($fileContents); my @fileContents = split(//, $fileContents); my $cname = "dat$index"; - print OUTPUT "\nstatic unsigned char ${cname}[] = {\n"; + print OUTPUT "\nstatic unsigned char ${cname} [] = {\n"; for (my $byteNum = 0; $byteNum <= $#fileContents; $byteNum++) { print OUTPUT " " if ($byteNum % 12 == 0); diff --git a/Makefile b/Makefile index 99eb12b..a812017 100644 --- a/Makefile +++ b/Makefile @@ -5,43 +5,42 @@ # 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 + +ifeq ($(WINDOWS),1) +LDFLAGS += -lopengl32 -lglu32 -lmingw32 +TARGET := $(TARGET).exe +SSNAME := dwscr.scr +INSTALLDIR := C:\WINDOWS +OBJS += displayinfo-win32.o +else +LDFLAGS += -lGL -lGLU +OBJS += displayinfo.o +endif + +LDFLAGS += $(shell sdl-config --libs) +export CPPFLAGS += $(shell sdl-config --cflags) + 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 -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 -OBJS += displayinfo.o +CPPFLAGS += $(shell ode-config --cflags) +LDFLAGS += $(shell ode-config --libs) endif @@ -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 diff --git a/make-win32.bat b/make-win32.bat deleted file mode 100755 index 2229c2c..0000000 --- a/make-win32.bat +++ /dev/null @@ -1 +0,0 @@ -mingw32-make WIN32=1 %*