A little more Cygwin-friendly.
authorRyan C. Gordon <icculus@icculus.org>
Sat, 01 Sep 2001 23:38:11 +0000
changeset 86 934663982ca9
parent 85 fd53eb9f9ec9
child 87 be2efecec922
A little more Cygwin-friendly.
Makefile
--- a/Makefile	Wed Aug 29 17:13:06 2001 +0000
+++ b/Makefile	Sat Sep 01 23:38:11 2001 +0000
@@ -172,15 +172,11 @@
 ifeq ($(strip $(use_archive_zip)),true)
   MAINSRCS += archivers/zip.c archivers/unzip.c
   CFLAGS += -DPHYSFS_SUPPORTS_ZIP
+  LDFLAGS += -lz
   ifeq ($(strip $(cygwin)),true)
+    EXTRABUILD += zlibwin32/zlib.a
     CFLAGS += -Izlibwin32
-    ifeq ($(strip $(debugging)),true)
-      LDFLAGS += zlibwin32/zlibstat_multid.lib  
-    else
-      LDFLAGS += zlibwin32/zlibstat_multir.lib  
-    endif
-  else
-    LDFLAGS += -lz
+    LDFLAGS += -Lzlibwin32
   endif
 endif
 
@@ -233,13 +229,13 @@
 
 .PHONY: all clean distclean listobjs install
 
-all: $(BINDIR) $(MAINLIB) $(TESTEXE)
+all: $(BINDIR) $(EXTRABUILD) $(MAINLIB) $(TESTEXE)
 
 $(MAINLIB) : $(BINDIR) $(MAINOBJS)
-	$(LINKER) -o $(MAINLIB) $(LDFLAGS) $(SHAREDFLAGS) $(MAINOBJS)
+	$(LINKER) -o $(MAINLIB) $(SHAREDFLAGS) $(MAINOBJS) $(LDFLAGS)
 
 $(TESTEXE) : $(MAINLIB) $(TESTOBJS)
-	$(LINKER) -o $(TESTEXE) $(LDFLAGS) $(TESTLDFLAGS) $(TESTOBJS) -L$(BINDIR) -l$(strip $(PUREBASELIBNAME))
+	$(LINKER) -o $(TESTEXE) $(TESTLDFLAGS) $(TESTOBJS) -L$(BINDIR) -l$(strip $(PUREBASELIBNAME)) $(LDFLAGS)
 
 
 install: all
@@ -264,11 +260,21 @@
 	mkdir -p $(BINDIR)/platform
 	mkdir -p $(BINDIR)/test
 
+
+ifeq ($(strip $(cygwin)),true)
+zlibwin32/zlib.a:
+	cd zlibwin32 ; $(MAKE) CC=$(CC)
+endif
+
+
 distclean: clean
 
 clean:
 	rm -f $(CLEANUP)
 	rm -rf $(BINDIR)
+ifeq ($(strip $(cygwin)),true)
+	cd zlibwin32 ; $(MAKE) clean
+endif
 
 listobjs:
 	@echo SOURCES: