📄 makefile.cr
字号:
# ===========================================================================# Makefile for UnZip, ZipInfo & Ship: Unix, OS/2 and MS-DOS (MSC NMAKE only)# Version: decrypt + (conditionally) inflate# ===========================================================================### INSTRUCTIONS (such as they are):## "make vax" -- makes UnZip on a VAX 11-780 BSD 4.3 in current directory# (or a SysV VAX, or an 8600 running Ultrix, or...)# "make" -- uses environment variable SYSTEM to set the type# system to compile for. This doesn't work for some# particularly brain-damaged versions of make (VAX BSD,# Gould, and SCO Unix are in this group). If SYSTEM not# set, gives instructions on what to try instead.# "make list" -- lists all supported systems (targets), including ship# and zipinfo targets# "make wombat" -- Chokes and dies if you haven't added the specifics# for your Wombat 68000 (or whatever) to the systems list.## CFLAGS are flags for the C compiler. LDFLAGS are flags for the loader.# LDFLAGS2 are more flags for the loader, if they need to be at the end of# the line instead of at the beginning.## My host (a VAX 11-780 running BSD 4.3) is hereafter referred to as "my host."## My host's /usr/include/sys/param.h defines BSD for me. You may have to add# "-DBSD" to the list of CFLAGS for your system.## Some versions of make do not define the macro "$(MAKE)" (my host did not).# The makefile should now handle such systems correctly, more or less; the# possible exception to this is if you've used a make command-line option# (for example, the one which displays the commands which WOULD be executed,# but doesn't actually execute them). It probably needs some more tinkering.# If things still don't work, use "make" instead of "$(MAKE)" in your system's# makerule. Or try adding the following line to your .login file:# setenv MAKE "make"# (It didn't help on my host.)## memcpy and memset are provided for those systems that don't have them;# they're found in misc.c and will be used if -DZMEM is included in the list# of CFLAGS. These days ALMOST all systems have them (they're mandated by# ANSI), but older systems might be lacking. And at least ONE machine's# version results in some serious performance degradation...## SCO Unix 3.2.0: Don't use -Ox with cc (derived from Microsoft 5.1); there# is a bug in the loop optimization which causes bad CRC's. [Onno van der# Linden]## Be sure to test your nice new UnZip; successful compilation does not always# imply a working program.###################### MACRO DEFINITIONS ####################### Defaults most systems use (use LOCAL_UNZIP in environment to add flags).# To add inflation: uncomment INFL_OBJ below or add it to your environment# as appropriate, and add -DINFLATE to CFLAGS or to LOCAL_UNZIP. (This# won't work if you don't have inflate.c, so don't be a goober...)CC = ccCR = -DCRYPTCFLAGS = -O -DUNIX $(CR) $(LOCAL_UNZIP)ZC = -DZMEMLD = ccLDFLAGS = -o unzipLDFLAGS2 = -sZL = -o zipinfoZL2 = -sMV = mvEXE =O = .o#INFL_OBJ = inflate.o -or- inflate.obj (pick one)OBJS = unzip$O crypt$O extract$O file_io$O $(INFL_OBJ)\ mapname$O match$O misc$O unimplod$O unreduce$O unshrink$OOS2_OBJS = unzip.obj crypt.obj dosname.obj extract.obj file_io.obj $(INFL_OBJ)\ mapname.obj match.obj misc.obj unimplod.obj unreduce.obj unshrink.objZI_OBJS = zipinfo$O misc_$O match$OSHELL = /bin/sh# list of supported systems in this versionSYSTEMS1 = 386i 3Bx 7300 amdahl apollo aviion bsd bull coherent convexSYSTEMS2 = cray cray_cc cyber_sgi dec dnix encore eta gcc_os2 genericSYSTEMS3 = generic2 gould hk68 hp icc_os2 minix mips msc_dos msc_os2 nextSYSTEMS4 = p_iris pyramid rs6000 rtaix sco sco_dos sco_x286 sequent sgiSYSTEMS5 = stellar sun sysv tahoe ultrix vax wombatSYS_UTIL1 = ship ship_dos ship_gcc ship_icc ship_os2 ship_sysv zi_dosSYS_UTIL2 = zi_gcc zi_icc zi_os2 zipinfo ##################### DEFAULT HANDLING ###################### The below will try to use your shell variable "SYSTEM" as the type system# to use (e.g., if you type "make" with no parameters at the command line).# The test for $(MAKE) is necessary for VAX BSD make (and Gould, apparently),# as is the "goober" (else stupid makes see an "else ;" statement, which they# don't like). "goober" must then be made into a valid target for machines# which DO define MAKE properly (and have SYSTEM set). Quel kluge, non?# And to top it all off, it appears that the VAX, at least, can't pick SYSTEM# out of the environment either (which, I suppose, should not be surprising).# [Btw, if the empty "goober" target causes someone else's make to barf, just# add an "@echo > /dev/null" command (or whatever). Works OK on the Amdahl# and Crays, though.]default: @if test -z "$(MAKE)"; then\ if test -z "$(SYSTEM)";\ then make ERROR;\ else make $(SYSTEM) MAKE="make";\ fi;\ else\ if test -z "$(SYSTEM)";\ then $(MAKE) ERROR;\ else $(MAKE) $(SYSTEM) goober;\ fi;\ figoober:ERROR: @echo @echo\ " If you're not sure about the characteristics of your system, try typing" @echo\ ' "make generic". If the compiler barfs and says something unpleasant about' @echo\ ' "timezone redefined," try typing "make clean" followed by "make generic2".' @echo\ ' One of these actions should produce a working copy of unzip on most Unix' @echo\ ' systems. If you know a bit more about the machine on which you work, you' @echo\ ' might try "make list" for a list of the specific systems supported herein.' @echo\ ' And as a last resort, feel free to read the numerous comments within the' @echo\ ' Makefile itself. Have an excruciatingly pleasant day.' @echolist: @echo @echo\ 'Type "make <system>", where <system> is one of the following:' @echo @echo " $(SYSTEMS1)" @echo " $(SYSTEMS2)" @echo " $(SYSTEMS3)" @echo " $(SYSTEMS4)" @echo " $(SYSTEMS5)" @echo @echo\ 'Otherwise set the shell variable SYSTEM to one of these and just type "make".' @echo\ 'Targets for related utilities (ZipInfo and Ship) include:' @echo @echo " $(SYS_UTIL1)" @echo " $(SYS_UTIL2)" @echo @echo\ 'For further (very useful) information, please read the comments in Makefile.' @echo################################################ BASIC COMPILE INSTRUCTIONS AND DEPENDENCIES ################################################.c$O : $(CC) -c $(CFLAGS) $*.cunzip$(EXE): $(OBJS) $(LD) $(LDFLAGS) $(OBJS) $(LDFLAGS2)crypt$O: crypt.c unzip.h zip.h # may or may not be in distributiondosname.obj: dosname.c # for OS/2 onlyextract$O: extract.c unzip.hfile_io$O: file_io.c unzip.hinflate$O: inflate.c unzip.h # may or may not be in distributionmapname$O: mapname.c unzip.hmatch$O: match.c unzip.hmisc$O: misc.c unzip.hunimplod$O: unimplod.c unzip.hunreduce$O: unreduce.c unzip.hunshrink$O: unshrink.c unzip.hunzip$O: unzip.c unzip.hclean: rm -f $(OBJS) unzip$(EXE)################################# INDIVIDUAL MACHINE MAKERULES ################################## these are the makerules for various systems# TABS ARE REQUIRED FOR MANY VERSIONS OF "MAKE"!# ---------------------------------------------------------------------------# Generic targets (can't assume make utility groks "$(MAKE)")# ---------------------------------------------------------------------------generic: unzip # first try if unknowngeneric2: # second try if unknown: hope make is called "make"... make unzip CFLAGS="$(CFLAGS) -DBSD"# ---------------------------------------------------------------------------# "Normal" group (both big- and little-endian, structure-padding or not):# ---------------------------------------------------------------------------386i: unzip # sun386i, SunOS 4.0.2 ["sun:" works, too, but bigger]3Bx: unzip # AT&T 3B2/1000-80; should work on any WE32XXX machine7300: unzip # AT&T 7300 (M68000/SysV)apollo: unzip # Apollo Domain/OS machinesaviion: unzip # Data General AViiONs, DG/UX 4.3xbull: unzip # Bull DPX/2, BOS 2.00.45 (doesn't require -Xk switch)coherent: unzip # Coherent 3.10, Mark Williams Ccray_cc: unzip # Cray-2 and Y-MP, using default (possibly old) compilerdec: unzip # DEC 5820 (MIPS RISC), test version of Ultrix v4.0dnix: unzip # 680X0, DIAB dnix 5.2/5.3 (a Swedish System V clone)encore: unzip # Multimaxeta: unzip # ETA-10P*, hybrid SysV with BSD 4.3 enhancementsgould: unzip # Gould PN9000 running UTX/32 2.1Bu01hp: unzip # HP 9000 series (68020), 4.3BSD or HP-UX A.B3.10 Ver Dhp_ux: unzip # (to match zip's makefile entry)mips: unzip # MIPS M120-5(?), SysV R3 [error in sys/param.h file?]rs6000: unzip # IBM RS/6000 under AIX 3rtaix: unzip # IBM RT 6150 under AIX 2.2.1sco: unzip # Xenix/386 (tested on 2.3.1); SCO Unix 3.2.0.stellar: unzip # gs-2000sun: unzip # Sun 4/110, SunOS 4.0.3c; Sun 3 (68020), SunOS 4.0.3tahoe: unzip # tahoe (CCI Power6/32), 4.3BSDultrix: unzip # VAXen, DEC 58x0 (MIPS guts), DECstation 2100; v4.xvax: unzip # general-purpose VAX target (not counting VMS)# ---------------------------------------------------------------------------# BSD group (for timezone structs [struct timeb]):# ---------------------------------------------------------------------------bsd: _bsd # generic BSD (BSD 4.2, Ultrix handled in unzip.h)_bsd: $(MAKE) unzip CFLAGS="$(CFLAGS) -DBSD"# ---------------------------------------------------------------------------# SysV group (for extern long timezone and ioctl.h instead of sgtty.h):# ---------------------------------------------------------------------------sysv: _sysv # generic SysVamdahl: _sysv # Amdahl (IBM) mainframe, UTS (SysV) 1.2.4 and 2.0.1sgi: _sysv # Silicon Graphics Iris 4D, Irix SysV rel. 3.3.2_sysv: $(MAKE) unzip CFLAGS="$(CFLAGS) -DTERMIO"# ---------------------------------------------------------------------------# "Unique" group (require non-standard options):# ---------------------------------------------------------------------------# Enclosed you'll find a context diff for the unzip41 makefile# which enhances compilation on a convex. The previous version# probably worked great a couple of years ago, and would still do# so if one compiles in our "backward compatible" pcc mode. The# following allows it to work better in a modern convexian environment# (define __STDC__ manually because default compilation mode has# extensions and thus doesn't do so). [5 Mar 1992: -D__STDC__ removed# for now because of problems with stat.h]## $(MAKE) unzip CFLAGS="$(CFLAGS) -D__STDC__ -DCONVEX -ext" ...convex: # previous version was tested on C200/C400 $(MAKE) unzip CFLAGS="$(CFLAGS) -DCONVEX -ext"\ LDFLAGS="$(LDFLAGS) -ext"
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -