home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 9 Archive / 09-Archive.zip / unzip51.zip / unix / Makefile < prev    next >
Makefile  |  1994-02-08  |  21KB  |  595 lines

  1. #==============================================================================
  2. # Makefile for UnZip, ZipInfo & fUnZip:  Unix and MS-DOS ("real" makes only)
  3. # Version:  5.1                                                 8 February 1994
  4. #==============================================================================
  5.  
  6.  
  7. # INSTRUCTIONS (such as they are):
  8. #
  9. # "make vax"    -- makes UnZip on a generic Unix VAX in the current directory
  10. # "make list"    -- lists all supported systems (targets)
  11. # "make help"    -- provides pointers on what targets to try if problems occur
  12. # "make wombat" -- chokes and dies if you haven't added the specifics for your
  13. #            Wombat 68000 (or whatever) to the systems list
  14. #
  15. # CF are flags for the C compiler.  LF are flags for the loader.  LF2 are more
  16. # flags for the loader, if they need to be at the end of the line instead of at
  17. # the beginning (for example, some libraries).  FC, FL and FL2 are the corre-
  18. # sponding flags for fUnZip.  LOCAL_UNZIP is an environment variable that can
  19. # be used to add default C flags to your compile without editing the Makefile
  20. # (e.g., -DDEBUG_STRUC, or -FPi87 on PCs using Microsoft C).
  21. #
  22. # Some versions of make do not define the macro "$(MAKE)"; this is rare, but
  23. # if things don't work, try using "make" instead of "$(MAKE)" in your system's
  24. # makerule.  Or try adding the following line to your .login file:
  25. #    setenv MAKE "make"
  26. # (That never works--makes which are too stupid to define MAKE are also too
  27. # stupid to look in the environment--but try it anyway for kicks. :-) )
  28. #
  29. # Memcpy and memset are provided for those systems that don't have them; they
  30. # are in file_io.c and will be used if -DZMEM is included in CF.  These days
  31. # almost all systems have them.
  32. #
  33. # Be sure to test your new UnZip (and ZipInfo and fUnZip); successful compila-
  34. # tion does not always imply a working program.
  35.  
  36.  
  37. #####################
  38. # MACRO DEFINITIONS #
  39. #####################
  40.  
  41. # Defaults most systems use (use LOCAL_UNZIP in environment to add flags, 
  42. # such as -DDOSWILD).
  43.  
  44. # UnZip flags
  45. CC = cc#    try using "gcc" target rather than changing this (if you do,
  46. LD = $(CC)#    you MUST change LD, too--else "unresolved symbol:  ___main")
  47. LOC = $(LOCAL_UNZIP)
  48. CF = -O -I. $(LOC)
  49. LF = -o unzip
  50. LF2 = -s
  51.  
  52. # fUnZip flags
  53. FC = -DFUNZIP
  54. FL = -o funzip
  55. FL2 = $(LF2)
  56.  
  57. # general-purpose stuff
  58. CP = cp
  59. LN = ln
  60. RM = rm -f
  61. E =
  62. O = .o
  63. M = unix
  64. SHELL = /bin/sh
  65.  
  66. # object files
  67. OBJS1 = unzip$O crypt$O envargs$O explode$O extract$O file_io$O
  68. OBJS2 = inflate$O match$O unreduce$O unshrink$O zipinfo$O
  69. OBJS = $(OBJS1) $(OBJS2) $M$O
  70. LOBJS = $(OBJS)
  71. OBJF = funzip$O crypt_$O inflate_$O
  72. #OBJS_OS2 = $(OBJS1:.o=.obj) $(OBJS2:.o=.obj) os2.obj
  73. #OBJF_OS2 = $(OBJF:.o=.obj)
  74.  
  75. # installation
  76. INSTALL = cp#    probably can change this to 'install' if you have it
  77. # on some systems, manext=l and MANDIR=/usr/man/man$(manext) may be appropriate
  78. manext = 1
  79. MANDIR = /usr/local/man/man$(manext)#    where to install man pages
  80. BINDIR = /usr/local/bin#        where to install executables
  81. #
  82. UNZIPS = unzip$E funzip$E
  83. MANS = unzip.$(manext) zipinfo.$(manext) funzip.$(manext)
  84. DOCS = unzip.doc zipinfo.doc funzip.doc
  85. # this is a little ugly...
  86. INSTALLED = $(BINDIR)/unzip$E $(BINDIR)/zipinfo$E $(BINDIR)/funzip$E \
  87.     $(MANDIR)/unzip.$(manext) $(MANDIR)/zipinfo.$(manext) \
  88.     $(MANDIR)/funzip.$(manext)
  89.  
  90. # list of supported systems/targets in this version
  91. SYSTEMS1 = 386i 3Bx 7300 7300_gcc aix amdahl amdahl_eft apollo aviion
  92. SYSTEMS2 = bcc_dos bsd bsd386 bull coherent convex cray cray_scc cray_v3
  93. SYSTEMS3 = cyber_sgi dec dnix encore eta gcc gcc_dos generic generic2
  94. SYSTEMS4 = gould hk68 hp hpux linux minix mips msc_dos next next10
  95. SYSTEMS5 = next2x next3x nextfat osf1 pixel ptx pyramid rs6000 sco
  96. SYSTEMS6 = sco_dos sco_sl sco_x286 sequent sgi stellar sun sysv
  97. SYSTEMS7 = sysv_gcc sysv6300 tahoe ultrix vax v7 wombat xenix xos
  98.  
  99. ####################
  100. # DEFAULT HANDLING #
  101. ####################
  102.  
  103. # By default, print help on which makefile targets to try.  (The SYSTEM
  104. # variable is no longer supported; use "make <target>" instead.)
  105.  
  106. help:
  107.     @echo ""
  108.     @echo\
  109.  "  If you're not sure about the characteristics of your system, try typing"
  110.     @echo\
  111.  '  "make generic".  If the compiler barfs and says something unpleasant about'
  112.     @echo\
  113.  '  "timezone redefined," try typing "make clean" followed by "make generic2".'
  114.     @echo\
  115.  '  One of these actions should produce a working copy of unzip on most Unix'
  116.     @echo\
  117.  '  systems.  If you know a bit more about the machine on which you work, you'
  118.     @echo\
  119.  '  might try "make list" for a list of the specific systems supported herein.'
  120.     @echo\
  121.  "  (Many of them do exactly the same thing, so don't agonize too much over"
  122.     @echo\
  123.  '  which to pick if two or more sound equally likely.)  As a last resort, feel'
  124.     @echo\
  125.  '  feel free to read the numerous comments within the Makefile itself.  Note'
  126.     @echo\
  127.  '  that to compile the decryption version of UnZip, you must obtain the full'
  128.     @echo\
  129.  '  versions of crypt.c and crypt.h (see the "Where" file for ftp and mail-'
  130.     @echo\
  131.  '  server sites).  Have a generally tolerable day.'
  132.     @echo ""
  133.  
  134. list:
  135.     @echo ""
  136.     @echo\
  137.  'Type "make <system>", where <system> is one of the following:'
  138.     @echo ""
  139.     @echo  "    $(SYSTEMS1)"
  140.     @echo  "    $(SYSTEMS2)"
  141.     @echo  "    $(SYSTEMS3)"
  142.     @echo  "    $(SYSTEMS4)"
  143.     @echo  "    $(SYSTEMS5)"
  144.     @echo  "    $(SYSTEMS6)"
  145.     @echo  "    $(SYSTEMS7)"
  146.     @echo ""
  147.     @echo\
  148.  'Otherwise set the shell variable SYSTEM to one of these and just type "make".'
  149. #    @echo\
  150. # 'Targets for related utilities (ZipInfo and fUnZip) include:'
  151. #    @echo ""
  152. #    @echo  "    $(SYS_UTIL1)"
  153. #    @echo  "    $(SYS_UTIL2)"
  154.     @echo ""
  155.     @echo\
  156.  'For further (very useful) information, please read the comments in Makefile.'
  157.     @echo ""
  158.  
  159. generic_msg:
  160.     @echo ""
  161.     @echo\
  162.  '  Attempting "make generic" now.  If this fails for some reason, type'
  163.     @echo\
  164.  '  "make help" and/or "make list" for suggestions.'
  165.     @echo ""
  166.  
  167.  
  168. ###############################################
  169. # BASIC COMPILE INSTRUCTIONS AND DEPENDENCIES #
  170. ###############################################
  171.  
  172. # this is for GNU make; comment out and notify zip-bugs if it causes errors
  173. .SUFFIXES:    .c $O
  174.  
  175. .c$O:
  176.     $(CC) -c $(CF) $*.c
  177.  
  178. .1.doc:
  179.     nroff -Tman -man $< | col -b | uniq | \
  180.      sed 's/Sun Release ..../Info-ZIP        /' > $@
  181.  
  182.  
  183. all:        generic_msg generic
  184. unzips:        $(UNZIPS)
  185. docs:        $(DOCS)
  186. unzipsman:    unzips docs
  187. unzipsdocs:    unzips docs
  188.  
  189.  
  190. clean:
  191.     rm -f $(OBJS) $(OBJF) unzip$E funzip$E zipinfo$E
  192.  
  193. install:    $(UNZIPS) $(MANS)
  194.     $(INSTALL) $(UNZIPS) $(BINDIR)
  195.     $(LN) $(BINDIR)/unzip$E $(BINDIR)/zipinfo$E
  196.     $(INSTALL) unzip.1 $(MANDIR)/unzip.$(manext)
  197.     $(INSTALL) zipinfo.1 $(MANDIR)/zipinfo.$(manext)
  198.     $(INSTALL) funzip.1 $(MANDIR)/funzip.$(manext)
  199.  
  200. # alternatively, could use zip method:  -cd $(BINDIR); rm -f $(UNZIPS)  [etc.]
  201. uninstall:
  202.     rm -f $(INSTALLED)
  203.  
  204.  
  205. # EDIT HERE FOR PARALLEL MAKES on Sequent (and others?)--screws up MS-DOS
  206. # make utilities if default:  change "unzip$E:" to "unzip$E:&"
  207.  
  208. unzip$E:    $(OBJS)            # add `&' for parallel makes
  209.     $(LD) $(LF) $(LOBJS) $(LF2)
  210.  
  211. funzip$E:    $(OBJF)            # add `&' for parallel makes
  212.     $(LD) $(FL) $(OBJF) $(FL2)
  213.  
  214. zipinfo$E:    unzip$E
  215.     @echo\
  216.  '  This is a Unix-specific target.  ZipInfo is not enabled in some MS-DOS'
  217.     @echo\
  218.  '  versions of UnZip; if it is in yours, copy unzip.exe to zipinfo.exe'
  219.     @echo\
  220.  '  or else invoke as "unzip -Z" (in a batch file, for example).'
  221.     $(LN) unzip$E zipinfo$E
  222.  
  223.  
  224. crypt$O:    crypt.c unzip.h zip.h crypt.h
  225. envargs$O:    envargs.c unzip.h
  226. explode$O:    explode.c unzip.h
  227. extract$O:    extract.c unzip.h crypt.h
  228. file_io$O:    file_io.c unzip.h crypt.h tables.h
  229. funzip$O:    funzip.c unzip.h crypt.h tables.h
  230. inflate$O:    inflate.c inflate.h unzip.h
  231. match$O:    match.c unzip.h
  232. unreduce$O:    unreduce.c unzip.h
  233. unshrink$O:    unshrink.c unzip.h
  234. unzip$O:    unzip.c unzip.h
  235. zipinfo$O:    zipinfo.c unzip.h
  236.  
  237. crypt_$O:    crypt.c unzip.h zip.h crypt.h        # funzip only
  238.     $(CP) crypt.c crypt_.c
  239.     $(CC) -c $(CF) $(FC) crypt_.c
  240.     $(RM) crypt_.c
  241.  
  242. inflate_$O:    inflate.c inflate.h unzip.h crypt.h    # funzip only
  243.     $(CP) inflate.c inflate_.c
  244.     $(CC) -c $(CF) $(FC) inflate_.c
  245.     $(RM) inflate_.c
  246.  
  247. msdos$O:    msdos/msdos.c unzip.h            # MS-DOS only
  248.     $(CC) -c $(CF) msdos/msdos.c
  249.  
  250. #os2$O:        os2/os2.c unzip.h            # OS/2 only
  251. #    $(CC) -c $(CF) os2/os2.c
  252.  
  253. #os2/os2_$O:    os2/os2.c unzip.h            # OS/2 only
  254. #    $(CP) os2/os2.c os2/os2_.c
  255. #    $(CC) -c $(CF) $(ZC) os2/os2_.c
  256. #    $(RM) os2/os2_.c
  257.  
  258. unix$O:        unix/unix.c unzip.h            # Unix only
  259.     $(CC) -c $(CF) unix/unix.c
  260.  
  261. unix_make:
  262. #    @echo\
  263. # '(Ignore any errors from `make'"' due to the following command; it's harmless.)"
  264.     -@2>&1 $(LN) unix/Makefile . > /dev/null || echo > /dev/null
  265.  
  266.  
  267. ################################
  268. # INDIVIDUAL MACHINE MAKERULES #
  269. ################################
  270.  
  271. #####   TABS ARE REQUIRED FOR MANY VERSIONS OF "MAKE"!   #####
  272.  
  273.  
  274. #----------------------------------------------------------------------------
  275. #  Generic targets (can't assume make utility groks "$(MAKE)")
  276. #----------------------------------------------------------------------------
  277.  
  278. generic:    unzips       # first try if unknown
  279.  
  280. generic2:    unix_make  # second try if unknown:  hope make is called "make"
  281.     make unzips CF="$(CF) -DBSD"
  282.  
  283. #----------------------------------------------------------------------------
  284. #  "Normal" group (both big- and little-endian, structure-padding or not):
  285. #----------------------------------------------------------------------------
  286.  
  287. 386i:        unzips    # sun386i, SunOS 4.0.2
  288. 3Bx:        unzips    # AT&T 3B2/1000-80; should work on any WE32XXX machine
  289. aix:        unzips    # IBM RT 6150 under AIX 2.2.1; all AIX?
  290. apollo:        unzips    # Apollo Domain/OS machines
  291. bull:        unzips    # Bull DPX/2, BOS 2.00.45 (doesn't require -Xk switch)
  292. coherent:    unzips    # Coherent 3.x/4.x, Mark Williams C
  293. convex:        unzips    # Convex C-120 and C-210 (-O is enough; -ext is default)
  294. cray:        unzips    # Cray-2 and Y-MP, using default (possibly old) compiler
  295. dec:        unzips    # DEC 5820 (MIPS RISC), test version of Ultrix v4.0
  296. encore:        unzips    # Multimax
  297. eta:        unzips    # ETA-10P*, hybrid SysV with BSD 4.3 enhancements
  298. gould:        unzips    # Gould PN9000 running UTX/32 2.1Bu01
  299. hp:        unzips    # HP 9000 series (68020), 4.3BSD or HP-UX A.B3.10 Ver D
  300. hpux:        unzips    # (to match zip's makefile entry)
  301. mips:        unzips    # MIPS M120-5(?), SysV.3 [error in sys/param.h file?]
  302. next10:        unzips    # NeXT (generic; use next2x or next3x for better opt.)
  303. pyr_:        unzips    # [failsafe target for pyramid target below]
  304. pyr_ucb:    unzips    # Pyramids running BSD universe by default (see below)
  305. sco:        unzips    # Xenix/386 (tested on 2.3.1); SCO Unix 3.2.0.
  306. stellar:    unzips    # gs-2000
  307. sun:        unzips    # Sun 3, 4; SunOS 4.x (SOME SYSTEMS ARE SYSTEM V!)
  308. tahoe:        unzips    # tahoe (CCI Power6/32), 4.3BSD
  309. ultrix:        unzips    # VAXen, DEC 58x0 (MIPS guts), DECstation 2100; v4.x
  310. vax:        unzips    # general-purpose VAX target (not counting VMS)
  311. xenix:        unzips    # Xenix/386 (tested on 2.3.1); SCO Unix 3.2.0.
  312.  
  313. #----------------------------------------------------------------------------
  314. #  BSD group (for timezone structs [struct timeb]):
  315. #----------------------------------------------------------------------------
  316.  
  317. bsd:        _bsd    # generic BSD (BSD 4.2 & Ultrix handled in unzip.h)
  318. bsd386:        _bsd    # BSDI BSD/386 version 1.0
  319.  
  320. _bsd:        unix_make
  321.     $(MAKE) unzips CF="$(CF) -DBSD"
  322.  
  323. #----------------------------------------------------------------------------
  324. #  SysV group (for extern long timezone and ioctl.h instead of sgtty.h):
  325. #----------------------------------------------------------------------------
  326.  
  327. amdahl:        _sysv    # Amdahl (IBM) mainframe, UTS (SysV) 1.2.4 and 2.0.1
  328. aviion:        _sysv    # Data General AViiONs, DG/UX 4.3x
  329. pyr_att:    _sysv    # Pyramids running AT&T (SysV) universe by default
  330. sgi:        _sysv    # Silicon Graphics Iris 4D, Irix (SysV) 3.3.2, 4.0.x
  331. sysv:        _sysv    # generic System V Unix (Xenix handled in unzip.h)
  332. xos:        _sysv    # Olivetti LSX-3005..3045, X/OS 2.3 and 2.4
  333.  
  334. _sysv:        unix_make
  335.     $(MAKE) unzips CF="$(CF) -DSYSV"
  336.  
  337. #----------------------------------------------------------------------------
  338. #  Version 7 group (old/obsolescent):
  339. #----------------------------------------------------------------------------
  340.  
  341. pixel:        _v7    # Pixel 80, 100 (68000-based, V7/mostly BSD4.1 compat.)
  342. v7:        _v7    # generic Unix Version 7 box (prob. only Pixel...)
  343.  
  344. _v7:
  345.     make unzips CF="$(CF) -DV7 -DNO_PARAM_H -DSHORT_NAMES -DBSD -DZMEM"
  346.  
  347. #----------------------------------------------------------------------------
  348. #  "Unique" group (require non-standard options):
  349. #----------------------------------------------------------------------------
  350.  
  351. # AT&T 7300 (M68000/SysV.3) (add -DSYSV? -DNO_LIMITS?)
  352. 7300:        unix_make
  353.     $(MAKE) unzips CF="$(CF) -DNO_DIR -DNO_MKDIR -DNO_STRNICMP"
  354.  
  355. 7300_gcc:    unix_make
  356.     $(MAKE) unzips CC=gcc LD=gcc LF2="" \
  357.      CF="-O2 -I. -DNO_DIR -DNO_MKDIR -DNO_STDLIB_H -DNO_STRNICMP $(LOC)"
  358.     strip $(UNZIPS)
  359.  
  360. # Amdahl UTS 2.1.4 with "extended file types" filesystem (aarrrggghhhh...)
  361. amdahl_eft:    unix_make
  362.     $(MAKE) unzips CF="$(CF) -eft -DSYSV"
  363.  
  364. # MS-DOS:  Borland C++ 3.0 (can change UnZip memory model to small for more
  365. # speed but no ZipInfo support [-ml -> -ms in _bcc_dos], but may run out of
  366. # memory when inflating
  367. bcc_dos:    _bcc_dos fu_bcc
  368.  
  369. _bcc_dos:    bcc_rsp
  370.     $(MAKE) unzip.exe CF="-w -ml -O2 -I. $(LOC)" CC=bcc LD=bcc E=.exe\
  371.      O=.obj M=msdos LOBJS="" LF="@bcc_rsp" LF2=""
  372.     del bcc_rsp
  373.  
  374. bcc_rsp:
  375.     echo $(OBJS1:.o=.obj) > bcc_rsp
  376.     echo msdos.obj $(OBJS2:.o=.obj) >> bcc_rsp
  377.  
  378. fu_bcc:
  379.     $(MAKE) funzip.exe CF="-w -ms -O2 -I. $(LOC)" CC=bcc LD=bcc E=.exe\
  380.      O=.obj FL="" FL2="" CP=copy RM=del
  381.  
  382. # Cray-2 and Y-MP, running Unicos 5.1 to 6.1 (SysV + BSD enhancements)
  383. # and Standard (ANSI) C compiler 1.5, 2.0 or 3.0.
  384. cray_scc:    unix_make
  385.     $(MAKE) unzips CC=scc LD=scc
  386.  
  387. # Ditto, for Cray Standard C 3.0 or later.
  388. cray_v3:    unix_make
  389.     $(MAKE) unzips CC="scc" LD="scc" CF="$(CF) -h scalar3 -h vector3"
  390.  
  391. # The unzip41 build on a Cyber 910/SGI running Irix v3.3.3 was successful
  392. # with the following change to Makefile:
  393. cyber_sgi:    unix_make
  394.     $(MAKE) unzips CF="$(CF) -I/usr/include/bsd"\
  395.      LF="-lbsd $(LF)"
  396.  
  397. # 680x0, DIAB dnix 5.2/5.3 (a Swedish System V clone)
  398. #
  399. # Options for the dnix cc:
  400. #  -X7 = cc is strict ANSI C
  401. #  -X9 = warnings if a function is used without a declaration
  402. #
  403. dnix:        unix_make
  404.     $(MAKE) unzips CF="$(CF) -X7 -X9 -DDNIX"
  405.  
  406. # Generic BSDish Unix gcc.  ``The -O2 only works with the latest version of
  407. # gcc; you may have to use -O only for earlier versions.  I have no idea why
  408. # -s causes this bug in gcc.''  [Bug:  "nm: unzip: no name list", "collect:
  409. # /usr/bin/nm returned 1 exit status".]  If you don't have strip, don't
  410. # worry about it (it just makes the executable smaller).
  411. #
  412. gcc:        unix_make
  413.     $(MAKE) unzips CC=gcc LD=gcc CF="-O2 -I. $(LOC)" LF2=""
  414.     strip $(UNZIPS)
  415.  
  416. # MS-DOS with D.J. Delorie's djgpp 1.11.  Note that go32 doesn't support
  417. # DOS function 0x38, so the default date format is used with the -v option.
  418. #
  419. gcc_dos: _gcc_dos fu_gcc
  420.  
  421. _gcc_dos: gcc_rsp
  422.     $(MAKE) unzip CC=gcc LD=gcc M=msdos CF="-O2 -Wall -I. $(LOC)" CP=copy\
  423.      RM=del LOBJS="" LF="-o unzip @gcc_rsp" LF2=""
  424.     aout2exe unzip
  425.     del gcc_rsp
  426.     del unzip
  427.  
  428. gcc_rsp:
  429.     echo $(OBJS1) > gcc_rsp
  430.     echo msdos.o $(OBJS2) >> gcc_rsp
  431.  
  432. fu_gcc:
  433.     $(MAKE) funzip CF="-Wall -O2 -I. $(LOC)" CC=gcc LD=gcc FL2="" CP=copy\
  434.      RM=del
  435.     aout2exe funzip
  436.     del funzip
  437.  
  438. # Heurikon HK68 (68010), UniPlus+ System V 5.0, Green Hills C-68000
  439. hk68:        unix_make
  440.     $(MAKE) unzips CC="gcc" LD="gcc" LF="-n $(LF)" \
  441.      CF="-ga -X138 -I. $(LOC) -Dlocaltime=localti -Dtimezone=timezon"
  442.  
  443. # Rules needed to build the unzip program for an SGI Iris Indigo running
  444. # Irix Version 4.0.1
  445. #indigo:
  446. #    $(MAKE) unzips CF="-cckr $(CF) -DSYSV $(LOC)"
  447.  
  448. # Linux pre-0.96 + gcc 2.1; also 0.99.13 + gcc 2.4.5.  Linux is Posix
  449. # (almost SysV but not quite).  [apparently don't need -DSHORT_NAMES]
  450. linux:        unix_make
  451.     $(MAKE) unzips CC=gcc LD=gcc
  452. #    $(MAKE) unzips CF="$(CF) -DLINUX" CC=gcc LD=gcc  (linux pre-defined?)
  453.  
  454. # Minix 1.5 PC for the 386.  Invoke as is to use default cc, or as "make
  455. # minix CC=gcc" to use gcc.  Try "make linux" if you have a working termios.h.
  456. minix:        unix_make
  457.     $(MAKE) unzips CF="$(CF) -DMINIX -DSHORT_NAMES" CC=$(CC) LD=$(CC)
  458.  
  459. # MS-DOS:  Microsoft C 6.0 and NMAKE.  "nmake msc_dos" works fine, aside from
  460. # an irrelevant message (possibly) about the creation of a temporary file.
  461. # Environment variable LOCAL_UNZIP should be set via "SET LOCAL_UNZIP=-FPi87"
  462. # if you use the 80x87 library; also add -G2 or -G3 if using a 286/386/486.
  463. # With VC++ Pro, -O2 instead of -Oait seems to work OK and makes the
  464. # executables slightly faster. Use at your own risk.
  465. #
  466. msc_dos:    _msc_dos fu_msc
  467.  
  468. # can change UnZip memory model (-AL) to small (-AS) to disable ZipInfo
  469. # mode in favor of speed, but may still run out of memory...
  470. _msc_dos:    msc_rsp
  471.     $(MAKE) unzip.exe CF="-AL -W3 -Oait -Gs -nologo -I. $(LOC)" CC=cl\
  472.      LD=link E=.exe O=.obj M=msdos LOBJS="" LF="@msc_rsp" LF2=""
  473.     del msc_rsp
  474.  
  475. msc_rsp:
  476.     echo $(OBJS1:.o=.obj) + > msc_rsp
  477.     echo msdos.obj $(OBJS2:.o=.obj)/noi/e/st:0x0c00; >> msc_rsp
  478.  
  479. fu_msc:        # (probably over 128-char limit)
  480.     $(MAKE) funzip.exe CF="-AS -Oait -Gs -nologo -I. $(LOC)" CC=cl LD=link\
  481.      E=.exe O=.obj FL="/noi/nol/e" FL2=",funzip;" RM=del CP=copy
  482.  
  483. # $(NOD):  intended to be used as   SET NOD=-link /nod:slibcep   to allow the
  484. #          use of default library names (slibce.lib) instead of protected-mode
  485. #          names (slibcep.lib), but it fails:  MSC adds its own /nod qualifier,
  486. #          and there seems to be no way to override this.  Typical...
  487. #
  488. #    THIS TARGET RETAINED AS AN EXAMPLE ONLY.  USE MAKEFILE.OS2.
  489. #
  490. #msc_os2:        # 16-bit OS/2 (1.x) with MSC 6.00 (use makefile.os2)
  491. #    $(MAKE) -nologo unzips CC=cl LD=cl E=.exe O=.obj\
  492. #     OBJS="$(OBJS_OS2)" OBJZ="$(OBJZ_OS2)"\
  493. #     CF="-nologo -AC -Ocegit -G2s -DOS2 -DMSC $(LOC)"\
  494. #     LF="-nologo -AC $(LOC) -Lp -F 2000"\
  495. #     LF2="unzip.def -o unzip.exe $(NOD)" CP=copy RM=del\
  496. #     ZL="-nologo -AC $(LOC) -Lp -Fb" ZL2="zipinfo.def -o zipinfo.exe"
  497.  
  498. # NeXT info.
  499. next:
  500.     @echo
  501.     @echo\
  502.  '  Please pick a specific NeXT target:  "make next10" will create a generic'
  503.     @echo\
  504.  '  NeXT executable; "make next2x" will create a smaller executable (for'
  505.     @echo\
  506.  '  NeXTstep 2.0 and higher); "make next3x" will create a small executable'
  507.     @echo\
  508.  '  with significantly better optimization (NeXTstep 3.0 and higher only);'
  509.     @echo\
  510.  '  "make nextfat" will create a fat, multi-architecture (NeXT plus Intel)'
  511.     @echo\
  512.  '  executable (NeXTstep 3.1 and higher only).'
  513.     @echo
  514.  
  515. # 68030 BSD 4.3+Mach.  NeXT 2.x: make the executable smaller.
  516. next2x:        unix_make
  517.     $(MAKE) unzips LF2="-object -s"
  518.  
  519. # NeXT 3.x: as above, plus better optimization.
  520. next3x:        unix_make
  521.     $(MAKE) unzips CF="-O2 -I. $(LOC)" LF2="-object -s"
  522.  
  523. # NeXT 3.1+: make the executable fat (multi-architecture binary [MAB],
  524. # for "black" [NeXT] and "white" [x86] hardware, so far).
  525. nextfat:    unix_make
  526.     $(MAKE) unzips CF="-O2 -I. $(LOC) -arch i386 -arch m68k" \
  527.      LF2="-arch i386 -arch m68k -object -s"
  528.  
  529. # DecStation (including Alpha-based) running DEC OSF/1 v1.x; hasn't got
  530. # ftime(3) in the standard C library.  (GRR:  use _sysv target instead?)
  531. osf1:        unix_make
  532.     $(MAKE) unzips CF="$(CF) -D_BSD" LF2="$(LF2) -lbsd"
  533.  
  534. # I successfully compiled and tested the unzip program (v30) for the
  535. # Silicon Graphics environment (Personal Iris 4D20/G with IRIX v3.2.2)
  536. #p_iris:
  537. #    $(MAKE) unzips CF="$(CF) -I/usr/include/bsd -DBSD"\
  538. #     LF="-lbsd $(LF)"
  539.  
  540. # Sequent Symmetry running Dynix/ptx (sort of SysV.3):  needs to link
  541. # with libseq to get symlink().
  542. ptx:        unix_make
  543.     $(MAKE) unzips CF="$(CF) -DSYSV -DTERMIO" LF2="$(LF2) -lseq"
  544.  
  545. # Pyramid 90X (probably all) under >= OSx4.1, either universe.  (This is an
  546. # experimental target!  If it fails, use either pyr_ucb or pyr_att instead.)
  547. # The make in the BSD half is too stupid to understand $(MAKE), sigh...
  548. pyramid:    unix_make
  549.     -make pyr_`universe`
  550.  
  551. # IBM RS/6000 under AIX 3.2
  552. rs6000:        unix_make
  553.     $(MAKE) unzips CF="$(CF) -DBSD -D_BSD -DUNIX" LF="-lbsd $(LF)"
  554.  
  555. # SCO cross compile from Unix to DOS. Tested with Xenix/386 and OpenDeskTop.
  556. # Should work with Xenix/286 as well. (davidsen)  Note that you *must* remove
  557. # the Unix objects and executable before doing this!  (Piet Plomp:  gcc won't
  558. # recognize the -M0 flag which forces 8086 code.)  (GRR:  may need to reduce
  559. # stack to 0c00h if using 286/small-model code...?)
  560. sco_dos:    unix_make
  561.     $(MAKE) unzips CF="-O -I. $(LOC) -DNO_ERRNO -dos -M0" M=msdos\
  562.      LF="-dos -F 2000" LF2="-o unzip.exe" FL="-dos" FL2="-o funzip.exe"
  563.  
  564. # SCO UNIX with shared libraries and no international support.  If you are
  565. # not using a USA-style keyboard and display, you may want to remove -nointl
  566. # to get support.  It adds quite a bit to the size of the executable.
  567. sco_sl:        unix_make
  568.     $(MAKE) unzips LF="$(LF) -nointl" LF2="$(LF2) -lc_s"
  569.  
  570. # SCO Xenix/286 2.3.3 with 2.2.1 development system
  571. sco_x286:    unix_make
  572.     $(MAKE) unzips CF="$(CF) -Mel2 -LARGE -DTERMIO" LF="$(LF) -Mel2 -LARGE"
  573.  
  574. # Sequent Symmetry with Dynix.  (386, but needs -DZMEM)
  575. # This should also work on Balance but I can't test it just yet.
  576. sequent:    unix_make
  577.     $(MAKE) unzips CF="$(CF) -DBSD -DZMEM"
  578.  
  579. # Generic System V + GNU C
  580. sysv_gcc:    unix_make
  581.     $(MAKE) unzips CC=gcc LD=gcc CF="-O2 -I. -DSYSV $(LOC)" LF2=""
  582.     strip $(UNZIPS)
  583.  
  584. # AT&T 6300+, System V.2 Unix:  run-time out-of-memory error if don't use -Ml;
  585. # also compile-time error if work arrays dimensioned at HSIZE+2 (>32K)
  586. sysv6300:    unix_make
  587.     $(MAKE) unzips CF="$(CF) -Ml -DSYSV" LF="$(LF) -Ml" FL="$(FL) -Ml"
  588.  
  589. # Wombat 68000 (or whatever).
  590. # I didn't do this.  I swear.  No, really.
  591. wombat:        unix_make
  592.     @echo
  593.     @echo  '    Ha ha!  Just kidding.'
  594.     @echo
  595.