1 # Makefile for UnZip, fUnZip and UnZipSFX for native Win32-Intel ports of gcc.
2 # Currently supported implementations: Cygnus/Win32 and MinGW32.
4 # First version: Cosmin Truta <cosmint@cs.ubbcluj.ro>, Dec 1997.
5 # Last revision: Christian Spieler, 29-Apr-1998
7 # To use, do "make -f win32/makefile.gcc".
12 # Optional nonstandard preprocessor flags (as -DUSE_ZLIB or -DUSE_SMITH_CODE)
13 # should be added to the environment via "set LOCAL_UNZIP=-DFOO" or added
14 # to the declaration of LOCFLAGS here:
15 LOCFLAGS = $(LOCAL_UNZIP)
18 ### Compiler-specific section
20 # ------------ GNU C ------------
31 AS_QUIET_OPT = $(CC_QUIET_OPT)
32 LD_QUIET_OPT = $(CC_QUIET_OPT)
36 AS_WARN_OPT = $(CC_WARN_OPT)
41 AS_DEBUG_OPT = $(CC_DEBUG_OPT)
42 LD_DEBUG_OPT = $(CC_DEBUG_OPT)
55 # Output object file name
58 # Other specific options
59 #CC_SPECIFIC_OPT = -c -DASM_CRC -DWIN32 -mno-cygwin
60 CC_SPECIFIC_OPT = -c -DWIN32 -I../inczip -g -I.. -D_X86_=1 -DWIN32 -D_WIN32 -DWINVER=0x0400 -D__WIN95__ -D__GNUWIN32__ -D__WIN32__ -I../../../include -I../../../src/png -I../../../src/jpeg -I../../../src/zlib -I../../../include/wx/msw/gnuwin32 -DSTRICT -D__WXMSW__ -D__WINDOWS__ -D__WXDEBUG__ -Wall -fno-pcc-struct-return -O2 -fno-rtti -fno-exceptions
62 LD_SPECIFIC_OPT = -Wl,--subsystem,windows -mwindows -L../../../lib -o $@
64 # Libraries for the debug & release version
65 LD_RELEASE_LIBS = ../../../lib/libwx.a -lpng -ljpeg -lzlib -lxpm -lstdc++ -lgcc -lwinspool -lwinmm -lshell32 -lcomctl32 -lctl3d32 -lodbc32 -ladvapi32 -lole32 -loleaut32 -luuid -lodbc32 -lwsock32
66 LD_DEBUG_LIBS = $(LD_RELEASE_LIBS)
69 ### System-specific section
75 .SUFFIXES: .c .S $(OBJ) $(EXE)
83 CFLAGS = $(CC_SPECIFIC_OPT) $(CC_QUIET_OPT) $(CC_WARN_OPT) $(LOCFLAGS) \
85 ASFLAGS = $(AS_SPECIFIC_OPT) $(AS_QUIET_OPT) $(AS_WARN_OPT) $(LOCFLAGS)
86 LDFLAGS = $(LD_SPECIFIC_OPT) $(LD_QUIET_OPT) $(LD_WARN_OPT)
88 # To build with debug info, use 'make DEBUG=1'.
90 CVER = $(CC_DEBUG_OPT)
91 ASVER = $(AS_DEBUG_OPT)
92 LDVER = $(LD_DEBUG_OPT)
96 LDLIBS = $(LD_DEBUG_LIBS)
98 CVER = $(CC_RELEASE_OPT)
99 ASVER = $(AS_RELEASE_OPT)
100 LDVER = $(LD_RELEASE_OPT)
101 GENFLAGS = $(CC_SPEED_OPT)
102 FFLAGS = $(CC_SPEED_OPT) -DFUNZIP
103 SFXFLAGS = $(CC_SIZE_OPT) -DSFX
104 LDLIBS = $(LD_RELEASE_LIBS)
108 OBJA = crc_i386$(OBJ) install$(OBJ) wxmain$(OBJ) instsup$(OBJ)
109 OBJS1 = unzip$(OBJ) crc32$(OBJ) crctab$(OBJ) crypt$(OBJ) envargs$(OBJ)
110 OBJS2 = explode$(OBJ) extract$(OBJ) fileio$(OBJ) globals$(OBJ) inflate$(OBJ)
111 OBJS3 = list$(OBJ) match$(OBJ) process$(OBJ) ttyio$(OBJ) unreduce$(OBJ)
112 OBJS4 = unshrink$(OBJ) zipinfo$(OBJ) win32$(OBJ) nt$(OBJ)
113 OBJS = $(OBJS1) $(OBJS2) $(OBJS3) $(OBJS4) $(OBJA)
115 UNZIP_H = ../inczip/unzip.h ../inczip/unzpriv.h ../inczip/globals.h ../inczip/w32cfg.h
118 # Default target is all the executables
122 $(LD) $(LDFLAGS) $(LDVER) $(OBJS) $(LDLIBS)
124 # How to compile sources
126 $(CC) $(CFLAGS) $(CVER) $(GENFLAGS) $<
128 $(AS) $(ASFLAGS) $(ASVER) $(GENFLAGS) $<
131 crc32$(OBJ): crc32.c $(UNZIP_H) ../inczip/zip.h
132 crctab$(OBJ): crctab.c $(UNZIP_H) ../inczip/zip.h
133 crypt$(OBJ): crypt.c $(UNZIP_H) ../inczip/zip.h ../inczip/crypt.h ../inczip/ttyio.h
134 envargs$(OBJ): envargs.c $(UNZIP_H)
135 explode$(OBJ): explode.c $(UNZIP_H)
136 extract$(OBJ): extract.c $(UNZIP_H) ../inczip/crypt.h
137 fileio$(OBJ): fileio.c $(UNZIP_H) ../inczip/crypt.h ../inczip/ttyio.h ../inczip/ebcdic.h
138 funzip$(OBJ): funzip.c $(UNZIP_H) ../inczip/crypt.h ../inczip/ttyio.h ../inczip/tables.h
139 globals$(OBJ): globals.c $(UNZIP_H)
140 inflate$(OBJ): inflate.c ../inczip/inflate.h $(UNZIP_H)
141 list$(OBJ): list.c $(UNZIP_H)
142 match$(OBJ): match.c $(UNZIP_H)
143 process$(OBJ): process.c $(UNZIP_H)
144 ttyio$(OBJ): ttyio.c $(UNZIP_H) ../inczip/zip.h ../inczip/crypt.h ../inczip/ttyio.h
145 unreduce$(OBJ): unreduce.c $(UNZIP_H)
146 unshrink$(OBJ): unshrink.c $(UNZIP_H)
147 unzip$(OBJ): unzip.c $(UNZIP_H) ../inczip/crypt.h ../inczip/version.h ../inczip/consts.h
148 zipinfo$(OBJ): zipinfo.c $(UNZIP_H)
149 crc_i386$(OBJ): crc_i386.S
150 win32$(OBJ): win32.c $(UNZIP_H) ../inczip/nt.h
151 nt$(OBJ): nt.c ../inczip/nt.h
153 install$(OBJ): ../install.c
154 $(CC) $(CFLAGS) $(CVER) $(GENFLAGS) $<
156 wxmain$(OBJ): ../wxmain.cpp
157 $(CC) $(CFLAGS) $(CVER) $(GENFLAGS) $<
159 instsup$(OBJ): ../instsup.cpp
160 $(CC) $(CFLAGS) $(CVER) $(GENFLAGS) $<