Subversion Repositories Kolibri OS

Rev

Blame | Last modification | View Log | Download | RSS feed

  1. #==============================================================================
  2. # Makefile for UnZip, UnZipSFX and fUnZip:  Unix and MS-DOS ("real" makes only)
  3. # Version:  6.0                                                     18 Jan 2009
  4. #==============================================================================
  5.  
  6.  
  7. # INSTRUCTIONS (such as they are):
  8. #
  9. # "make sunos"  -- makes UnZip in current directory on a generic SunOS 4.x Sun
  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 that 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 fileio.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 (CC and LD
  46. LD = $(CC)#     must match, else "unresolved symbol:  ___main" is possible)
  47. AS = as
  48. LOC = $(D_USE_BZ2) $(LOCAL_UNZIP)
  49. AF = $(LOC)
  50. CFLAGS = -O
  51. CF_NOOPT = -I. -I$(IZ_BZIP2) -DUNIX $(LOC)
  52. CF = $(CFLAGS) $(CF_NOOPT)
  53. LFLAGS1 =
  54. LF = -o unzip$E $(LFLAGS1)
  55. LF2 = -s
  56.  
  57. # UnZipSFX flags
  58. SL = -o unzipsfx$E $(LFLAGS1)
  59. SL2 = $(LF2)
  60.  
  61. # fUnZip flags
  62. FL = -o funzip$E $(LFLAGS1)
  63. FL2 = $(LF2)
  64.  
  65. # general-purpose stuff
  66. #CP = cp
  67. CP = ln
  68. LN = ln
  69. RM = rm -f
  70. CHMOD = chmod
  71. BINPERMS = 755
  72. MANPERMS = 644
  73. STRIP = strip
  74. E =
  75. O = .o
  76. M = unix
  77. SHELL = /bin/sh
  78. MAKEF = -f unix/Makefile
  79.  
  80. # Version info for unix/unix.c
  81. HOST_VERSINFO=-DIZ_CC_NAME='\"\$$(CC) \"' -DIZ_OS_NAME='\"`uname -a`\"'
  82.  
  83. # defaults for crc32 stuff and system dependent headers
  84. CRCA_O =
  85. OSDEP_H = unix/unxcfg.h
  86. # default for dependency on auto-configure result, is an empty symbol
  87. # so that the static non-autoconfigure targets continue to work
  88. ACONF_DEP =
  89.  
  90. # optional inclusion of bzip2 decompression
  91. IZ_OUR_BZIP2_DIR = bzip2
  92. IZ_BZIP2 = $(IZ_OUR_BZIP2_DIR)
  93. ## The following symbols definitions need to be set to activate bzip2 support:
  94. #D_USE_BZ2 = -DUSE_BZIP2
  95. #L_BZ2 = -lbz2
  96. #LIBBZ2 = $(IZ_BZIP2)/libbz2.a
  97.  
  98. # defaults for unzip's "built-in" bzip2 library compilation
  99. CC_BZ = $(CC)
  100. CFLAGS_BZ = $(CFLAGS)
  101.  
  102. # object files
  103. OBJS1 = unzip$O crc32$O $(CRCA_O) crypt$O envargs$O explode$O
  104. OBJS2 = extract$O fileio$O globals$O inflate$O list$O match$O
  105. OBJS3 = process$O ttyio$O ubz2err$O unreduce$O unshrink$O zipinfo$O
  106. OBJS = $(OBJS1) $(OBJS2) $(OBJS3) $M$O
  107. LOBJS = $(OBJS)
  108. OBJSDLL = $(OBJS:.o=.pic.o) api.pic.o
  109. OBJX = unzipsfx$O crc32_$O $(CRCA_O) crypt_$O extract_$O fileio_$O \
  110.         globals_$O inflate_$O match_$O process_$O ttyio_$O ubz2err_$O $M_$O
  111. LOBJX = $(OBJX)
  112. OBJF = funzip$O crc32$O $(CRCA_O) cryptf$O globalsf$O inflatef$O ttyiof$O
  113. #OBJS_OS2 = $(OBJS1:.o=.obj) $(OBJS2:.o=.obj) os2.obj
  114. #OBJF_OS2 = $(OBJF:.o=.obj)
  115. UNZIP_H = unzip.h unzpriv.h globals.h $(OSDEP_H) $(ACONF_DEP)
  116.  
  117. # installation
  118. # (probably can change next two to `install' and `install -d' if you have it)
  119. INSTALL = cp
  120. INSTALL_PROGRAM = $(INSTALL)
  121. INSTALL_D = mkdir -p
  122. # on some systems, manext=l and MANDIR=/usr/man/man$(manext) may be appropriate
  123. manext = 1
  124. prefix = /usr/local
  125. BINDIR = $(prefix)/bin#                 where to install executables
  126. MANDIR = $(prefix)/man/man$(manext)#    where to install man pages
  127. INSTALLEDBIN = $(BINDIR)/funzip$E $(BINDIR)/unzip$E $(BINDIR)/unzipsfx$E \
  128.         $(BINDIR)/zipgrep$E $(BINDIR)/zipinfo$E
  129. INSTALLEDMAN = $(MANDIR)/funzip.$(manext) $(MANDIR)/unzip.$(manext) \
  130.         $(MANDIR)/unzipsfx.$(manext) $(MANDIR)/zipgrep.$(manext) \
  131.         $(MANDIR)/zipinfo.$(manext)
  132.  
  133. # Solaris 2.x stuff:
  134. PKGDIR = IZunzip
  135. VERSION = Version 6.0
  136.  
  137. UNZIPS = unzip$E funzip$E unzipsfx$E
  138. # this is a little ugly...well, OK, it's a lot ugly:
  139. MANS = man/funzip.1 man/unzip.1 man/unzipsfx.1 man/zipgrep.1 man/zipinfo.1
  140. DOCS = funzip.txt unzip.txt unzipsfx.txt zipgrep.txt zipinfo.txt
  141.  
  142. # list of supported systems/targets in this version
  143. SYSTEMG1 = generic generic_gcc  generic_pkg generic_gccpkg
  144. SYSTEMG2 = generic1 generic2 generic3 generic_bz2 generic_zlib generic_shlib
  145. SYSTEMS1 = 386i 3Bx 7300 7300_gcc aix aix_rt amdahl amdahl_eft apollo aviion
  146. SYSTEMS2 = bsd bsdi bsdi_noasm bull coherent convex cray cray_opt cyber_sgi
  147. SYSTEMS3 = cygwin dec dnix encore eta freebsd gcc gould hk68 hp hpux
  148. SYSTEMS4 = isc isc_gcc isi linux linux_dos linux_noasm linux_shlib linux_shlibz
  149. SYSTEMS5 = lynx macosx macosx_gcc minix mips mpeix next next10 next2x next3x
  150. SYSTEMS6 = nextfat osf1 pixel ptx pyramid qnxnto realix regulus rs6000 sco
  151. SYSTEMS7 = sco_dos sco_sl sco_x286 sequent sgi solaris solaris_pkg stardent
  152. SYSTEMS8 = stellar sunos3 sunos4 sysv sysv_gcc sysv6300 tahoe ti_sysv ultrix
  153. SYSTEMS9 = vax v7 wombat xenix xos
  154.  
  155.  
  156. ####################
  157. # DEFAULT HANDLING #
  158. ####################
  159.  
  160. # By default, print help on which makefile targets to try.  (The SYSTEM
  161. # variable is no longer supported; use "make <target>" instead.)
  162.  
  163. help:
  164.         @echo ""
  165.         @echo "  If you're not sure about the characteristics of your system, try typing"
  166.         @echo "  \"make generic\".  This is new and uses the configure script, though it is"
  167.         @echo "  still being worked on."
  168.         @echo ""
  169.         @echo "  If that does not do it, try the original generic which is \"make generic1\"."
  170.         @echo ""
  171.         @echo "  If the compiler barfs and says something unpleasant about \"timezone redefined\","
  172.         @echo "  try typing \"make clean\" followed by \"make generic2\".  If, on the other"
  173.         @echo "  hand, it complains about an undefined symbol _ftime, try typing \"make clean\""
  174.         @echo "  followed by \"make generic3\"."
  175.         @echo ""
  176.         @echo "  One of these actions should produce a working copy of unzip on most Unix"
  177.         @echo "  systems.  If you know a bit more about the machine on which you work, you"
  178.         @echo "  might try \"make list\" for a list of the specific systems supported herein."
  179.         @echo "  (Many of them do exactly the same thing, so don't agonize too much over"
  180.         @echo "  which to pick if two or more sound equally likely.)  Also check out the"
  181.         @echo "  INSTALL file for notes on compiling various targets.  As a last resort,"
  182.         @echo "  feel free to read the numerous comments within the Makefile itself."
  183.         @echo ""
  184.         @echo "  Have a mostly pretty good day."
  185.         @echo ""
  186.  
  187. list:
  188.         @echo ""
  189.         @echo\
  190.  'Type "make <system>", where <system> is one of the following:'
  191.         @echo ""
  192.         @echo  "        $(SYSTEMG1)"
  193.         @echo  "        $(SYSTEMG2)"
  194.         @echo ""
  195.         @echo  "        $(SYSTEMS1)"
  196.         @echo  "        $(SYSTEMS2)"
  197.         @echo  "        $(SYSTEMS3)"
  198.         @echo  "        $(SYSTEMS4)"
  199.         @echo  "        $(SYSTEMS5)"
  200.         @echo  "        $(SYSTEMS6)"
  201.         @echo  "        $(SYSTEMS7)"
  202.         @echo  "        $(SYSTEMS8)"
  203.         @echo  "        $(SYSTEMS9)"
  204. #       @echo ""
  205. #       @echo\
  206. # 'Targets for related utilities (ZipInfo and fUnZip) include:'
  207. #       @echo ""
  208. #       @echo  "        $(SYS_UTIL1)"
  209. #       @echo  "        $(SYS_UTIL2)"
  210.         @echo ""
  211.         @echo\
  212.  'For further (very useful) information, please read the comments in Makefile.'
  213.         @echo ""
  214.  
  215. generic_msg:
  216.         @echo ""
  217.         @echo\
  218.  '  Attempting "make generic" now.  If this fails for some reason, type'
  219.         @echo\
  220.  '  "make help" and/or "make list" for suggestions.'
  221.         @echo ""
  222.  
  223.  
  224. ###############################################
  225. # BASIC COMPILE INSTRUCTIONS AND DEPENDENCIES #
  226. ###############################################
  227.  
  228. # this is for GNU make; comment out and notify zip-bugs if it causes errors
  229. .SUFFIXES:      .c .o .obj .pic.o
  230.  
  231. # yes, we should be able to use the $O macro to combine these two, but it
  232. # fails on some brain-damaged makes (e.g., AIX's)...no big deal
  233. .c.o:
  234.         $(CC) -c $(CF) $*.c
  235.  
  236. .c.obj:
  237.         $(CC) -c $(CF) $*.c
  238.  
  239. .c.pic.o:
  240.         $(CC) -c $(CF) -o $@ $*.c
  241.  
  242. # this doesn't work...directories are always a pain with implicit rules
  243. #.1.txt:                man/$<
  244. #       nroff -Tman -man $< | col -b | uniq | \
  245. #        sed 's/Sun Release ..../Info-ZIP        /' > $@
  246.  
  247.  
  248. # these rules may be specific to Linux (or at least the GNU groff package)
  249. # and are really intended only for the authors' use in creating non-Unix
  250. # documentation files (which are provided with both source and binary
  251. # distributions).  We should probably add a ".1.txt" rule for more generic
  252. # systems...
  253.  
  254. funzip.txt:     man/funzip.1
  255.         nroff -Tascii -man man/funzip.1 | col -bx | uniq | expand > $@
  256.  
  257. unzip.txt:      man/unzip.1
  258.         nroff -Tascii -man man/unzip.1 | col -bx | uniq | expand > $@
  259.  
  260. unzipsfx.txt:   man/unzipsfx.1
  261.         nroff -Tascii -man man/unzipsfx.1 | col -bx | uniq | expand > $@
  262.  
  263. zipgrep.txt:    man/zipgrep.1
  264.         nroff -Tascii -man man/zipgrep.1 | col -bx | uniq | expand > $@
  265.  
  266. zipinfo.txt:    man/zipinfo.1
  267.         nroff -Tascii -man man/zipinfo.1 | col -bx | uniq | expand > $@
  268.  
  269.  
  270. all:            generic_msg generic
  271. unzips:         $(UNZIPS)
  272. objs:           $(OBJS)
  273. objsdll:        $(OBJSDLL)
  274. docs:           $(DOCS)
  275. unzipsman:      unzips docs
  276. unzipsdocs:     unzips docs
  277.  
  278.  
  279. # EDIT HERE FOR PARALLEL MAKES on Sequent (and others?)--screws up MS-DOS
  280. # make utilities if default:  change "unzip$E:" to "unzip$E:&"
  281.  
  282. unzip$E:        $(OBJS) $(LIBBZ2)       # add `&' for parallel makes
  283.         $(LD) $(LF) -L$(IZ_BZIP2) $(LOBJS) $(L_BZ2) $(LF2)
  284.  
  285. unzipsfx$E:     $(OBJX)                 # add `&' for parallel makes
  286.         $(LD) $(SL) $(LOBJX) $(SL2)
  287.  
  288. funzip$E:       $(OBJF)                 # add `&' for parallel makes
  289.         $(LD) $(FL) $(OBJF) $(FL2)
  290.  
  291. zipinfo$E:      unzip$E                 # `&' is pointless here...
  292.         @echo\
  293.  '  This is a Unix-specific target.  ZipInfo is not enabled in some MS-DOS'
  294.         @echo\
  295.  '  versions of UnZip; if it is in yours, copy unzip.exe to zipinfo.exe'
  296.         @echo\
  297.  '  or else invoke as "unzip -Z" (in a batch file, for example).'
  298.         $(LN) unzip$E zipinfo$E
  299.  
  300. # when the optional bzip2 support is provided (as recommended) by sources
  301. # in the 'bzip2' subdirectory, create/update the library:
  302. $(IZ_OUR_BZIP2_DIR)/libbz2.a:
  303.         @echo "Building/updating bzip2 object library..."
  304.         ( cd $(IZ_OUR_BZIP2_DIR) ; $(MAKE) -f Makebz2.iz CC="$(CC_BZ)"\
  305.          CFLAGS="$(CFLAGS_BZ)" RM="rm -f" )
  306.  
  307.  
  308. crc32$O:        crc32.c $(UNZIP_H) zip.h crc32.h
  309. crypt$O:        crypt.c $(UNZIP_H) zip.h crypt.h crc32.h ttyio.h
  310. envargs$O:      envargs.c $(UNZIP_H)
  311. explode$O:      explode.c $(UNZIP_H)
  312. extract$O:      extract.c $(UNZIP_H) crc32.h crypt.h
  313. fileio$O:       fileio.c $(UNZIP_H) crc32.h crypt.h ttyio.h ebcdic.h
  314. funzip$O:       funzip.c $(UNZIP_H) crc32.h crypt.h ttyio.h
  315. globals$O:      globals.c $(UNZIP_H)
  316. inflate$O:      inflate.c inflate.h $(UNZIP_H)
  317. list$O:         list.c $(UNZIP_H)
  318. match$O:        match.c $(UNZIP_H)
  319. process$O:      process.c $(UNZIP_H) crc32.h
  320. ttyio$O:        ttyio.c $(UNZIP_H) zip.h crypt.h ttyio.h
  321. ubz2err$O:      ubz2err.c $(UNZIP_H)
  322. unreduce$O:     unreduce.c $(UNZIP_H)
  323. unshrink$O:     unshrink.c $(UNZIP_H)
  324. unzip$O:        unzip.c $(UNZIP_H) crypt.h unzvers.h consts.h
  325. zipinfo$O:      zipinfo.c $(UNZIP_H)
  326.  
  327. # unzipsfx compilation section
  328. unzipsfx$O:     unzip.c $(UNZIP_H) crypt.h unzvers.h consts.h
  329.         $(CC) -c $(CF) -DSFX -o $@ unzip.c
  330.  
  331. crc32_$O:       crc32.c $(UNZIP_H) zip.h crc32.h
  332.         $(CC) -c $(CF) -DSFX -o $@ crc32.c
  333.  
  334. crypt_$O:       crypt.c $(UNZIP_H) zip.h crypt.h crc32.h ttyio.h
  335.         $(CC) -c $(CF) -DSFX -o $@ crypt.c
  336.  
  337. extract_$O:     extract.c $(UNZIP_H) crc32.h crypt.h
  338.         $(CC) -c $(CF) -DSFX -o $@ extract.c
  339.  
  340. fileio_$O:      fileio.c $(UNZIP_H) crc32.h crypt.h ttyio.h ebcdic.h
  341.         $(CC) -c $(CF) -DSFX -o $@ fileio.c
  342.  
  343. globals_$O:     globals.c $(UNZIP_H)
  344.         $(CC) -c $(CF) -DSFX -o $@ globals.c
  345.  
  346. inflate_$O:     inflate.c inflate.h $(UNZIP_H) crypt.h
  347.         $(CC) -c $(CF) -DSFX -o $@ inflate.c
  348.  
  349. match_$O:       match.c $(UNZIP_H)
  350.         $(CC) -c $(CF) -DSFX -o $@ match.c
  351.  
  352. process_$O:     process.c $(UNZIP_H) crc32.h
  353.         $(CC) -c $(CF) -DSFX -o $@ process.c
  354.  
  355. ttyio_$O:       ttyio.c $(UNZIP_H) zip.h crypt.h ttyio.h
  356.         $(CC) -c $(CF) -DSFX -o $@ ttyio.c
  357.  
  358. ubz2err_$O:     ubz2err.c $(UNZIP_H)
  359.         $(CC) -c $(CF) -DSFX -o $@ ubz2err.c
  360.  
  361.  
  362. # funzip compilation section
  363. cryptf$O:       crypt.c $(UNZIP_H) zip.h crypt.h crc32.h ttyio.h
  364.         $(CC) -c $(CF) -DFUNZIP -o $@ crypt.c
  365.  
  366. globalsf$O:     globals.c $(UNZIP_H)
  367.         $(CC) -c $(CF) -DFUNZIP -o $@ globals.c
  368.  
  369. inflatef$O:     inflate.c inflate.h $(UNZIP_H) crypt.h
  370.         $(CC) -c $(CF) -DFUNZIP -o $@ inflate.c
  371.  
  372. ttyiof$O:       ttyio.c $(UNZIP_H) zip.h crypt.h ttyio.h
  373.         $(CC) -c $(CF) -DFUNZIP -o $@ ttyio.c
  374.  
  375.  
  376. # optional assembler replacements
  377. crc_i86$O:      msdos/crc_i86.asm                               # 16bit only
  378.         $(AS) $(AF) msdos/crc_i86.asm $(ASEOL)
  379.  
  380. crc_gcc$O:      crc_i386.S $(ACONF_DEP)                         # 32bit, GNU AS
  381.         $(AS) $(AF) -x assembler-with-cpp -c -o $@ crc_i386.S
  382.  
  383. crc_gcc.pic.o:  crc_i386.S $(ACONF_DEP)                         # 32bit, GNU AS
  384.         $(AS) $(AF) -x assembler-with-cpp -c -o $@ crc_i386.S
  385.  
  386. crc_sysv$O:     crc_i386.S $(ACONF_DEP)                         # 32bit, SysV AS
  387.         $(CC) -E $(AF) crc_i386.S > crc_i386s.s
  388.         $(AS) -o $@ crc_i386s.s
  389.         $(RM) crc_i386s.s
  390.  
  391. msdos$O:        msdos/msdos.c $(UNZIP_H) unzvers.h              # DOS only
  392.         $(CC) -c $(CF) msdos/msdos.c
  393.  
  394. msdos_$O:       msdos/msdos.c $(UNZIP_H)                        # DOS unzipsfx
  395.         -$(CP) msdos/msdos.c msdos_.c > nul
  396.         $(CC) -c $(CF) -DSFX msdos_.c
  397.         $(RM) msdos_.c
  398.  
  399. #os2$O:         os2/os2.c $(UNZIP_H)                            # OS/2 only
  400. #       $(CC) -c $(CF) os2/os2.c
  401.  
  402. unix$O:         unix/unix.c $(UNZIP_H) unzvers.h                # Unix only
  403.         $(CC) -c $(CF) unix/unix.c
  404.  
  405. unix_$O:        unix/unix.c $(UNZIP_H)                          # Unix unzipsfx
  406.         $(CC) -c $(CF) -DSFX -o $@ unix/unix.c
  407.  
  408. unix.pic.o:     unix/unix.c $(UNZIP_H) unzvers.h                # Unix shlib
  409.         $(CC) -c $(CF) -o $@ unix/unix.c
  410.  
  411.  
  412. unix_make:
  413. #       @echo\
  414. # '(Ignore any errors from `make'"' due to the following command; it's harmless.)"
  415.         -@2>&1 $(LN) unix/Makefile . > /dev/null || echo > /dev/null
  416.  
  417. # this really only works for Unix targets, unless E and O specified on cmd line
  418. clean:
  419.         @echo ""
  420.         @echo '         This is a Unix-specific target.  (Just so you know.)'
  421.         @echo ""
  422.         -( cd $(IZ_OUR_BZIP2_DIR); $(MAKE) -f Makebz2.iz RM="rm -f" clean )
  423.         rm -f $(UNZIPS) $(OBJS) $(OBJF) $(OBJX) api$O apihelp$O crc_gcc$O \
  424.           crc_sysv$O unzipstb$O crypt_.c extract_.c globals_.c inflate_.c \
  425.           ttyio_.c crc_i386s.s msdos_.c process_.c unix_.c unzipsfx.c
  426.         rm -f flags
  427.         rm -rf ./$(PKGDIR)
  428.  
  429. # Package generation interface (by J.Bush).  Originally tested under Sun
  430. # Solaris 2.x.  Other SVr4s may be very similar and could possibly use this.
  431. # Note:  expects version info to be stored in VERSION macro variable.
  432. # See "README" under ./unix/Packaging
  433. #
  434. svr4package:    unzips
  435.         @echo "Creating SVR4 package for Unix ..."
  436.         -@rm -rf ./$(PKGDIR) ./$(PKGDIR)_`uname -p`.pkg
  437.         -@sed -e "s/.VERSION./$(VERSION)/g" \
  438.               -e "s/.PSTAMP./$(LOGNAME)_`date | tr  ' ' '_'`/g" \
  439.               -e "s/.ARCH./Solaris_`uname -rp | tr ' ' ','`/g" \
  440.               ./unix/Packaging/pkginfo.in > ./unix/Packaging/pkginfo
  441.         -@sed -e "s/.ARCH./`uname -p`/g" \
  442.               ./unix/Packaging/preinstall.in > ./unix/Packaging/preinstall
  443.         /usr/bin/pkgmk -d . -b . -r . -f ./unix/Packaging/prototype $(PKGDIR)
  444.         /usr/bin/pkgtrans -o -s . $(PKGDIR)_`uname -p`.pkg $(PKGDIR)
  445.         @echo " "
  446.         @echo "To install, copy $(PKGDIR)_`uname -p`.pkg to the target system, and"
  447.         @echo "issue the command (as root):  pkgadd -d $(PKGDIR)_`uname -p`.pkg"
  448.         @echo " "
  449.  
  450. install:        $(MANS)
  451.         -$(INSTALL_D) $(BINDIR)
  452.         $(INSTALL_PROGRAM) $(UNZIPS) $(BINDIR)
  453.         $(INSTALL) unix/zipgrep $(BINDIR)
  454.         $(RM) $(BINDIR)/zipinfo$E
  455.         $(LN) $(BINDIR)/unzip$E $(BINDIR)/zipinfo$E
  456.         -$(INSTALL_D) $(MANDIR)
  457.         $(INSTALL) man/funzip.1 $(MANDIR)/funzip.$(manext)
  458.         $(INSTALL) man/unzip.1 $(MANDIR)/unzip.$(manext)
  459.         $(INSTALL) man/unzipsfx.1 $(MANDIR)/unzipsfx.$(manext)
  460.         $(INSTALL) man/zipgrep.1 $(MANDIR)/zipgrep.$(manext)
  461.         $(INSTALL) man/zipinfo.1 $(MANDIR)/zipinfo.$(manext)
  462.         $(CHMOD) $(BINPERMS) $(INSTALLEDBIN)
  463.         $(CHMOD) $(MANPERMS) $(INSTALLEDMAN)
  464.  
  465. uninstall:
  466.         $(RM) $(INSTALLEDBIN) $(INSTALLEDMAN)
  467.  
  468. # added 10/28/04 EG
  469. flags:  unix/configure
  470.         sh unix/configure "${CC}" "${CF_NOOPT}" "${IZ_BZIP2}"
  471.  
  472. # the test zipfile
  473. TESTZIP = testmake.zip
  474.  
  475. # test some basic features of the build
  476. test:           check
  477.  
  478. check:
  479.         @echo '#####  This is a Unix-specific target.  (Just so you know.)'
  480.         @echo '#####     Make sure unzip, funzip and unzipsfx are compiled and'
  481.         @echo '#####     in this directory.'
  482.         @if test ! -f ./unzip; then \
  483.             echo "#####  ERROR:  can't find ./unzip"; exit 1; fi
  484.         @if test ! -f ./funzip; then \
  485.             echo "#####  ERROR:  can't find ./funzip"; exit 1; fi
  486.         @if test ! -f ./unzipsfx; then \
  487.             echo "#####  ERROR:  can't find ./unzipsfx"; exit 1; fi
  488. #
  489.         @if test ! -f $(TESTZIP); then \
  490.             echo "#####  ERROR:  can't find test file $(TESTZIP)"; exit 1; fi
  491. #
  492.         @echo "#####  testing extraction"
  493.         @./unzip -bo $(TESTZIP) testmake.zipinfo
  494.         @if test ! -f testmake.zipinfo ; then \
  495.             echo "#####  ERROR:  file extraction from $(TESTZIP) failed"; \
  496.             exit 1; fi
  497. #
  498.         @echo '#####  testing zipinfo (unzip -Z)'
  499.         @./unzip -Z $(TESTZIP) > testmake.unzip-Z
  500.         @if diff testmake.unzip-Z testmake.zipinfo; then echo "OK."; else \
  501.             echo "#####  WARNING:  zipinfo output doesn't match stored version"; \
  502.             echo '#####     (If the only difference is the file times, compare your'; \
  503.             echo '#####      timezone with the Central European timezone, which is one'; \
  504.             echo '#####      hour east of Greenwich but effectively 2 hours east'; \
  505.             echo '#####      during summer Daylight Savings Time.  The upper two'; \
  506.             echo '#####      lines should correspond to your local time when the'; \
  507.             echo '#####      files were created, on 19 November 1998 at 10:46pm CET.'; \
  508.             echo '#####      If the times are consistent, please ignore this warning.)'; \
  509.             fi
  510.         @$(RM) testmake.unzip-Z testmake.zipinfo
  511. #
  512.         @echo '#####  testing unzip -d exdir option'
  513.         @./unzip -bo $(TESTZIP) -d testun notes
  514.         @cat testun/notes
  515. #
  516.         @echo '#####  testing unzip -o and funzip (ignore funzip warning)'
  517.         @./unzip -boq $(TESTZIP) notes -d testun
  518.         @./funzip < $(TESTZIP) > testun/notes2
  519.         @if diff testun/notes testun/notes2; then true; else \
  520.             echo '#####  ERROR:  funzip output disagrees with unzip'; fi
  521. #
  522.         @echo '#####  testing unzipsfx (self-extractor)'
  523.         @cat unzipsfx $(TESTZIP) > testsfx
  524.         @$(CHMOD) 0700 testsfx
  525.         @./testsfx -bo notes
  526.         @if diff notes testun/notes; then true; else \
  527.             echo '#####  ERROR:  unzipsfx file disagrees with unzip'; fi
  528.         @$(RM) testsfx notes testun/notes testun/notes2
  529.         @rmdir testun
  530. #
  531.         @echo '#####  testing complete.'
  532.  
  533.  
  534. ################################
  535. # INDIVIDUAL MACHINE MAKERULES #
  536. ################################
  537.  
  538. #----------------------------------------------------------------------------
  539. #  Generic targets using the configure script to determine configuration.
  540. #----------------------------------------------------------------------------
  541.  
  542. # Well, try MAKE and see.  By now everyone may be happy.  10/28/04 EG
  543. generic:        flags      # now try autoconfigure first
  544.         eval $(MAKE) $(MAKEF) unzips ACONF_DEP=flags `cat flags`
  545. #       make $(MAKEF) unzips CF="${CF} `cat flags`"
  546.  
  547. generic_gcc:
  548.         $(MAKE) $(MAKEF) generic CC=gcc IZ_BZIP2="$(IZ_BZIP2)"
  549.  
  550. # extensions to perform SVR4 package-creation after compilation
  551. generic_pkg:    generic svr4package
  552. generic_gccpkg: generic_gcc svr4package
  553.  
  554. #----------------------------------------------------------------------------
  555. #  Old static generic targets (can't assume make utility groks "$(MAKE)")
  556. #----------------------------------------------------------------------------
  557.  
  558. generic1:       unzips     # first try if unknown
  559.  
  560. generic2:       unix_make  # second try if unknown:  hope make is called "make"
  561.         make $(MAKEF) unzips CF="$(CF) -DBSD"
  562.  
  563. generic3:       unix_make  # third try if unknown:  hope make is called "make"
  564.         make $(MAKEF) unzips CF="$(CF) -DSYSV"
  565.  
  566. # Generic build including bzip2 decompression support for unzip.
  567. # Requires presence of the bzip2 sources in subdirectory bzip2.
  568.  
  569. generic_bz2:    unix_make
  570.         @echo\
  571.  "This target assumes bzip2 sources are available in subfolder bzip2/."
  572.         $(MAKE) $(MAKEF) unzips D_USE_BZ2="-DUSE_BZIP2"\
  573.          L_BZ2="-lbz2" LIBBZ2="$(IZ_OUR_BZIP2_DIR)/libbz2.a" \
  574.          CC_BZ="$(CC)" CFLAGS_BZ="$(CFLAGS)"
  575.  
  576. # Generic unzip and funzip target using either shared or static zlib for
  577. # inflate rather than the original UnZip version.  (libz was libgz prior
  578. # to 0.94)  Need to figure out how to force unzipsfx to use static libz.
  579.  
  580. generic_zlib:   unix_make
  581.         @echo\
  582.  "This target assumes zlib (libz.a or libz.so.*) is already installed."
  583.         $(MAKE) unzip funzip CF="$(CF) -DUSE_ZLIB" LF2="-lz $(LF2)"
  584.  
  585. # Generic GNU C shared library.  This is an example of how to compile UnZip as
  586. # a shared library.  (Doing so as a static library would be similar.)  See also
  587. # the linux_shlib target.
  588.  
  589. generic_shlib:  unix_make
  590.         @echo\
  591.  'This target requires GNU C.  When done, do "setenv LD_LIBRARY_PATH `pwd`"'
  592.         @echo\
  593.  'or similar in order to test the shared library in place (with ./unzip_shlib ,'
  594.         @echo\
  595.  'which is UnZip linked with the DLL).  This target is an example only.'
  596.         @echo ""
  597.         $(MAKE) objsdll CC=gcc CFLAGS="-O3 -Wall -fPIC -DDLL"
  598.         gcc -shared -Wl,-soname,libunzip.so.0 -o libunzip.so.0.4 $(OBJSDLL)
  599.         $(RM) libunzip.so.0 libunzip.so
  600.         $(LN) -s libunzip.so.0.4 libunzip.so.0
  601.         $(LN) -s libunzip.so.0 libunzip.so
  602.         gcc -c -O unzipstb.c
  603.         gcc -o unzip_shlib unzipstb.o -L. -lunzip
  604.  
  605. #----------------------------------------------------------------------------
  606. #  "Autoconfig" group, aliases for the generic targets using configure:
  607. #----------------------------------------------------------------------------
  608.  
  609. # Solaris:  generic, plus generation of installable package.
  610. solaris_pkg:    generic_pkg
  611.  
  612. # Solaris: forcing usage of GCC, plus generation of installable package.
  613. solaris_gccpkg: generic_gcc_pkg
  614.  
  615. #----------------------------------------------------------------------------
  616. #  "Normal" group (BSD vs. SysV may be set in unzip.h via predefined macros):
  617. #----------------------------------------------------------------------------
  618.  
  619. 386i:           unzips  # sun386i, SunOS 4.0.2
  620. #3Bx:           unzips  # AT&T 3B2/1000-80; should work on any WE32XXX machine
  621. #aix_rt:                unzips  # IBM RT 6150 under AIX 2.2.1
  622. bull:           unzips  # Bull DPX/2, BOS 2.00.45 (doesn't require -Xk switch)
  623. convex:         unzips  # Convex C-120 and C-210 (-O is enough; -ext is default)
  624. cray:           unzips  # Cray-2 and Y-MP, using default (possibly old) compiler
  625. dec:            unzips  # DEC 5820 (MIPS RISC), test version of Ultrix v4.0
  626. encore:         unzips  # Multimax
  627. eta:            unzips  # ETA-10P*, hybrid SysV with BSD 4.3 enhancements
  628. gould:          unzips  # Gould PN9000 running UTX/32 2.1Bu01
  629. hp:             unzips  # HP 9000 series (68020), 4.3BSD or HP-UX A.B3.10 Ver D
  630. hpux:           unzips  # (to match zip's makefile entry)
  631. mips:           unzips  # MIPS M120-5(?), SysV.3 [error in sys/param.h file?]
  632. next10:         unzips  # NeXT (generic; use next2x or next3x for better opt.)
  633. osf1:           unzips  # DECstation, including Alpha-based; DEC OSF/1 v1.x
  634. pyr_:           unzips  # [failsafe target for pyramid target below]
  635. pyr_ucb:        unzips  # Pyramids running BSD universe by default (see below)
  636. realix:         unzips  # Modcomp Real/IX (SysV.3); note "gcc" = GLS C, not GNU
  637. sco:            unzips  # Xenix/386 (tested on 2.3.1); SCO Unix 3.2.0.
  638. sgi:            unzips  # Silicon Graphics; Irix 3.3.2, 4.0.x, 5.2, etc.
  639. stellar:        unzips  # gs-2000
  640. sun:            unzips  # old target; no good with solaris...use "sunos" now
  641. sunos:          unzips  # no good with SunOS 3.x...use "sunos3" or "sunos4" now
  642. sunos4:         unzips  # Sun 3, 4; SunOS 4.x (SOME SYSTEMS ARE SYSTEM V!)
  643. tahoe:          unzips  # tahoe (CCI Power6/32), 4.3BSD
  644. ultrix:         unzips  # VAXen, DEC 58x0 (MIPS guts), DECstation 2100; v4.x
  645. vax:            unzips  # general-purpose VAX target (not counting VMS)
  646.  
  647. #----------------------------------------------------------------------------
  648. #  BSD group (for timezone structs [struct timeb]):
  649. #----------------------------------------------------------------------------
  650.  
  651. bsd:            _bsd    # generic BSD (BSD 4.2 & Ultrix handled in unzip.h)
  652.  
  653. _bsd:           unix_make
  654.         $(MAKE) unzips CF="$(CF) -DBSD"
  655.  
  656. #----------------------------------------------------------------------------
  657. #  SysV group (for extern long timezone and ioctl.h instead of sgtty.h):
  658. #----------------------------------------------------------------------------
  659.  
  660. aix_rt:         _sysv   # IBM RT 6150 under AIX 2.2.1
  661. aviion:         _sysv   # Data General AViiONs, DG/UX 4.3x
  662. pyr_att:        _sysv   # Pyramids running AT&T (SysV) universe by default
  663. stardent:       _sysv   # Stardent ...
  664. sysv:           _sysv   # generic System V Unix (Xenix handled in unzip.h)
  665. xos:            _sysv   # Olivetti LSX-3005..3045, X/OS 2.3 and 2.4
  666.  
  667. _sysv:          unix_make
  668.         $(MAKE) unzips CF="$(CF) -DSYSV"
  669.  
  670. # extension to perform SVR4 package-creation after compilation
  671. _sysvp:         _sysv svr4package
  672.  
  673. #----------------------------------------------------------------------------
  674. #  Version 7 group (old/obsolescent):
  675. #----------------------------------------------------------------------------
  676.  
  677. pixel:          _v7     # Pixel 80, 100 (68000-based, V7/mostly BSD4.1 compat.)
  678. v7:             _v7     # generic Unix Version 7 box (prob. only Pixel...)
  679.  
  680. _v7:
  681.         make $(MAKEF) unzips \
  682.          CF="$(CF) -DV7 -DNO_PARAM_H -DSHORT_NAMES -DBSD -DZMEM -DNO_LCHOWN -DNO_LCHMOD"
  683.  
  684. #----------------------------------------------------------------------------
  685. #  "Unique" group (require non-standard options):
  686. #----------------------------------------------------------------------------
  687.  
  688. # AT&T 3B2/1000-80; should work on any WE32XXX machine
  689. 3Bx:            unix_make
  690.         $(MAKE) unzips CF="$(CF) -DCBREAK=2"
  691.  
  692. # AT&T 7300 (M68000/SysV.3) (add -DSYSV? -DNO_LIMITS?)
  693. 7300:           unix_make
  694.         $(MAKE) unzips CF="$(CF) -DNO_DIR -DNO_MKDIR -DNO_STRNICMP -DNO_UID_GID -DNO_FCHMOD -DNO_LCHOWN -DNO_LCHMOD -DCBREAK=2"
  695.  
  696. 7300_gcc:       unix_make
  697.         $(MAKE) unzips CC=gcc LD=gcc LF2="" CFLAGS="-O2" \
  698.          LOC="-DNO_DIR -DNO_MKDIR -DNO_STDLIB_H -DNO_STRNICMP -DNO_UID_GID -DNO_FCHMOD -DNO_LCHOWN -DNO_LCHMOD -DCBREAK=2 $(LOC)"
  699.         $(STRIP) $(UNZIPS)
  700.  
  701. # IBM AIX 3.x on an RS/6000:  see rs6000 target below
  702. aix:            rs6000
  703.  
  704. # Amdahl (IBMish) mainframe, UTS (SysV) 1.2.4, 2.0.1, 3.x
  705. amdahl:         unix_make
  706.         $(MAKE) unzips CF="$(CF) -DSYSV -DNO_UID_GID -DNO_LCHOWN -DNO_LCHMOD"
  707.  
  708. # Amdahl UTS 2.1.4 with "extended file types" filesystem (aarrrggghhhh...)
  709. amdahl_eft:     unix_make
  710.         $(MAKE) unzips CF="$(CF) -eft -DSYSV -DNO_UID_GID -DNO_LCHOWN -DNO_LCHMOD"
  711.  
  712. # Apollo Domain/OS machines (added -D...SOURCE options) [Gordon Fox, 960810]
  713. apollo:         unix_make
  714.         $(MAKE) unzips CF="$(CF) -D_INCLUDE_BSD_SOURCE -D_INCLUDE_XOPEN_SOURCE -DNO_LCHOWN -DNO_LCHMOD"
  715.  
  716. # BSDI BSD/OS on 386 platform, using the assembler replacement for crc32.c
  717. bsdi:           unix_make
  718.         @echo 'NOTE:  use bsdi_noasm target for non-Intel BSD/OS compiles.'
  719.         $(MAKE) unzips CC=gcc2 LD=shlicc2 AS=gcc2\
  720.          CFLAGS="-O3 -Wall -DASM_CRC -DBSD" CRCA_O=crc_gcc$O
  721.  
  722. # BSDI BSD/OS
  723. bsdi_noasm:     unix_make
  724. #       @echo 'NOTE:  use bsd target for non-Intel BSD/OS compiles.'
  725.         $(MAKE) unzips CC=gcc2 LD=shlicc2 AS=gcc2\
  726.          CFLAGS="-O3 -Wall -DBSD"
  727.  
  728. # Coherent 3.x/4.x, Mark Williams C.  ``For Coherent's CC, it needs either
  729. # -T0 or -T150000 (or bigger) added to the CFLAGS, otherwise the compiler
  730. # runs out of memory and dies in zipinfo.c.'' [Fred "Fredex" Smith, 940719]
  731. coherent:       unix_make
  732.         $(MAKE) unzips CFLAGS="$(CFLAGS) -T0 -DNO_LCHOWN -DNO_LCHMOD"
  733.  
  734. # Cray-2, Y-MP or C90, running Unicos 5.x to 8.x (SysV + BSD enhancements)
  735. # and Standard (ANSI) C compiler 3.0 or later.
  736. cray_opt:       unix_make
  737.         $(MAKE) unzips CFLAGS="$(CFLAGS) -h scalar3 -h vector3 -DNO_LCHOWN -DNO_LCHMOD"
  738.  
  739. # The unzip41 build on a Cyber 910/SGI running Irix v3.3.3 was successful
  740. # with the following change to Makefile:
  741. cyber_sgi:      unix_make
  742.         $(MAKE) unzips CFLAGS="$(CFLAGS) -I/usr/include/bsd -DNO_LCHOWN -DNO_LCHMOD"\
  743.          LF="-lbsd $(LF)" SL="-lbsd $(SL)"
  744.  
  745. # The Cygwin environment on a Win32 system, treated as an UNIX emulator.
  746. # This port does not offer full access to the Windows file system.
  747. # Info-ZIP recommends using "win32/Makefile.gcc" instead.
  748. cygwin:         unix_make
  749.         $(MAKE) unzips CC=gcc LD=gcc AS=gcc\
  750.          CFLAGS="-O3 -DASM_CRC -DNO_LCHOWN -DNO_LCHMOD"\
  751.          AF="-Di386 $(AF)" CRCA_O=crc_gcc$O\
  752.          E=".exe" CP="cp" LN="ln -s"
  753.  
  754. # 680x0, DIAB dnix 5.2/5.3 (a Swedish System V clone)
  755. #
  756. # Options for the dnix cc:
  757. #  -X7 = cc is strict ANSI C
  758. #  -X9 = warnings if a function is used without a declaration
  759. #
  760. dnix:           unix_make
  761.         $(MAKE) unzips CFLAGS="$(CFLAGS) -X7 -X9 -DDNIX"
  762.  
  763. # FreeBSD on Intel:
  764. freebsd:                unix_make
  765.         @echo 'NOTE:  use bsd target for non-Intel FreeBSD compiles (if any).'
  766.         $(MAKE) unzips CC=gcc LD=gcc AS=gcc\
  767.          CFLAGS="-O3 -Wall -DASM_CRC -DBSD"\
  768.          AF="-Di386 $(AF)" CRCA_O=crc_gcc$O
  769.  
  770. # Generic BSDish Unix gcc.  ``The -O3 only works with later versions of gcc;
  771. # you may have to use -O2 or -O for earlier versions.  I have no idea why
  772. # -s causes this bug in gcc.''  [Bug:  "nm: unzip: no name list", "collect:
  773. # /usr/bin/nm returned 1 exit status".]  If you don't have strip, don't
  774. # worry about it (it just makes the executable smaller and can be replaced
  775. # with "echo" instead).
  776. #
  777. gcc:            unix_make
  778.         $(MAKE) unzips CC=gcc LD=gcc CFLAGS="-O3" LF2=""
  779.         $(STRIP) $(UNZIPS)
  780.  
  781. # Heurikon HK68 (68010), UniPlus+ System V 5.0, Green Hills C-68000
  782. hk68:           unix_make
  783.         $(MAKE) unzips CC="gcc" LD="gcc"\
  784.          LF="-n $(LF)" SL="-n $(SL)" FL="-n $(FL)"\
  785.          CFLAGS="-ga -X138 -Dlocaltime=localti -Dtimezone=timezon"
  786.  
  787. # ISC Unix on 386 platform
  788. isc:            unix_make
  789.         $(MAKE) unzips LF2="-lc_s $(LF2)" CRCA_O=crc_sysv$O \
  790.          CFLAGS="-O" LOC="-DASM_CRC -DSYSV -DNO_UID_GID -DNEED_PTEM -DNO_LCHOWN -DNO_LCHMOD $(LOC)" \
  791.          AF="-DNO_UNDERLINE -Djecxz=jcxz -DALIGNMENT='.align 16' $(AF)"
  792.  
  793. isc_gcc:        unix_make
  794.         $(MAKE) unzips AS=gcc CC=gcc LD=gcc CRCA_O=crc_gcc$O \
  795.          LF="-shlib $(LF)" SL="-shlib $(SL)" FL="-shlib $(FL)" LF2="" \
  796.          CFLAGS="-O3" LOC="-DSYSV -DASM_CRC -DNO_UID_GID -DNEED_PTEM -DNO_LCHOWN -DNO_LCHMOD $(LOC)" \
  797.          AF="-DNO_UNDERLINE -Djecxz=jcxz -DALIGNMENT='.align 16' $(AF)"
  798.         $(STRIP) $(UNZIPS)
  799.  
  800. # "ISI machine (68025 CPU)" (based on e-mail from Rob White <rsw@tfs.com>;
  801. # no further information).  May also need DIRENT defined.
  802. isi:            unix_make
  803.         $(MAKE) unzips CF="$(CF) -DDECLARE_ERRNO -DNO_LCHOWN -DNO_LCHMOD"
  804.  
  805. # Linux on 386 platform, using the assembler replacement for crc32.c. (-O4 and
  806. # -fno-strength-reduce have virtually no effect beyond -O3.  Add "-m486
  807. # -malign-functions=2 -malign-jumps=2 -malign-loops=2" for Pentium [Pro]
  808. # systems.)
  809. linux:          unix_make
  810.         @echo 'NOTE:  use linux_noasm target for non-Intel Linux compiles.'
  811.         $(MAKE) unzips CC=gcc LD=gcc AS=gcc\
  812.          CFLAGS="-O3 -Wall -DASM_CRC"\
  813.          AF="-Di386 $(AF)" CRCA_O=crc_gcc$O
  814. # GRR:  this echo is pointless; if user gets this far, no difference to install
  815. #       @echo 'Be sure to use the install_asm target rather than the install target'
  816.  
  817. linux_asm:      linux
  818.  
  819. # Linux (Posix, approximately SysV):  virtually any version since before 0.96,
  820. # for any platform.  Change "-O" to "-O3" or whatever, as desired...
  821. linux_noasm:    unix_make
  822.         $(MAKE) unzips CC=gcc LD=gcc CFLAGS="-O -Wall"
  823.  
  824. # Linux with lcc compiler:  __inline__ (stat.h) not recognized, and must edit
  825. # /usr/include/gnu/types.h to get rid of "long long" if __LCC__ defined.  -O3
  826. # (or -O2 or -O) is ignored.  [GRR 960828: test target only]
  827. #
  828. linux_lcc:      unix_make
  829.         $(MAKE) unzips CC=lcc LD=lcc CFLAGS="-O3 -Wall -D__inline__= "
  830.  
  831. # Linux host with go32 (djgpp) cross-compiler (go32crs.tgz) for 32-bit DOS.
  832. linux_dos:      unix_make
  833.         $(MAKE) unzips CC=go32gcc LD=go32gcc M=msdos OSDEP_H="msdos/doscfg.h" \
  834.          CFLAGS="-O2 -Wall"
  835. #       go32-strip unzip
  836. #       Due to limitations of the cross-compiling package, this has to be
  837. #       done manually:
  838.         @echo Copy $(UNZIPS) to your DOS partition and use coff2exe.
  839.  
  840. # Linux ELF shared library (ooo, it's so easy).  This is a test target for
  841. # now, and it only makes the UnZip/ZipInfo stuff (not fUnZip or UnZipSFX).
  842. # The version number may eventually change to match the UnZip version.  Or
  843. # not.  Whatever.  Also do "setenv LD_LIBRARY_PATH `pwd`" or similar to test
  844. # the DLL in place (with unzip_shlib, which is UnZip linked with the shared
  845. # library).
  846. #
  847. linux_shlib:    unix_make
  848.         $(MAKE) objsdll CC=gcc CFLAGS="-O3 -Wall -fPIC"\
  849.          LOC="-DDLL -DASM_CRC $(LOC)"\
  850.          AS=gcc AF="-fPIC -Di386 $(AF)" CRCA_O=crc_gcc$O
  851.         gcc -shared -Wl,-soname,libunzip.so.0 -o libunzip.so.0.4 $(OBJSDLL)\
  852.          crc_gcc.pic.o
  853.         ln -sf libunzip.so.0.4 libunzip.so.0
  854.         ln -sf libunzip.so.0 libunzip.so
  855.         gcc -c -O unzipstb.c
  856.         gcc -o unzip_shlib unzipstb.o -L. -lunzip
  857.  
  858. # Linux ELF shared library, as above, but using inflate() from zlib (libz.so)
  859. # instead of the original UnZip version.  (libz was libgz prior to 0.94)
  860. linux_shlibz:   unix_make
  861.         $(MAKE) objsdll CC=gcc AS=gcc AF="-fPIC -Di386 $(AF)" CRCA_O=crc_gcc$O\
  862.          CFLAGS="-O3 -Wall -fPIC" LOC="-DDLL -DUSE_ZLIB -DASM_CRC $(LOC)"
  863.         gcc -shared -Wl,-soname,libunzip.so.0 -o libunzip.so.0.4 $(OBJSDLL)\
  864.          crc_gcc.pic.o
  865.         ln -sf libunzip.so.0.4 libunzip.so.0
  866.         gcc -c -O unzipstb.c
  867.         gcc -o unzip unzipstb.o -L. -lunzip -lz
  868.  
  869. # LynxOS-x86 2.3.0 and newer, a real-time BSD-like OS; uses gcc.
  870. lynx:           unix_make
  871.         $(MAKE) unzips CC=gcc CF="$(CF) -DLynx -DLYNX -DBSD -DUNIX"
  872.  
  873. # Macintosh MacOS X (Unix-compatible enviroment), using standard compiler
  874. macosx: unix_make
  875.         $(MAKE) unzips CFLAGS="-O3 -Wall -DBSD" LF2=""
  876.         $(STRIP) $(UNZIPS)
  877.  
  878. # Macintosh MacOS X (Unix-compatible enviroment), using gcc
  879. macosx_gcc:     unix_make
  880.         $(MAKE) unzips CC=gcc CFLAGS="-O3 -Wall -DBSD" LF2=""
  881.         $(STRIP) $(UNZIPS)
  882.  
  883. # Minix 1.5 PC for the 386.  Invoke as is to use default cc, or as "make
  884. # minix CC=gcc" to use gcc.  Try "make linux" if you have a working termios.h.
  885. minix:          unix_make
  886.         $(MAKE) unzips CF="$(CF) -DMINIX -DSHORT_NAMES -DNO_LCHOWN -DNO_LCHMOD" CC=$(CC) LD=$(CC)
  887.  
  888. # MPE/iX, the Unix variant for HP 3000 systems.
  889. mpeix:          unix_make
  890.         $(MAKE) unzips CC=c89\
  891.          CF="$(CF) -DUNIX -D_POSIX_SOURCE -DHAVE_TERMIOS_H -DPASSWD_FROM_STDIN -DNO_PARAM_H -DNO_LCHOWN -DNO_LCHMOD"\
  892.          LF2=-lbsd CP=cp LN="ln -s"
  893.  
  894. # NeXT info.
  895. next:
  896.         @echo
  897.         @echo\
  898.  '  Please pick a specific NeXT target:  "make next10" will create a generic'
  899.         @echo\
  900.  '  NeXT executable; "make next2x" will create a smaller executable (for'
  901.         @echo\
  902.  '  NeXTstep 2.0 and higher); "make next3x" will create a small executable'
  903.         @echo\
  904.  '  with significantly better optimization (NeXTstep 3.0 and higher only);'
  905.         @echo\
  906.  '  "make nextfat" will create a fat, multi-architecture (NeXT plus Intel)'
  907.         @echo\
  908.  '  executable (NeXTstep 3.1 and higher only).'
  909.         @echo
  910.  
  911. # 68030 BSD 4.3+Mach.  NeXT 2.x: make the executable smaller.
  912. next2x:         unix_make
  913.         $(MAKE) unzips LF2="-object -s"
  914.  
  915. # NeXT 3.x: as above, plus better optimization.
  916. next3x:         unix_make
  917.         $(MAKE) unzips CFLAGS="-O2" LF2="-object -s"
  918.  
  919. # NeXT 3.1+: make the executable fat (multi-architecture binary [MAB],
  920. # for "black" [NeXT] and "white" [x86] hardware, so far).
  921. nextfat:        unix_make
  922.         $(MAKE) unzips CFLAGS="-O2 -arch i386 -arch m68k" \
  923.          LF2="-arch i386 -arch m68k -object -s"
  924.  
  925. # IBM OS/390 (formerly MVS) compiled under "OpenEdition" shell
  926. os390:          unix_make
  927.         set -x; \
  928.         $(MAKE) $(MAKEF) unzips \
  929.          CC=c89 LD="\$$(CC) -Wl,EDIT=NO" \
  930.          CF="$(CF) -DSYSV -DUNIX -DOS390 -DEBCDIC -DNO_PARAM_H \
  931.          -DNO_LCHOWN -DNO_LCHMOD \
  932.          -D_ALL_SOURCE $(HOST_VERSINFO)" LF2=""
  933.  
  934. # Sequent Symmetry running Dynix/ptx (sort of SysV.3):  needs to link
  935. # with libseq to get symlink().
  936. ptx:            unix_make
  937.         $(MAKE) unzips CF="$(CF) -DSYSV -DTERMIO -DPTX -DNO_LCHOWN -DNO_LCHMOD" LF2="$(LF2) -lseq"
  938.  
  939. # Pyramid 90X (probably all) under >= OSx4.1, either universe.  (This is an
  940. # experimental target!  If it fails, use either pyr_ucb or pyr_att instead.)
  941. # The make in the BSD half is too stupid to understand $(MAKE), sigh...
  942. pyramid:        unix_make
  943.         -make $(MAKEF) pyr_`universe`
  944.  
  945. # QNX/Neutrino is "special" because you don't have any native development
  946. # tools yet.  Set ARCH to "x86", "ppcbe", "ppcle", "mipsbe", or "mipsle"
  947. # to produce x86, PowerPC (big- or little-endian) and MIPS (big-
  948. # or little-endian) using gcc. [cjh]
  949. qnxnto:         unix_make
  950.         @if [ "$(ARCH)" = "" ] ; then \
  951.                 echo "You didn't set ARCH; I'll assume you meant ARCH=x86..." ; \
  952.                 echo "" ; \
  953.                 $(MAKE) $(MAKEF) CC="qcc -Vgcc_ntox86" unzips ; \
  954.         else \
  955.                 echo "Making unzip for $(ARCH)..." ; \
  956.                 echo "" ; \
  957.                 $(MAKE) $(MAKEF) CC="qcc -Vgcc_nto$(ARCH)" unzips ; \
  958.         fi
  959.  
  960. # REGULUS:  68040-based, "real-time" SysV.3 mutant; uses gcc, with "REGULUS"
  961. # predefined.
  962. regulus:        unix_make
  963.         $(MAKE) unzips CF="$(CF) -traditional -DSYSV -DNO_MKDIR -DNO_LCHOWN -DNO_LCHMOD"
  964.  
  965. # IBM RS/6000 under AIX 3.2
  966. rs6000:         unix_make
  967.         $(MAKE) unzips CF="$(CF) -DBSD -D_BSD -DUNIX" LF2="-lbsd"
  968.  
  969. # SCO cross compile from Unix to DOS. Tested with Xenix/386 and OpenDeskTop.
  970. # Should work with Xenix/286 as well. (davidsen)  Note that you *must* remove
  971. # the Unix objects and executable before doing this!  (Piet Plomp:  gcc won't
  972. # recognize the -M0 flag that forces 8086 code.)  (GRR:  may need to reduce
  973. # stack to 0c00h if using 286/small-model code...?)
  974. sco_dos:        unix_make
  975.         $(MAKE) unzips CFLAGS="-O -dos -M0" M=msdos OSDEP_H="msdos/doscfg.h" \
  976.          LF="-dos -F 2000" LF2="-o unzip.exe" \
  977.          FL="-dos" FL2="-o funzip.exe" SL="-dos" SL2="-o unzipsfx.exe"
  978.  
  979. # SCO UNIX with shared libraries and no international support.  If you are
  980. # not using a USA-style keyboard and display, you may want to remove -nointl
  981. # to get support.  It adds quite a bit to the size of the executable.
  982. sco_sl:         unix_make
  983.         $(MAKE) unzips LF="$(LF) -nointl" LF2="$(LF2) -lc_s"\
  984.          SL="$(SL) -nointl" FL="$(FL) -nointl"
  985.  
  986. # SCO Xenix/286 2.2.3 or later with development system 2.2.1 or later
  987. sco_x286:       unix_make
  988.         $(MAKE) unzips CF="$(CF) -Mel2 -LARGE -DNO_MKDIR -DNO_LCHOWN -DNO_LCHMOD" \
  989.          LF="$(LF) -Mel2 -LARGE -lx" SL="$(SL) -Mel2 -LARGE" \
  990.          FL="$(FL) -Mel2 -LARGE"
  991.  
  992. # Sequent Symmetry with Dynix.  (386, but needs -DZMEM)
  993. # This should also work on Balance but I can't test it just yet.
  994. sequent:        unix_make
  995.         $(MAKE) unzips CF="$(CF) -DBSD -DZMEM -DNO_LCHOWN -DNO_LCHMOD"
  996.  
  997. # Sun 2, 3, 4 running SunOS 3.x
  998. sunos3:         unix_make
  999.         $(MAKE) unzips CF="$(CF) -DNO_UID_GID -DUID_USHORT -DNO_LCHOWN -DNO_LCHMOD"
  1000.  
  1001. # Generic System V + GNU C
  1002. sysv_gcc:       unix_make
  1003.         $(MAKE) unzips CC=gcc LD=gcc CFLAGS="-O2 -DSYSV" LF2=""
  1004.         $(STRIP) $(UNZIPS)
  1005.  
  1006. # AT&T 6300+, System V.2 Unix:  run-time out-of-memory error if don't use -Ml;
  1007. # also compile-time error if work arrays dimensioned at HSIZE+2 (>32K)
  1008. sysv6300:       unix_make
  1009.         $(MAKE) unzips CF="$(CF) -Ml -DSYSV -DNO_LCHOWN -DNO_LCHMOD" LF="$(LF) -Ml"\
  1010.          SL="$(SL) -Ml" FL="$(FL) -Ml"
  1011.  
  1012. # Texas Instruments System V.3 (running on HP 9000-1500)
  1013. ti_sysv:        unix_make
  1014.         $(MAKE) unzips CF="$(CF) -DSYSV -DNO_UID_GID -DUID_USHORT -DNO_LCHOWN -DNO_LCHMOD"
  1015.  
  1016. # SCO Xenix (Joe Foster 950508:  "unzip needs to be linked with -lx [for the
  1017. # opendir(), readdir(), telldir(), rewinddir(), and closedir() calls]")
  1018. xenix:           unix_make
  1019.         $(MAKE) unzips LF2="$(LF2) -lx"
  1020.  
  1021. # Wombat 68000 (or whatever).
  1022. # I didn't do this.  I swear.  No, really.
  1023. wombat:         unix_make
  1024.         @echo
  1025.         @echo  '        Ha ha!  Just kidding.'
  1026.         @echo
  1027.