📄 makefile
字号:
#==============================================================================# Makefile for UnZip, UnZipSFX and fUnZip: Atari ("real" makes only)# Version: 5.32 5 October 1997#==============================================================================# INSTRUCTIONS (such as they are):## "make" -- makes UnZip on a generic Atari## CF are flags for the C compiler. LF are flags for the loader. LF2 are more# flags for the loader, if they need to be at the end of the line instead of at# the beginning (for example, some libraries). FL and FL2 are the corre-# sponding flags for fUnZip. LOCAL_UNZIP is an environment variable that can# be used to add default C flags to your compile without editing the Makefile# (e.g., -DDEBUG_STRUC, or -FPi87 on PCs using Microsoft C).## Be sure to test your new UnZip (and UnZipSFX and fUnZip); successful compila-# tion does not always imply a working program.###################### MACRO DEFINITIONS ####################### Defaults most systems use (use LOCAL_UNZIP in environment to add flags,# such as -DDOSWILD).# UnZip flagsCC = gcc# try using "gcc" target rather than changing this (if you do,LD = $(CC)# you MUST change LD, too--else "unresolved symbol: ___main")LOC = $(LOCAL_UNZIP)CF = $(CFLAGS) $(LOC)LF = -o unzip$ELF2 = -s# UnZipSFX flagsSL = -o unzipsfx$ESL2 = $(LF2)# fUnZip flagsFL = -o funzip$EFL2 = $(LF2)# general-purpose stuffCP = ln -sLN = lnRM = rm -fCHMOD = chmodSTRIP = stripE = .ttpO = .oM = atariSHELL = /bin/sh# object filesOBJS1 = unzip$O crc32$O crctab$O crypt$O envargs$O explode$OOBJS2 = extract$O fileio$O globals$O inflate$O list$O match$OOBJS3 = process$O ttyio$O unreduce$O unshrink$O zipinfo$OOBJS = $(OBJS1) $(OBJS2) $(OBJS3) $M$OLOBJS = $(OBJS)OBJSDLL = $(OBJS) api$OOBJX = unzipsfx$O crc32$O crctab$O crypt$O extract_$O fileio$O globals$O \ inflate$O match$O process_$O ttyio$O $M_$OLOBJX = $(OBJX)OBJF = funzip$O crc32$O crypt_$O globals_$O inflate_$O ttyio_$O#OBJS_OS2 = $(OBJS1:.o=.obj) $(OBJS2:.o=.obj) os2.obj#OBJF_OS2 = $(OBJF:.o=.obj)UNZIP_H = unzip.h unzpriv.h globals.h# installationINSTALL = cp# probably can change this to 'install' if you have it# on some systems, manext=l and MANDIR=/usr/man/man$(manext) may be appropriatemanext = 1prefix = /usr/localBINDIR = $(prefix)/bin# where to install executablesMANDIR = $(prefix)/man/man$(manext)# where to install man pagesINSTALLEDBIN = $(BINDIR)/funzip$E $(BINDIR)/zipinfo$E $(BINDIR)/unzipsfx$E \ $(BINDIR)/unzip$EINSTALLEDMAN = $(MANDIR)/unzip.$(manext) $(MANDIR)/funzip.$(manext) \ $(MANDIR)/unzipsfx.$(manext) $(MANDIR)/zipinfo.$(manext)#UNZIPS = unzip$E funzip$E unzipsfx$E# this is a little ugly...well, no, it's a lot ugly:MANS = unix/unzip.1 unix/unzipsfx.1 unix/zipinfo.1 unix/funzip.1DOCS = unzip.doc unzipsfx.doc zipinfo.doc funzip.doc################################################ BASIC COMPILE INSTRUCTIONS AND DEPENDENCIES ################################################# this is for GNU make; comment out and notify zip-bugs if it causes errors.SUFFIXES: .c .o .obj# yes, we should be able to use the $O macro to combine these two, but it# fails on some brain-damaged makes (e.g., AIX's)...no big deal.c.o: $(CC) -c $(CF) $*.c.c.obj: $(CC) -c $(CF) $*.c##################### DEFAULT HANDLING #####################all: unzipsunzips: $(UNZIPS)docs: $(DOCS)unzipsman: unzips docsunzipsdocs: unzips docsunzip$E: $(OBJS) $(LD) $(LF) $(LOBJS) $(LF2)unzipsfx$E: $(OBJX) $(LD) $(SL) $(LOBJX) $(SL2)funzip$E: $(OBJF) $(LD) $(FL) $(OBJF) $(FL2)crc32$O: crc32.c $(UNZIP_H) zip.hcrctab$O: crctab.c $(UNZIP_H) zip.hcrypt$O: crypt.c $(UNZIP_H) zip.h crypt.h ttyio.henvargs$O: envargs.c $(UNZIP_H)explode$O: explode.c $(UNZIP_H)extract$O: extract.c $(UNZIP_H) crypt.hfileio$O: fileio.c $(UNZIP_H) crypt.h ttyio.h ebcdic.hfunzip$O: funzip.c $(UNZIP_H) crypt.h ttyio.h tables.hglobals$O: globals.c $(UNZIP_H)inflate$O: inflate.c inflate.h $(UNZIP_H)list$O: list.c $(UNZIP_H)match$O: match.c $(UNZIP_H)process$O: process.c $(UNZIP_H)ttyio$O: ttyio.c $(UNZIP_H) zip.h crypt.h ttyio.hunreduce$O: unreduce.c $(UNZIP_H)unshrink$O: unshrink.c $(UNZIP_H)unzip$O: unzip.c $(UNZIP_H) crypt.h version.h consts.hzipinfo$O: zipinfo.c $(UNZIP_H)crypt_$O: crypt.c $(UNZIP_H) zip.h crypt.h ttyio.h # funzip only $(CP) crypt.c crypt_.c $(CC) -c $(CF) -DFUNZIP crypt_.c $(RM) crypt_.cextract_$O: extract.c $(UNZIP_H) crypt.h # unzipsfx only $(CP) extract.c extract_.c $(CC) -c $(CF) -DSFX extract_.c $(RM) extract_.cglobals_$O: globals.c $(UNZIP_H) # funzip only $(CP) globals.c globals_.c $(CC) -c $(CF) -DFUNZIP globals_.c $(RM) globals_.cinflate_$O: inflate.c inflate.h $(UNZIP_H) crypt.h # funzip only $(CP) inflate.c inflate_.c $(CC) -c $(CF) -DFUNZIP inflate_.c $(RM) inflate_.cttyio_$O: ttyio.c $(UNZIP_H) zip.h crypt.h ttyio.h # funzip only $(CP) ttyio.c ttyio_.c $(CC) -c $(CF) -DFUNZIP ttyio_.c $(RM) ttyio_.cprocess_$O: process.c $(UNZIP_H) # unzipsfx only $(CP) process.c process_.c $(CC) -c $(CF) -DSFX process_.c $(RM) process_.catari_$O: atari.c $(UNZIP_H) $(CP) atari.c atari_.c $(CC) -c $(CF) -DSFX atari_.c $(RM) atari_.cunzipsfx$O: unzip.c $(UNZIP_H) crypt.h version.h consts.h # unzipsfx only $(CP) unzip.c unzipsfx.c $(CC) -c $(CF) -DSFX unzipsfx.c $(RM) unzipsfx.c# this really only works for Unix targets, unless specify E and O on cmd lineclean: @echo "" @echo ' This is a Unix-specific target. (Just so you know.)' @echo "" rm -f $(OBJS) api$O apihelp$O unzipstb$O $(OBJF) $(OBJX) $(UNZIPS)install: $(UNZIPS) $(MANS) $(INSTALL) $(UNZIPS) $(BINDIR) $(RM) $(BINDIR)/zipinfo$E $(LN) $(BINDIR)/unzip$E $(BINDIR)/zipinfo$E $(INSTALL) unix/unzip.1 $(MANDIR)/unzip.$(manext) $(INSTALL) unix/unzipsfx.1 $(MANDIR)/unzipsfx.$(manext) $(INSTALL) unix/zipinfo.1 $(MANDIR)/zipinfo.$(manext) $(INSTALL) unix/funzip.1 $(MANDIR)/funzip.$(manext) $(CHMOD) 755 $(INSTALLEDBIN) $(CHMOD) 644 $(INSTALLEDMAN)# alternatively, could use zip method: -cd $(BINDIR); rm -f $(UNZIPS) [etc.]uninstall: rm -f $(INSTALLEDBIN) $(INSTALLEDMAN)TESTZIP = testmake.zip # the test zipfile# test some basic features of the buildtest: checkcheck: unzips @echo ' This is a Unix-specific target. (Just so you know.)' if test ! -f $(TESTZIP); then \ echo " error: can't find test file $(TESTZIP)"; exit 1; fi# echo " testing extraction" ./unzip -b $(TESTZIP) testmake.zipinfo if test $? ; then \ echo " error: file extraction from $(TESTZIP) failed"; exit 1; fi# echo ' testing zipinfo (unzip -Z)' ./unzip -Z $(TESTZIP) > testmake.unzip-Z if diff testmake.unzip-Z testmake.zipinfo; then ;; else \ echo ' error: zipinfo output doesn't match stored version'; fi $(RM) testmake.unzip-Z testmake.zipinfo# echo ' testing unzip -d exdir option' ./unzip -b $(TESTZIP) -d testun cat testun/notes# echo ' testing unzip -o and funzip (ignore funzip warning)' ./unzip -boq $(TESTZIP) notes -d testun ./funzip < $(TESTZIP) > testun/notes2 if diff testun/notes testun/notes2; then ;; else \ echo 'error: funzip output disagrees with unzip'; fi# echo ' testing unzipsfx (self-extractor)' cat unzipsfx $(TESTZIP) > testsfx $(CHMOD) 0700 testsfx ./testsfx -b notes if diff notes testun/notes; then ;; else \ echo ' error: unzipsfx file disagrees with unzip'; fi $(RM) testsfx notes testun/notes testun/notes2 rmdir testun# echo ' testing complete.'################################# INDIVIDUAL MACHINE MAKERULES ################################## these are left over for backward compatibility/conveniencegeneric: unzipsatari: unzips
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -