home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 9 Archive / 09-Archive.zip / zip21.zip / unix / Makefile < prev    next >
Makefile  |  1996-04-23  |  6KB  |  225 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 generic".  Choices: generic, generic_gcc,'
  8.     @echo 'att6300, coherent, cray_v3, minix,'
  9.     @echo 'sco_x286, xenix, zilog.'
  10.     @echo 'See the files install.doc and zip.doc for more information.'
  11.     @echo ''
  12.  
  13. list:   all
  14.  
  15. MAKE = make -f unix/Makefile
  16. SHELL = /bin/sh
  17.  
  18. # (to use the Gnu compiler, change cc to gcc in CC and BIND)
  19. CC = cc
  20. BIND = $(CC)
  21. AS = $(CC) -c
  22. E =
  23. CPP = /lib/cpp
  24.  
  25. # probably can change this to 'install' if you have it
  26. INSTALL = cp
  27.  
  28. # target directories - where to install executables and man pages to
  29. prefix = /usr/local
  30. BINDIR = $(prefix)/bin
  31. manext=1
  32. MANDIR = $(prefix)/man/man$(manext)
  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 -I. -DUNIX
  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 ttyio.o \
  44.        unix.o crc32.o crctab.o
  45. OBJI = deflate.o trees.o bits.o
  46. OBJA =
  47. OBJU = zipfile_.o fileio_.o util_.o globals.o
  48. OBJN = zipnote.o  $(OBJU)
  49. OBJC = zipcloak.o $(OBJU) crctab.o crypt_.o ttyio.o
  50. OBJS = zipsplit.o $(OBJU)
  51.  
  52. ZIP_H = zip.h ziperr.h tailor.h unix/osdep.h
  53.  
  54. # suffix rules
  55. .SUFFIXES:
  56. .SUFFIXES: _.o .o .c .doc .1
  57. .c_.o:
  58.     rm -f $*_.c; ln $< $*_.c
  59.     $(CC) -c $(CFLAGS) -DUTIL $*_.c
  60.     rm -f $*_.c
  61. .c.o:
  62.     $(CC) -c $(CFLAGS) $<
  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)
  69. $(OBJI): $(ZIP_H)
  70. $(OBJN): $(ZIP_H)
  71. $(OBJS): $(ZIP_H)
  72. $(OBJC): $(ZIP_H)
  73. zip.o zipup.o crypt.o ttyio.o bits.o zipcloak.o crypt_.o: crypt.h
  74. zip.o zipup.o zipnote.o zipcloak.o zipsplit.o: revision.h
  75. zip.o crypt.o ttyio.o zipcloak.o crypt_.o: ttyio.h
  76. zipup.o: unix/zipup.h
  77.  
  78. match.o: match.S
  79.     $(CPP) match.S > _match.s
  80.     $(AS) _match.s
  81.     mv _match.o match.o
  82.     rm -f _match.s
  83.  
  84. unix.o: unix/unix.c
  85.     $(CC) -c $(CFLAGS) unix/unix.c
  86.  
  87. ZIPS = zip$E zipnote$E zipsplit$E zipcloak$E
  88.  
  89. zips: $(ZIPS)
  90. zipsman: zip zipnote zipsplit zipcloak zip.doc
  91.  
  92. zip$E: $(OBJZ) $(OBJI) $(OBJA)
  93.     $(BIND) -o zip$E $(LFLAGS1) $(OBJZ) $(OBJI) $(OBJA) $(LFLAGS2)
  94. zipnote$E: $(OBJN)
  95.     $(BIND) -o zipnote$E $(LFLAGS1) $(OBJN) $(LFLAGS2)
  96. zipcloak$E: $(OBJC)
  97.     $(BIND) -o zipcloak$E $(LFLAGS1) $(OBJC) $(LFLAGS2)
  98. zipsplit$E: $(OBJS)
  99.     $(BIND) -o zipsplit$E $(LFLAGS1) $(OBJS) $(LFLAGS2)
  100.  
  101. # install
  102. install:        $(ZIPS)
  103.     $(INSTALL) $(ZIPS) unix/zipgrep $(BINDIR)
  104.     $(INSTALL) man/zip.1 $(MANDIR)/zip.$(manext)
  105.     $(INSTALL) man/zipgrep.1 $(MANDIR)/zipgrep.$(manext)
  106.  
  107. uninstall:
  108.     -cd $(BINDIR); rm -f $(ZIPS)
  109.     -cd $(MANDIR); rm -f zip.$(manext)
  110.  
  111. dist:
  112.     zip -u9T zip`sed -e '/VERSION/!d' -e 's/.*"\(.*\)".*/\1/' \
  113.               -e s/[.]//g -e q revision.h` \
  114.       `awk '/^Makefile/,/vms_zip.rnh/ {print $$1}' < contents`
  115.  
  116. flags:  unix/configure
  117.     sh unix/configure "${CC}" "${CFLAGS}"
  118.  
  119. # These symbols, when #defined using -D have these effects on compilation:
  120. # ZMEM                  - includes C language versions of memset(), memcpy(),
  121. #                         and memcmp() (util.c).
  122. # HAVE_DIRENT_H         - use <dirent.h> instead of <sys/dir.h>
  123. # NODIR                 - for 3B1, which has neither getdents() nor opendir().
  124. # HAVE_NDIR_H           - use <ndir.h> (unix/unix.c).
  125. # HAVE_SYS_DIR_H        - use <sys/dir.h>
  126. # HAVE_SYS_NDIR_H       - use <sys/ndir.h>
  127. # UTIL                  - select routines for utilities (note, cloak, split)
  128. # NO_RMDIR              - remove directories using a system("rmdir ...") call.
  129. # NO_PROTO              - cannot handle ANSI prototypes
  130. # NO_CONST              - cannot handle ANSI const
  131.  
  132. #               Generic targets:
  133.  
  134. generic: flags
  135.     eval $(MAKE) zips `cat flags`
  136.  
  137. generic_gcc:
  138.     $(MAKE) generic CC=gcc CPP="$(CC) -E"
  139.  
  140. # AT&T 6300 PLUS (don't know yet how to allocate 64K bytes):
  141. att6300:
  142.     $(MAKE) zips LFLAGS1="-Ml" \
  143.     CFLAGS="-DUNIX -I. -O -Ml -DNODIR -DRMDIR -DDYN_ALLOC -DMEDIUM_MEM -DWSIZE=16384"
  144.  
  145. # Coherent (AS definition not needed for gcc)
  146. coherent:
  147.     $(MAKE) zips CFLAGS="-DUNIX -I. -O -DDIRENT -DASMV" AS="as -gx" \
  148.                      OBJA=match.o
  149.  
  150. # Cray Unicos 6.1, Standard C compiler 3.0 (all routines except trees.c
  151. # may be compiled with vector3; internal compiler bug in 3.0.2.3 and
  152. # earlier requires vector2 for trees.c)
  153. cray_v3:
  154.     $(MAKE) zips CC="scc" \
  155.                 CFLAGS="-DUNIX -I. -O -h vector2 -h scalar3 -DHAVE_DIRENT_H"
  156.  
  157. # DEC OSF/1
  158. #  with OSF/1 v3.2, default compiler in ANSI mode worked.
  159. # should work with make generic
  160. #dec_osf1:
  161. #    $(MAKE) zips CFLAGS="-DUNIX -I. -O -Olimit 1000 -std"
  162.  
  163. # Some older OSF/1 versions may need -DOSF to work around bug in errno.h.
  164. # should work with make generic
  165. #dec_osf1_old:
  166. #    $(MAKE) zips CFLAGS="-DUNIX -I. -O -Olimit 1000 -DOSF"
  167.  
  168. # MINIX 1.5.10 with Bruce Evans 386 patches and gcc/GNU make
  169. minix:
  170.     $(MAKE) zips CFLAGS="-DUNIX -I. -O -DDIRENT -DMINIX" CC=gcc
  171.     chmem =262144 zip
  172.  
  173.  
  174. # SCO Xenix 286 release 2.2.3, Development System 2.2.1
  175. sco_x286:
  176.     $(MAKE) zips CFLAGS="-I. -O -LARGE -Mel2 -DRMDIR -DTERMIO -DMEDIUM_MEM \
  177.       -DWSIZE=16384" LFLAGS1="-LARGE -Mel2" LFLAGS2="-lx -s"
  178.  
  179. # SCO Xenix
  180. xenix:
  181.     $(MAKE) zips CFLAGS="-DUNIX -I. -O" LFLAGS2="-lx -s"
  182.  
  183. # zilog zeus 3.21
  184. zilog:
  185.     $(MAKE) zips CFLAGS="-DUNIX -I. -O -DZMEM -DNDIR -DRMDIR" \
  186.                 CC="scc -i" BIND="scc"
  187.  
  188.  
  189. # clean up after making stuff and installing it
  190. clean:
  191.     rm -f *.o $(ZIPS) flags
  192.  
  193. ###############################################################################
  194. ## The following targets are used for developing by the Info-Zip group
  195. ## or should be considered as experimental.
  196.  
  197. # This one's for Mark:
  198. it:
  199.     $(MAKE) zipsman CFLAGS="-DUNIX -I. -O -Wall"\
  200.     LFLAGS2="-s -object" VPATH="${HOME}/Unix/bin"
  201.  
  202. # and these are for Jean-loup:
  203.  
  204. gcc_d:
  205.     $(MAKE) zip CFLAGS="-DUNIX -I. -g -DDEBUG -DMMAP" CC=gcc LFLAGS2="-g"
  206.     mv zip zipd
  207.  
  208. old_gcc:
  209.     $(MAKE) zips CFLAGS="-DUNIX -I. -O -fstrength-reduce" CC=gcc LFLAGS2=""
  210.     strip $(ZIPS)
  211.  
  212. big_gcc:
  213.     $(MAKE) zips CFLAGS="-DUNIX -I. -O2 -DBIG_MEM -W -Wall" CC=gcc \
  214.                 LFLAGS2=""
  215.     strip $(ZIPS)
  216.  
  217. mmap_gcc:
  218.     $(MAKE) zips CFLAGS="-DUNIX -I. -O2 -DMMAP -W -Wall" CC=gcc LFLAGS2=""
  219.     strip $(ZIPS)
  220.  
  221. mmap:
  222.     $(MAKE) zips CFLAGS="-DUNIX -I. -O -DMMAP"
  223.  
  224. # end of Makefile
  225.