Makefile 38 KB

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