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