home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 9 Archive / 09-Archive.zip / zip201.zip / Makefile < prev    next >
Makefile  |  1993-09-21  |  10KB  |  358 lines

  1. # Makefile for Zip, ZipNote, ZipCloak and ZipSplit
  2.  
  3. # what you can make ...
  4. all:
  5.     @echo ''
  6.     @echo 'Make what?  You must say what system to make Zip for--e.g.'
  7.     @echo '"make bsd".  Choices: generic, 386bsd, 3b1, aix, att6300, aux,'
  8.     @echo 'bsd, bsdold, bull, convex, coherent, cray, cray_v3, dec_osf1,'
  9.     @echo 'dnix, dynix, hpux, isc, linux, minix, next10, next2x, next3x,'
  10.     @echo 'nextfat, pixel, ptx, rs6000, scodos, sgi, sun, sun_gcc, sysv,'
  11.     @echo 'sysv_gcc, sysv_386, sys_386_gcc, sysv_old, ultrix, v7, xenix,'
  12.     @echo 'xos, zilog.'
  13.     @echo 'See the files install.doc and zip.doc for more information.'
  14.     @echo ''
  15.  
  16. list:   all
  17.  
  18. MAKE = make
  19. SHELL = /bin/sh
  20.  
  21. # (to use the Gnu compiler, change cc to gcc in CC and BIND)
  22. CC = cc
  23. BIND = $(CC)
  24. AS = $(CC) -c
  25. E =
  26. CPP = /lib/cpp -DSYSV
  27.  
  28. # probably can change this to 'install' if you have it
  29. INSTALL = cp
  30.  
  31. # target directories - where to install executables and man pages to
  32. BINDIR = /usr/local/bin
  33. manext=1
  34. MANDIR = /usr/local/man/man$(manext)
  35.  
  36. # flags
  37. #   CFLAGS    flags for C compile
  38. #   LFLAGS1   flags after output file spec, before obj file list
  39. #   LFLAGS2   flags after obj file list (libraries, etc)
  40. CFLAGS = -O
  41. LFLAGS1 =
  42. LFLAGS2 = -s
  43.  
  44. # object file lists
  45. OBJZ = zip.o zipfile.o zipup.o fileio.o util.o globals.o crypt.o
  46.  
  47. OBJI = deflate.o trees.o bits.o
  48. OBJA =
  49. OBJU = zipfile_.o zipup_.o fileio_.o util_.o globals.o
  50. OBJN = zipnote.o  $(OBJU)
  51. OBJC = zipcloak.o $(OBJU) crypt_.o
  52. OBJS = zipsplit.o $(OBJU)
  53.  
  54. # suffix rules
  55. .SUFFIXES:
  56. .SUFFIXES: _.o .o .c .doc .1
  57. .c_.o:
  58.     rm -f $*_.c; ln $< $*_.c
  59.     $(CC) $(CFLAGS) -DUTIL -c $*_.c
  60.     rm -f $*_.c
  61. .c.o:
  62.     $(CC) $(CFLAGS) -c $<
  63.  
  64. .1.doc:
  65.     nroff -man $< | col -b | uniq > $@
  66.  
  67. # rules for zip, zipnote, zipcloak, zipsplit, and zip.doc.
  68. $(OBJZ): zip.h ziperr.h tailor.h
  69. $(OBJI): zip.h ziperr.h tailor.h
  70. $(OBJN): zip.h ziperr.h tailor.h
  71. $(OBJS): zip.h ziperr.h tailor.h
  72. $(OBJC): zip.h ziperr.h tailor.h
  73. zip.o zipup.o crypt.o bits.o zipup_.o zipcloak.o crypt_.o:  crypt.h
  74.  
  75. match.o: match.s
  76.     $(CPP) match.s > _match.s
  77.     $(AS) _match.s
  78.     mv _match.o match.o
  79.     rm -f _match.s
  80.  
  81. ZIPS = zip$E zipnote$E zipsplit$E zipcloak$E
  82.  
  83. zip.o zipup.o zipnote.o zipcloak.o zipsplit.o: revision.h
  84. zips: $(ZIPS)
  85. zipsman: zip zipnote zipsplit zipcloak zip.doc
  86.  
  87. zip$E: $(OBJZ) $(OBJI) $(OBJA)
  88.     $(BIND) -o zip$E $(LFLAGS1) $(OBJZ) $(OBJI) $(OBJA) $(LFLAGS2)
  89. zipnote$E: $(OBJN)
  90.     $(BIND) -o zipnote$E $(LFLAGS1) $(OBJN) $(LFLAGS2)
  91. zipcloak$E: $(OBJC)
  92.     $(BIND) -o zipcloak$E $(LFLAGS1) $(OBJC) $(LFLAGS2)
  93. zipsplit$E: $(OBJS)
  94.     $(BIND) -o zipsplit$E $(LFLAGS1) $(OBJS) $(LFLAGS2)
  95.  
  96. # install
  97. install:        $(ZIPS)
  98.     $(INSTALL) $(ZIPS) $(BINDIR)
  99.     $(INSTALL) zip.1 $(MANDIR)/zip.$(manext)
  100.  
  101. uninstall:
  102.     -cd $(BINDIR); rm -f $(ZIPS) 
  103.     -cd $(MANDIR); rm -f zip.$(manext)
  104.  
  105. flags:  configure
  106.     sh configure flags
  107.  
  108. # These symbols, when #defined using -D have these effects on compilation:
  109. # ZMEM          - includes C language versions of memset(), memcpy(), and
  110. #                 memcmp() (util.c).
  111. # SYSV          - use <sys/dirent.h> and the library opendir()
  112. # DIRENT        - use <sys/dirent.h> and getdents() instead of <sys/dir.h>
  113. #                 and opendir(), etc. (fileio.c).
  114. # NODIR         - used for 3B1, which has neither getdents() nor opendir().
  115. # NDIR          - use "ndir.h" instead of <sys/dir.h> (fileio.c).
  116. # UTIL          - select routines for utilities (note, cloak, and split).
  117. # PROTO         - enable function prototypes.
  118. # RMDIR         - remove directories using a system("rmdir ...") call.
  119. # CONVEX        - for Convex make target.
  120. # AIX           - for AIX make target.
  121. # LINUX         - for linux make target.
  122.  
  123. #               Generic BSD and SysV targets:
  124.  
  125. generic: flags
  126.     eval $(MAKE) zips `cat flags`
  127.  
  128. # BSD 4.3 (also Unisys 7000--AT&T System V with heavy BSD 4.2)
  129. bsd:
  130.     $(MAKE) zips CFLAGS="-O"
  131.  
  132. # BSD, but missing memset(), memcmp().
  133. bsdold:
  134.     $(MAKE) zips CFLAGS="-O -DZMEM"
  135.  
  136. # AT&T System V, Rel 3.  Also SCO Unix, OpenDeskTop, ETA-10P*, SGI.
  137. sysv_old:
  138.     $(MAKE) zips CFLAGS="-O -DDIRENT"
  139.  
  140. # AT&T System V, Rel 4. Also any system with readdir() and termio.
  141. svr4: sysv
  142. sysv:
  143.     $(MAKE) zips CFLAGS="-O -DSYSV"
  144.  
  145. sysv_gcc:
  146.     $(MAKE) zips CFLAGS="-O2 -DSYSV" CC=gcc
  147.  
  148. # AT&T System V, Rel 4 for 386 (uses asm version):
  149. sysv_386:
  150.     $(MAKE) zips CFLAGS="-O -DSYSV -DASMV" OBJA=match.o
  151.  
  152. sysv_386_gcc:
  153.     $(MAKE) zips CFLAGS="-O2 -DSYSV -DASMV" OBJA=match.o CC=gcc
  154.  
  155.  
  156. #            Specific targets in alphabetical order:
  157.  
  158. # 386BSD 0.1
  159. 386bsd:
  160.     $(MAKE) zips CFLAGS="-O -DASMV" CPP=/usr/bin/cpp OBJA=match.o
  161.  
  162. # AT&T 3B1: System V, but missing a few things.
  163. 3b1:
  164.     $(MAKE) zips CFLAGS="-O -DNODIR -DRMDIR"
  165.  
  166. # AIX Version 3.1 for RISC System/6000 
  167. rs6000: aix
  168. aix:
  169.     $(MAKE) zips CC="c89" BIND="c89" \
  170.        CFLAGS="-O -D_POSIX_SOURCE -D_ALL_SOURCE -D_BSD -DAIX"
  171.  
  172. # AT&T 6300 PLUS (don't know yet how to allocate 64K bytes):
  173. att6300:
  174.     $(MAKE) zips LFLAGS1="-Ml" \
  175.     CFLAGS="-O -Ml -DNODIR -DRMDIR -DDYN_ALLOC -DMEDIUM_MEM -DWSIZE=16384"
  176.  
  177. # A/UX:
  178. aux:
  179.     $(MAKE) zips CFLAGS="-O -DTERMIO"
  180.  
  181. # Bull DPX/2 - BOS 02.00.69, aka "set 6"
  182. bull:
  183.     $(MAKE) zips CFLAGS="-O -v -DSYSV"
  184.  
  185. # Coherent (AS definition not needed for gcc)
  186. coherent:
  187.     $(MAKE) zips CFLAGS="-O -DDIRENT -DASMV" AS="as -gx" OBJA=match.o
  188.  
  189. # Convex C-120, C-210, OS 9.0, cc v. 4.0, no vectorization used.
  190. # Do not use -O2, there is a compiler bug.
  191. convex:
  192.     $(MAKE) zips CFLAGS="-O"
  193.  
  194. # Cray Unicos 5.1.10 & 6.0.11, Standard C compiler 2.0
  195. cray:
  196.     $(MAKE) zips CFLAGS="-O -DDIRENT" CC="scc"
  197.  
  198. # Cray Unicos 6.1, Standard C compiler 3.0 (all routines except trees.c
  199. # may be compiled with vector3; internal compiler bug in 3.0.2.3 and
  200. # earlier requires vector2 for trees.c)
  201. cray_v3:
  202.     $(MAKE) zips CFLAGS="-O -h vector2 -h scalar3 -DDIRENT" CC="scc"
  203.  
  204. # DEC OSF/1
  205. dec_osf1:
  206.     $(MAKE) zips CFLAGS="-O -Olimit 1000 -DOSF -D_BSD"
  207.  
  208. # DNIX 5.x: like System V but optimization is messed up.
  209. # There is a bug in cc for the dnix 5.3 2.2 on the 68030 but this
  210. # bug is not pesent dnix 5.3 1.4.3 on 68010. (To be investigated.)
  211. dnix:
  212.     $(MAKE) zips CFLAGS="-DDIRENT"
  213.  
  214. # DYNIX (R) V3.0.18 (no memset() or memcmp(), rindex() instead of strrchr())
  215. # See also ptx entry below.
  216. dynix:
  217.     $(MAKE) zips CFLAGS="-O -DZMEM -Dstrrchr=rindex"
  218.  
  219. # HPUX: System V, but use <ndir.h> and opendir(), etc.
  220. hp:     hpux
  221. hpux:
  222.     $(MAKE) zips CFLAGS="-O -DNDIR"
  223.  
  224. # Interactive Systems Corporation System V/386, Rel 3.2--optimizer problems
  225. isc:
  226.     $(MAKE) zips CFLAGS="-DDIRENT"
  227.  
  228. # Linux 0.97 with GCC 2.2.2, dies with GCC <= 2.11c. builtin functions are
  229. # disabled because '#define const' removes const from normal functions
  230. # but not builtin ones. And keeping const causes problems on other systems.
  231. linux:
  232.     $(MAKE) zips CFLAGS="-O -fno-builtin -DSYSV -DTERMIO -DLINUX" \
  233.       CC=gcc BIND=gcc
  234.  
  235. # MINIX 1.5.10 with Bruce Evans 386 patches and gcc/GNU make
  236. minix:
  237.     $(MAKE) zips CFLAGS="-O -DDIRENT -DMINIX -DNO_TERMIO" CC=gcc
  238.     chmem =262144 zip
  239.  
  240. # NeXT info.
  241. next:
  242.     @echo
  243.     @echo\
  244.  '  Please pick a specific NeXT target:  "make next10" will create a generic'
  245.     @echo\
  246.  '  NeXT executable; "make next2x" will create a smaller executable (for'
  247.     @echo\
  248.  '  NeXTstep 2.0 and higher); "make next3x" will create a small executable'
  249.     @echo\
  250.  '  with significantly better optimization (NeXTstep 3.0 and higher only).'
  251.     @echo\
  252.  '  "make nextfat" will create a fat executable (NeXTstep 3.1 only).'
  253.     @echo
  254.  
  255. # NeXT 1.0: BSD, but use shared library.
  256. next10:
  257.     $(MAKE) zips CFLAGS="-O" LFLAGS2="-s -lsys_s"
  258.  
  259. # NeXT 2.x: BSD, but use MH_OBJECT format for smaller executables.
  260. next2x:
  261.     $(MAKE) zips CFLAGS="-O" LFLAGS2="-s -object"
  262.  
  263. # NeXT 3.x: like above, but better optimization.
  264. next3x:
  265.     $(MAKE) zips CFLAGS="-O2" LFLAGS2="-s -object"
  266.  
  267. # NeXT 3.1: like above, but make executables "fat".
  268. nextfat:
  269.     $(MAKE) zips CFLAGS="-O2 -arch i386 -arch m68k" \
  270.       LFLAGS2="-arch i386 -arch m68k -s -object"
  271.  
  272.  
  273. # Pixel Computer 80 or 100.
  274. # Old V7 BSD, missing memset(), memcmp(), getdents(), opendir()
  275. pixel:  v7
  276. v7:
  277.     $(MAKE) zips CFLAGS="-O -DNODIR -DRMDIR -DZMEM -Dstrrchr=rindex"
  278.  
  279. # Dynix/ptx 1.3; needs libseq for readlink()
  280. ptx:
  281.     $(MAKE) zips CFLAGS="-O -DSYSV -DTERMIO" LFLAGS2="-lseq"
  282.  
  283. # SCO 386 cross compile for MS-DOS
  284. # Note: zip.exe should be lzexe'd on DOS to reduce its size
  285. scodos:
  286.     $(MAKE) zips CFLAGS="-O -Mc -dos -DNO_ASM" LFLAGS1="-Mc -dos" \
  287.      LFLAGS2="-F 1000" E=".exe"
  288.  
  289. # SCO Xenix 286 release 2.2.3, Development System 2.2.1
  290. sco_x286:
  291.     $(MAKE) zips CFLAGS="-O -LARGE -Mel2 -DRMDIR -DTERMIO -DMEDIUM_MEM \
  292.       -DWSIZE=16384" LFLAGS1="-LARGE -Mel2" LFLAGS2="-lx -s"
  293.  
  294. # Silicon Graphics Indigo with IRIX 4.0.5F
  295. sgi:
  296.     $(MAKE) zips CFLAGS="-O2 -DSYSV"
  297.  
  298. # Sun OS 4.x: BSD, but use getdents(). If you have gcc, use 'make sun_gcc'
  299. # instead since the code produced is better.
  300. sun_bsd:
  301.     $(MAKE) zips CFLAGS="-O2 -DDIRENT"
  302.  
  303. # Sun OS 4.x and Solaris. If you have gcc, use 'make sun_gcc'
  304. # or (better) 'make mmap_gcc' instead since the code produced is better.
  305. sun:
  306.     $(MAKE) zips CFLAGS="-O2 -DSYSV"
  307.  
  308. # Sun OS 4.x with gcc (bug with -s linker flag). Use -O if your version
  309. # of gcc does not like -O2.
  310. sun_gcc:
  311.     $(MAKE) zips CFLAGS="-O2 -DSYSV" CC=gcc LFLAGS2=""
  312.     strip $(ZIPS)
  313.  
  314. # Ultrix
  315. ultrix:
  316.     $(MAKE) zips CFLAGS="-O -Olimit 1000"
  317.  
  318. # SCO Xenix
  319. xenix:
  320.     $(MAKE) zips CFLAGS="-O -DSYSV" LFLAGS2="-lx -s"
  321.  
  322. # xos: Olivetti LSX-3005..3045 with X/OS 2.3 or 2.4
  323. xos:
  324.     $(MAKE) zips CFLAGS="-O -DTERMIO"
  325.  
  326. # zilog zeus 3.21
  327. zilog:
  328.     $(MAKE) zips CFLAGS="-O -DZMEM -DNDIR -DRMDIR" CC="scc -i" BIND="scc"
  329.  
  330.  
  331. # clean up after making stuff and installing it
  332. clean:
  333.     rm -f *.o $(ZIPS) flags
  334.  
  335. # This one's for Mark:
  336. it:
  337.     $(MAKE) zipsman CFLAGS="-O -Wall -DPROTO"\
  338.     LFLAGS2="-s -object" VPATH="${HOME}/Unix/bin"
  339.  
  340. # and these are for Jean-loup:
  341. gcc_d:
  342.     $(MAKE) zip CFLAGS="-g -DDEBUG -DMMAP -DSYSV" CC=gcc LFLAGS2="-g"
  343.     mv zip zipd
  344.  
  345. old_gcc:
  346.     $(MAKE) zips CFLAGS="-O -fstrength-reduce -DSYSV" CC=gcc LFLAGS2=""
  347.     strip $(ZIPS)
  348.  
  349. big_gcc:
  350.     $(MAKE) zips CFLAGS="-O2 -DSYSV -DBIG_MEM -W -Wall" CC=gcc LFLAGS2=""
  351.     strip $(ZIPS)
  352.  
  353. mmap_gcc:
  354.     $(MAKE) zips CFLAGS="-O2 -DSYSV -DMMAP -W -Wall" CC=gcc LFLAGS2=""
  355.     strip $(ZIPS)
  356.  
  357. # end of Makefile
  358.