home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 9 Archive / 09-Archive.zip / ZIP19P1.ZIP / makefile < prev    next >
Makefile  |  1993-01-23  |  7KB  |  254 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: bsd, bsdold, sysv, sysv_old, sysv_386,'
  8.     @echo 'dnix, linux, sun, sun_gcc, next10, next, hpux, cray, cray3,'
  9.     @echo '3b1, att6300, zilog, scodos, aux, c120, convex, aix, minix,'
  10.     @echo 'isc, ultrix, dec_osf1 and xos.'
  11.     @echo 'See the files install.doc and zip.doc for more information.'
  12.     @echo ''
  13.  
  14. CRYPTO =
  15. CLOAK =
  16. CRFLAG =
  17. MAKE = make
  18. #  **********************************************************************
  19. #  *** For encryption version, remove the # at the front of next line ***
  20. # MAKE = make CRYPTO="crypt.o" CLOAK="zipcloak" CRFLAG="-DCRYPT"
  21.  
  22. # (to use the Gnu compiler, change cc to gcc in CC and BIND)
  23. CC = cc
  24. BIND = cc
  25. E =
  26. CPP = /usr/lib/cpp -Dunix
  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. MANDIR = /usr/man/manl
  34.  
  35. # flags
  36. #   CFLAGS    flags for C compile
  37. #   LFLAGS1   flags after output file spec, before obj file list
  38. #   LFLAGS2   flags after obj file list (libraries, etc)
  39. CFLAGS = -O
  40. LFLAGS1 =
  41. LFLAGS2 = -s
  42.  
  43. # object file lists
  44. OBJZ = zip.o zipfile.o zipup.o fileio.o util.o globals.o $(CRYPTO)
  45.  
  46. OBJI = deflate.o trees.o bits.o
  47. OBJA =
  48. OBJU = zipfile_.o zipup_.o fileio_.o util_.o globals.o
  49. OBJN = zipnote.o  $(OBJU)
  50. OBJC = zipcloak.o $(OBJU) crypt_.o
  51. OBJS = zipsplit.o $(OBJU)
  52.  
  53. # suffix rules
  54. .SUFFIXES:
  55. .SUFFIXES: _.o .o .c .doc .1
  56. .c_.o:
  57.     rm -f $*_.c; ln $< $*_.c
  58.     $(CC) $(CFLAGS) -DUTIL $(CRFLAG) -c $*_.c
  59.     rm -f $*_.c
  60. .c.o:
  61.     $(CC) $(CFLAGS) $(CRFLAG) -c $<
  62.  
  63. .1.doc:
  64.     nroff -man $< | col -b | uniq > $@
  65.  
  66. # rules for zip, zipnote, zipcloak, zipsplit, and zip.doc.
  67. $(OBJZ): zip.h ziperr.h tailor.h
  68. $(OBJI): zip.h ziperr.h tailor.h
  69. $(OBJN): zip.h ziperr.h tailor.h
  70. $(OBJS): zip.h ziperr.h tailor.h
  71. $(OBJC): zip.h ziperr.h tailor.h
  72.  
  73. match.o: match.s
  74.     $(CPP) match.s > _match.s
  75.     $(CC) -c _match.s
  76.     mv _match.o match.o
  77.     rm -f _match.s
  78.  
  79. ZIPS = zip$E zipnote$E zipsplit$E $(CLOAK)$E
  80.  
  81. zip.o zipup.o zipnote.o zipcloak.o zipsplit.o: revision.h
  82. zips: $(ZIPS)
  83. zipsman: zip zipnote zipsplit $(CLOAK) zip.doc
  84.  
  85. zip$E: $(OBJZ) $(OBJI) $(OBJA)
  86.     $(BIND) -o zip$E $(LFLAGS1) $(OBJZ) $(OBJI) $(OBJA) $(LFLAGS2)
  87. zipnote$E: $(OBJN)
  88.     $(BIND) -o zipnote$E $(LFLAGS1) $(OBJN) $(LFLAGS2)
  89. zipcloak$E: $(OBJC)
  90.     $(BIND) -o zipcloak$E $(LFLAGS1) $(OBJC) $(LFLAGS2)
  91. zipsplit$E: $(OBJS)
  92.     $(BIND) -o zipsplit$E $(LFLAGS1) $(OBJS) $(LFLAGS2)
  93.  
  94. # install
  95. install:    $(ZIPS)
  96.     $(INSTALL) $(ZIPS) $(BINDIR)
  97.     $(INSTALL) zip.1 $(MANDIR)
  98.  
  99.  
  100. # These symbols, when #defined using -D have these effects on compilation:
  101. # ZMEM        - includes C language versions of memset(), memcpy(), and
  102. #          memcmp() (util.c).
  103. # DIRENT    - use <sys/dirent.h> and getdents() instead of <sys/dir.h>
  104. #          and opendir(), etc. (fileio.c).
  105. # NODIR        - used for 3B1, which has neither getdents() nor opendir().
  106. # NDIR        - use "ndir.h" instead of <sys/dir.h> (fileio.c).
  107. # UTIL        - select routines for utilities (note, cloak, and split).
  108. # PROTO        - enable function prototypes.
  109. # RMDIR        - remove directories using a system("rmdir ...") call.
  110. # CONVEX    - for Convex make target.
  111. # AIX        - for AIX make target.
  112. # CRYPT     - include the encryption code.
  113. # LINUX        - for linux make target.
  114.  
  115. # BSD 4.3 (also Unisys 7000--AT&T System V with heavy BSD 4.2)
  116. bsd:
  117.     $(MAKE) zips CFLAGS="-O"
  118.  
  119. # BSD, but missing memset(), memcmp().
  120. bsdold:
  121.     $(MAKE) zips CFLAGS="-O -DZMEM"
  122.  
  123. # AT&T System V, Rel 3.  Also SCO, Xenix, OpenDeskTop, ETA-10P*, SGI.
  124. sysv_old:
  125.     $(MAKE) zips CFLAGS="-O -DDIRENT"
  126.  
  127. # AT&T System V, Rel 4. Also any system with readdir() and termio.
  128. sysv:
  129.     $(MAKE) zips CFLAGS="-O -DSYSV -DTERMIO"
  130.  
  131. # AT&T System V, Rel 4 for 386 (uses asm version):
  132. sysv_386:
  133.     $(MAKE) zips CFLAGS="-O -DSYSV -DTERMIO -DASM" OBJA=match.o
  134.  
  135. # DNIX 5.x: like System V but optimization is messed up.
  136. dnix:
  137.     $(MAKE) zips CFLAGS="-DDIRENT"
  138.  
  139. # Linux 0.96a with GCC 2.12, dies with <= 2.11c. The problem with
  140. # builtin functions still has to be investigated.
  141. linux:
  142.     $(MAKE) zips CFLAGS="-O -fno-builtin -DSYSV -DTERMIO -DLINUX"
  143.  
  144. # Sun OS 4.x: BSD, but use getdents(). If you have gcc, use 'make sun_gcc'
  145. # instead since the code produced is better.
  146. sun:
  147.     $(MAKE) zips CFLAGS="-O4 -DDIRENT"
  148.  
  149. # Sun OS 4.x with gcc (bug with -s linker flag). Use -O if your version
  150. # of gcc does not like -O2.
  151. sun_gcc:
  152.     $(MAKE) zips CFLAGS="-O2 -DDIRENT" CC=gcc BIND=gcc LFLAGS2=""
  153.     strip $(ZIPS)
  154.  
  155. # NeXT 1.0: BSD, but use shared library.
  156. next10:
  157.     $(MAKE) zips CFLAGS="-O" LFLAGS2="-s -lsys_s"
  158.  
  159. # NeXT 2.0: BSD, but use MH_OBJECT format for smaller executables.
  160. next:
  161.     $(MAKE) zips CFLAGS="-O" LFLAGS2="-s -object"
  162.  
  163. # HPUX: System V, but use <ndir.h> and opendir(), etc.
  164. hpux:
  165.     $(MAKE) zips CFLAGS="-O -DNDIR"
  166.  
  167. # Cray Unicos 5.1.10 & 6.0.11, Standard C compiler 2.0
  168. cray:
  169.     $(MAKE) zips CFLAGS="-O -DDIRENT" CC="scc"
  170.  
  171. # Cray Unicos 6.1, Standard C compiler 3.0 (all routines except trees.c
  172. # may be compiled with vector3; internal compiler bug in 3.0.2.3 and
  173. # earlier requires vector2 for trees.c)
  174. cray3:
  175.     $(MAKE) zips CFLAGS="-O -h vector2 -h scalar3 -DDIRENT" CC="scc"
  176.  
  177. # AT&T 3B1: System V, but missing a few things.
  178. 3b1:
  179.     $(MAKE) zips CFLAGS="-O -DNODIR -DRMDIR"
  180.  
  181. # AT&T 6300 PLUS (don't know yet how to allocate 64K bytes):
  182. att6300:
  183.     $(MAKE) zips LFLAGS1="-Ml" \
  184.     CFLAGS="-O -Ml -DNODIR -DRMDIR -DDYN_ALLOC -DMEDIUM_MEM -DWSIZE=16384"
  185.  
  186. # zilog zeus 3.21
  187. zilog:
  188.     $(MAKE) zips CFLAGS="-O -DZMEM -DNDIR -DRMDIR" CC="scc -i" BIND="scc"
  189.  
  190. # SCO 386 cross compile for MS-DOS
  191. # Note: zip.exe should be lzexe'd on DOS to reduce its size
  192. scodos:
  193.     $(MAKE) zips CFLAGS="-O -Mc -dos -DNO_ASM" LFLAGS1="-Mc -dos" \
  194.      LFLAGS2="-F 1000" E=".exe"
  195.  
  196. # A/UX:
  197. aux:
  198.     $(MAKE) zips CFLAGS="-O -DTERMIO"
  199.  
  200. # Convex C120, OS 9.0, cc v. 4.0, no vectorization.
  201. c120:
  202.     $(MAKE) zips CFLAGS="-O1 -rl -DCONVEX"
  203.  
  204. # Convex C220, OS 9.0
  205. convex:
  206.     $(MAKE) zips CFLAGS="-O2 -rl -DCONVEX"
  207.  
  208. # AIX Version 3.1 for RISC System/6000 
  209. aix:
  210.     $(MAKE) zips CC="c89" BIND="c89" \
  211.        CFLAGS="-O -D_POSIX_SOURCE -D_ALL_SOURCE -D_BSD -DAIX"
  212.  
  213. # MINIX 1.5.10 with Bruce Evans 386 patches and gcc/GNU make
  214. minix:
  215.     $(MAKE) zips CFLAGS="-O -DDIRENT -DMINIX" CC=gcc BIND=gcc
  216.     chmem =262144 zip
  217.  
  218. # Interactive Systems Corporation System V/386, Rel 3.2--optimizer problems
  219. isc:
  220.     $(MAKE) zips CFLAGS="-DDIRENT"
  221.  
  222. # DYNIX (R) V3.0.18 (no memset() or memcmp(), rindex() instead of strrchr())
  223. dynix:
  224.     $(MAKE) zips CFLAGS="-O -DZMEM -Dstrrchr=rindex"
  225.  
  226. # Ultrix
  227. ultrix:
  228.     $(MAKE) zips CFLAGS="-O -Olimit 700"
  229.  
  230. # DEC OSF/1
  231. dec_osf1:
  232.     $(MAKE) zips CFLAGS="-O -Olimit 1000 -DOSF -D_BSD"
  233.  
  234. # xos: Olivetti LSX-3005..3045 with X/OS 2.3 or 2.4
  235. xos:
  236.     $(MAKE) zips CFLAGS="-O -DTERMIO"
  237.  
  238. # clean up after making stuff and installing it
  239. clean:
  240.     rm -f *.o
  241.     rm -f $(ZIPS)
  242.  
  243. # This one's for Mark:
  244. it:
  245.     $(MAKE) zipsman CFLAGS="-O -Wall -DPROTO"\
  246.     LFLAGS2="-s -object" VPATH="${HOME}/Unix/bin"
  247.  
  248. # and this one for Jean-loup:
  249. gcc_d:
  250.     $(MAKE) zip CFLAGS="-g -DDEBUG -DDIRENT" CC=gcc BIND=gcc LFLAGS2="-g"
  251.     mv zip zipd
  252.  
  253. # end of Makefile
  254.