home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 9 Archive / 09-Archive.zip / unzip512.zip / unix / Makefile < prev    next >
Makefile  |  1994-08-25  |  27KB  |  737 lines

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