# Makefile for unzip library for native Win32-Intel ports of gcc. # # First version: Cosmin Truta , Dec 1997. # Last revision: Christian Spieler, 29-Apr-1998 # This version Brian Ripley 2-May-1999 include ../../MkRules ### Optional section # Optional nonstandard preprocessor flags (as -DUSE_ZLIB or -DUSE_SMITH_CODE) # should be added to the environment via "set LOCAL_UNZIP=-DFOO" or added # to the declaration of LOCFLAGS here: LOCFLAGS = $(LOCAL_UNZIP) ### Compiler-specific section # ------------ GNU C ------------ #CC = gcc #AS = as AS = $(CC) #LD = ld LD = $(CC) # Quiet CC_QUIET_OPT = AS_QUIET_OPT = $(CC_QUIET_OPT) LD_QUIET_OPT = $(CC_QUIET_OPT) # Warnings CC_WARN_OPT = -Wall AS_WARN_OPT = $(CC_WARN_OPT) LD_WARN_OPT = # Debug version CC_DEBUG_OPT = -g AS_DEBUG_OPT = $(CC_DEBUG_OPT) LD_DEBUG_OPT = $(CC_DEBUG_OPT) # Release version CC_RELEASE_OPT = AS_RELEASE_OPT = LD_RELEASE_OPT = -s # Smallest code CC_SIZE_OPT = -O1 # Fastest code CC_SPEED_OPT = -O2 # Output object file name CC_OUT_OPT = -o # Other specific options CC_SPECIFIC_OPT = -c -DASM_CRC -DWIN32 AS_SPECIFIC_OPT = -c LD_SPECIFIC_OPT = -o $@ # Libraries for the debug & release version LD_RELEASE_LIBS = -luser32 -ladvapi32 LD_DEBUG_LIBS = $(LD_RELEASE_LIBS) ### System-specific section # Suffixes OBJ = .o EXE = .exe .SUFFIXES: .c .S $(OBJ) $(EXE) # Commands #RM = rm -f OBJS = api.o crc_i386.o crctab.o crypt.o explode.o extract.o fileio.o \ globals.o inflate.o list.o match.o nt.o process.o ttyio.o unreduce.o \ unshrink.o win32.o windll.o zipinfo.o all: unzip32.a unzip32.a: $(OBJS) $(AR) cr $@ *.o $(RANLIB) $@ ### General section CFLAGS = $(CC_SPECIFIC_OPT) $(CC_QUIET_OPT) $(CC_WARN_OPT) $(LOCFLAGS) \ $(CC_OUT_OPT) $@ ASFLAGS = $(AS_SPECIFIC_OPT) $(AS_QUIET_OPT) $(AS_WARN_OPT) $(LOCFLAGS) LDFLAGS = $(LD_SPECIFIC_OPT) $(LD_QUIET_OPT) $(LD_WARN_OPT) CVER = $(CC_RELEASE_OPT) ASVER = $(AS_RELEASE_OPT) LDVER = $(LD_RELEASE_OPT) GENFLAGS = $(CC_SPEED_OPT) -DDLL -DWINDLL -D_WINDOWS -I. FFLAGS = $(CC_SPEED_OPT) -DFUNZIP SFXFLAGS = $(CC_SIZE_OPT) -DSFX -DSFX_EXDIR LDLIBS = $(LD_RELEASE_LIBS) UNZIP_H = unzip.h unzpriv.h globals.h win32/w32cfg.h # How to compile sources .c$(OBJ): $(CC) $(CFLAGS) $(CVER) $(GENFLAGS) $< .S$(OBJ): $(AS) $(ASFLAGS) $(ASVER) $(GENFLAGS) $< # Dependencies crc32$(OBJ): crc32.c $(UNZIP_H) zip.h crctab$(OBJ): crctab.c $(UNZIP_H) zip.h crypt$(OBJ): crypt.c $(UNZIP_H) zip.h crypt.h ttyio.h envargs$(OBJ): envargs.c $(UNZIP_H) explode$(OBJ): explode.c $(UNZIP_H) extract$(OBJ): extract.c $(UNZIP_H) crypt.h fileio$(OBJ): fileio.c $(UNZIP_H) crypt.h ttyio.h ebcdic.h funzip$(OBJ): funzip.c $(UNZIP_H) crypt.h ttyio.h tables.h globals$(OBJ): globals.c $(UNZIP_H) inflate$(OBJ): inflate.c inflate.h $(UNZIP_H) list$(OBJ): list.c $(UNZIP_H) match$(OBJ): match.c $(UNZIP_H) process$(OBJ): process.c $(UNZIP_H) ttyio$(OBJ): ttyio.c $(UNZIP_H) zip.h crypt.h ttyio.h unreduce$(OBJ): unreduce.c $(UNZIP_H) unshrink$(OBJ): unshrink.c $(UNZIP_H) unzip$(OBJ): unzip.c $(UNZIP_H) crypt.h version.h consts.h zipinfo$(OBJ): zipinfo.c $(UNZIP_H) crc_i386$(OBJ): crc_i386.S win32$(OBJ): win32/win32.c $(UNZIP_H) win32/nt.h $(CC) $(CFLAGS) $(CVER) $(GENFLAGS) -I. win32/win32.c nt$(OBJ): win32/nt.c win32/nt.h $(CC) $(CFLAGS) $(CVER) $(GENFLAGS) -I. win32/nt.c win32x$(OBJ): win32/win32.c $(UNZIP_H) win32/nt.h # unzipsfx only $(CC) $(CFLAGS) $(CVER) $(SFXFLAGS) -I. win32/win32.c ntx$(OBJ): win32/nt.c win32/nt.h # unzipsfx only $(CC) $(CFLAGS) $(CVER) $(SFXFLAGS) -I. win32/nt.c win32f$(OBJ): win32/win32.c $(UNZIP_H) win32/nt.h # funzip only $(CC) $(CFLAGS) $(CVER) $(FFLAGS) -I. win32/win32.c cryptf$(OBJ): crypt.c $(UNZIP_H) zip.h crypt.h ttyio.h # funzip only $(CC) $(CFLAGS) $(CVER) $(FFLAGS) crypt.c extractx$(OBJ): extract.c $(UNZIP_H) crypt.h # unzipsfx only $(CC) $(CFLAGS) $(CVER) $(SFXFLAGS) extract.c fileiox$(OBJ): fileio.c $(UNZIP_H) crypt.h ttyio.h ebcdic.h # unzipsfx only $(CC) $(CFLAGS) $(CVER) $(SFXFLAGS) fileio.c globalsx$(OBJ): globals.c $(UNZIP_H) # unzipsfx only $(CC) $(CFLAGS) $(CVER) $(SFXFLAGS) globals.c globalsf$(OBJ): globals.c $(UNZIP_H) # funzip only $(CC) $(CFLAGS) $(CVER) $(FFLAGS) globals.c inflatex$(OBJ): inflate.c inflate.h $(UNZIP_H) crypt.h # unzipsfx only $(CC) $(CFLAGS) $(CVER) $(SFXFLAGS) inflate.c inflatef$(OBJ): inflate.c inflate.h $(UNZIP_H) crypt.h # funzip only $(CC) $(CFLAGS) $(CVER) $(FFLAGS) inflate.c matchx$(OBJ): match.c $(UNZIP_H) # unzipsfx only $(CC) $(CFLAGS) $(CVER) $(SFXFLAGS) match.c processx$(OBJ): process.c $(UNZIP_H) # unzipsfx only $(CC) $(CFLAGS) $(CVER) $(SFXFLAGS) process.c ttyiox$(OBJ): ttyio.c $(UNZIP_H) zip.h crypt.h ttyio.h # unzipsfx only $(CC) $(CFLAGS) $(CVER) $(SFXFLAGS) ttyio.c ttyiof$(OBJ): ttyio.c $(UNZIP_H) zip.h crypt.h ttyio.h # funzip only $(CC) $(CFLAGS) $(CVER) $(FFLAGS) ttyio.c unzipsfx$(OBJ): unzip.c $(UNZIP_H) crypt.h version.h consts.h # unzipsfx only $(CC) $(CFLAGS) $(CVER) $(SFXFLAGS) unzip.c windll.o: windll/windll.c $(CC) $(CFLAGS) $(CVER) $(GENFLAGS) -o $@ $^ clean: $(RM) *$(OBJ) $(RM) unzip32.a