home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 9 Archive / 09-Archive.zip / unzip511.zip / unix / Makefile < prev    next >
Encoding:
Makefile  |  1994-08-01  |  24.3 KB  |  687 lines

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