home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 9 Archive / 09-Archive.zip / ZIP10X.ZIP / ZIP10EX.ZOO / makefile < prev    next >
Makefile  |  1991-10-03  |  4KB  |  157 lines

  1. # Makefile for Zip, ZipNote, ZipSplit, and Ship.
  2. # Note: this makefile leaves out the encryption/decryption part of zip, and
  3. #  completely leaves out the zipcloak program.
  4.  
  5. # what you can make ...
  6. default:
  7.     @echo ''
  8.     @echo 'Make what?  You must say what system to make Zip for--e.g.'
  9.     @echo '"make bsd".  Choices: bsd, bsdold, sysv, sun, next, next10,'
  10.     @echo 'hpux, dnix, cray, 3b1, zilog, aux, convex, aix, and minix.'
  11.     @echo 'See the file zip.doc for more information.'
  12.     @echo ''
  13.  
  14. # variables (to use the Gnu compiler, change cc to gcc in CC and BIND)
  15. MAKE = make
  16. CC = cc
  17. BIND = cc
  18. RENAME = mv
  19.  
  20. # flags
  21. #   CFLAGS    flags for C compile
  22. #   LFLAGS1   flags after output file spec, before obj file list
  23. #   LFLAGS2   flags after obj file list (libraries, etc)
  24. CFLAGS =
  25. LFLAGS1 =
  26. LFLAGS2 = -s
  27.  
  28. # object file lists
  29. OBJZ = zip.o zipfile.o zipup.o fileio.o util.o tempf.o shrink.o globals.o
  30. OBJI = implode.o im_lmat.o im_ctree.o im_bits.o
  31. OBJN = zipnote.o zipfile_.o zipup_.o fileio_.o globals.o
  32. OBJS = zipsplit.o zipfile_.o zipup_.o fileio_.o globals.o
  33.  
  34. # suffix rules
  35. .SUFFIXES:
  36. .SUFFIXES: _.o .o .c .doc .1
  37. .c_.o:
  38.     $(RENAME) $< $*_.c
  39.     $(CC) $(CFLAGS) -DUTIL -DEXPORT -c $*_.c
  40.     $(RENAME) $*_.c $<
  41. .c.o:
  42.     $(CC) $(CFLAGS) -DEXPORT -c $<
  43. .1.doc:
  44.     nroff -man $< | col -b > $@
  45.  
  46. # rules for zip, zipnote, zipsplit, and zip.doc.
  47. $(OBJZ): zip.h ziperr.h tempf.h tailor.h
  48. $(OBJI): implode.h crypt.h ziperr.h tempf.h tailor.h
  49. $(OBJN): zip.h ziperr.h tailor.h
  50. $(OBJS): zip.h ziperr.h tailor.h
  51. zip.o zipup.o zipnote.o zipsplit.o: revision.h
  52. zips: zip zipnote zipsplit ship
  53. zipsman: zip zipnote zipsplit ship zip.doc
  54. zip: $(OBJZ) $(OBJI)
  55.     $(BIND) -o zip $(LFLAGS1) $(OBJZ) $(OBJI) $(LFLAGS2)
  56. zipnote: $(OBJN)
  57.     $(BIND) -o zipnote $(LFLAGS1) $(OBJN) $(LFLAGS2)
  58. zipsplit: $(OBJS)
  59.     $(BIND) -o zipsplit $(LFLAGS1) $(OBJS) $(LFLAGS2)
  60. ship: ship.c
  61.     $(CC) $(CFLAGS) -o ship $(LFLAGS1) ship.c $(LFLAGS2)
  62.  
  63. # These symbols, when #defined using -D have these effects on compilation:
  64. # ZMEM        - includes C language versions of memset(), memcpy(), and
  65. #          memcmp() (util.c).
  66. # DIRENT    - use <sys/dirent.h> and getdents() instead of <sys/dir.h>
  67. #          and opendir(), etc. (fileio.c).
  68. # NODIR        - used for 3B1, which has neither getdents() nor opendir().
  69. # NDIR        - use "ndir.h" instead of <sys/dir.h> (fileio.c).
  70. # UTIL        - select routines for utilities (note and split).
  71. # PROTO        - enable function prototypes.
  72. # RMDIR        - remove directories using a system("rmdir ...") call.
  73. # CONVEX    - for Convex make target.
  74. # AIX        - for AIX make target.
  75. # EXPORT    - leave out the encryption code.
  76.  
  77. # BSD 4.3 (also Unisys 7000--AT&T System V with heavy BSD 4.2)
  78. bsd:
  79.     $(MAKE) zips CFLAGS="-O"
  80.  
  81. # BSD, but missing memset(), memcmp().
  82. bsdold:
  83.     $(MAKE) zips CFLAGS="-O -DZMEM"
  84.  
  85. # AT&T System V, Rel 3.  Also SCO, Xenix, OpenDeskTop, ETA-10P*, SGI.
  86. sysv:
  87.     $(MAKE) zips CFLAGS="-O -DDIRENT"
  88.  
  89. # DNIX 5.x: like System V but optimization is messed up.
  90. dnix:
  91.     $(MAKE) zips CFLAGS="-DDIRENT"
  92.  
  93. # Sun OS 4.x: BSD, but use getdents().
  94. sun:
  95.     $(MAKE) zips CFLAGS="-O -DDIRENT"
  96.  
  97. # NeXT 1.0: BSD, but use shared library.
  98. next10:
  99.     $(MAKE) zips CFLAGS="-O" LFLAGS2="-s -lsys_s"
  100.  
  101. # NeXT 2.0: BSD, but use MH_OBJECT format for smaller executables.
  102. next:
  103.     $(MAKE) zips CFLAGS="-O" LFLAGS2="-s -object"
  104.  
  105. # HPUX: System V, but use <ndir.h> and opendir(), etc.
  106. hpux:
  107.     $(MAKE) zips CFLAGS="-O -DNDIR"
  108.  
  109. # Cray Unicos 5.1.10 & 6.0.11, Standard C compiler 2.0
  110. cray:
  111.     $(MAKE) zips CFLAGS="-O -DDIRENT" CC="scc"
  112.  
  113. # AT&T 3B1: System V, but missing a few things.
  114. 3b1:
  115.     $(MAKE) zips CFLAGS="-O -DNODIR -DRMDIR"
  116.  
  117. # zilog zeus 3.21
  118. zilog:
  119.     $(MAKE) zips CFLAGS="-O -DZMEM -DNDIR -DRMDIR" CC="scc -i"
  120.  
  121. # SCO 386 cross compile for MS-DOS
  122. # Note: zip.exe should be lzexe'd on DOS to reduce its size
  123. scodos:
  124.     $(MAKE) zips CFLAGS="-O -Ms -dos -DNO_ASM" LFLAGS1="-Ms -dos" \
  125.      LFLAGS2=""
  126.     $(RENAME) zip zip.exe
  127.  
  128. # A/UX:
  129. aux:
  130.     $(MAKE) zips CFLAGS="-O -DTERMIO"
  131.  
  132. # Convex C220, OS 9.0
  133. convex:
  134.     $(MAKE) zips CFLAGS="-O2 -rl -DCONVEX"
  135.  
  136. # AIX Version 3.1 for RISC System/6000 
  137. aix:
  138.     $(MAKE) zips CC="c89" BIND="c89" \
  139.        CFLAGS="-O -D_POSIX_SOURCE -D_ALL_SOURCE -D_BSD -DAIX"
  140.  
  141. # MINIX 1.5.10 with Bruce Evans 386 patches and gcc/GNU make
  142. minix:
  143.     $(MAKE) zips CFLAGS="-O -DDIRENT -DMINIX" CC=gcc BIND=gcc
  144.     chmem =262144 zip
  145.  
  146. # clean up after making stuff and installing it
  147. clean:
  148.     rm -f *.o
  149.     rm -f zip zipnote zipsplit ship
  150.  
  151. # This one's for my own use during development.
  152. it:
  153.     $(MAKE) zipsman CFLAGS="-O -Wall -DPROTO" LFLAGS2="-s -object"\
  154.     VPATH="${HOME}/Unix/bin"
  155.  
  156. # end of Makefile
  157.