home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 9 Archive / 09-Archive.zip / zip22.zip / qdos / Makefile.qlzip < prev    next >
Makefile  |  1997-10-24  |  4KB  |  140 lines

  1. # Makefile for Zip, ZipNote, ZipCloak and ZipSplit
  2.  
  3. # what you can make ...
  4. all: zip
  5.  
  6. #MAKE = make -f unix/Makefile
  7. SHELL = /bin/sh
  8.  
  9. # (to use the Gnu compiler, change cc to gcc in CC and BIND)
  10. CC = cc
  11. BIND = $(CC)
  12. AS = $(CC) -c
  13. E =
  14. CPP = /lib/cpp
  15.  
  16. # probably can change this to 'install' if you have it
  17. INSTALL = cp
  18.  
  19. # target directories - where to install executables and man pages to
  20. prefix = /usr/local
  21. BINDIR = $(prefix)/bin
  22. manext=1
  23. MANDIR = $(prefix)/man/man$(manext)
  24. ZIPMANUAL = MANUAL
  25.  
  26. # flags
  27. #   CFLAGS    flags for C compile
  28. #   LFLAGS1   flags after output file spec, before obj file list
  29. #   LFLAGS2   flags after obj file list (libraries, etc)
  30. CFLAGS = -O2 -fno-strength-reduce -I. -DUNIX -DQLZIP -DASM_CRC
  31. LFLAGS1 =
  32. LFLAGS2 = -s
  33.  
  34. # object file lists
  35. OBJZ = zip.o zipfile.o zipup.o fileio.o util.o globals.o crypt.o ttyio.o \
  36.        unix.o crc_gcc.o crctab.o qdos.o
  37. OBJI = deflate.o trees.o bits.o
  38. OBJA =
  39. OBJU = zipfile_.o fileio_.o util_.o globals.o unix_.o
  40. OBJN = zipnote.o  $(OBJU)
  41. OBJC = zipcloak.o $(OBJU) crctab.o crypt_.o ttyio.o
  42. OBJS = zipsplit.o $(OBJU)
  43.  
  44. ZIP_H = zip.h ziperr.h tailor.h unix/osdep.h
  45.  
  46. # suffix rules
  47. .SUFFIXES:
  48. .SUFFIXES: _.o .o .c .doc .1
  49. .c_.o:
  50.     rm -f $*_.c; ln $< $*_.c
  51.     $(CC) -c $(CFLAGS) -DUTIL $*_.c
  52.     rm -f $*_.c
  53. .c.o:
  54.     $(CC) -c $(CFLAGS) $<
  55.  
  56. .1.doc:
  57.     nroff -man $< | col -b | uniq > $@
  58.  
  59. # rules for zip, zipnote, zipcloak, zipsplit, and the Zip MANUAL.
  60. $(OBJZ): $(ZIP_H)
  61. $(OBJI): $(ZIP_H)
  62. $(OBJN): $(ZIP_H)
  63. $(OBJS): $(ZIP_H)
  64. $(OBJC): $(ZIP_H)
  65. zip.o zipup.o crypt.o ttyio.o bits.o zipcloak.o crypt_.o: crypt.h
  66. zip.o zipup.o zipnote.o zipcloak.o zipsplit.o: revision.h
  67. zip.o crypt.o ttyio.o zipcloak.o crypt_.o: ttyio.h
  68. zipup.o: unix/zipup.h
  69.  
  70. match.o: match.S
  71.     $(CPP) match.S > _match.s
  72.     $(AS) _match.s
  73.     mv _match.o match.o
  74.     rm -f _match.s
  75.  
  76. unix.o: unix/unix.c
  77.     $(CC) -c $(CFLAGS) unix/unix.c
  78.  
  79. unix_.o: unix/unix.c
  80.     rm -f $*_.c; ln unix/unix.c $*_.c
  81.     $(CC) -c $(CFLAGS) -DUTIL $*_.c
  82.     rm -f $*_.c
  83.  
  84. qdos.o: qdos/qdos.c
  85.     $(CC) -c $(CFLAGS) qdos/qdos.c
  86.  
  87. crc_gcc.o: crc_i386.S            # 32bit, GNU AS
  88.     gcc -O3 -I. -DASM_CRC -Di386 -x assembler-with-cpp -c -o $@ crc_i386.S
  89.  
  90. ZIPS = zip$E zipnote$E zipsplit$E zipcloak$E
  91.  
  92. zips: $(ZIPS)
  93. zipsman: $(ZIPS) $(ZIPMANUAL)
  94.  
  95. zip$E: $(OBJZ) $(OBJI) $(OBJA)
  96.     $(BIND) -o qlzip$E $(LFLAGS1) $(OBJZ) $(OBJI) $(OBJA) $(LFLAGS2)
  97. zipnote$E: $(OBJN)
  98.     $(BIND) -o zipnote$E $(LFLAGS1) $(OBJN) $(LFLAGS2)
  99. zipcloak$E: $(OBJC)
  100.     $(BIND) -o zipcloak$E $(LFLAGS1) $(OBJC) $(LFLAGS2)
  101. zipsplit$E: $(OBJS)
  102.     $(BIND) -o zipsplit$E $(LFLAGS1) $(OBJS) $(LFLAGS2)
  103.  
  104. $(ZIPMANUAL): man/zip.1
  105.     nroff -man man/zip.1 | col -b | uniq > $(ZIPMANUAL)
  106.  
  107. # install
  108. install:        $(ZIPS)
  109.     $(INSTALL) $(ZIPS) $(BINDIR)
  110.     $(INSTALL) man/zip.1 $(MANDIR)/zip.$(manext)
  111.  
  112. uninstall:
  113.     -cd $(BINDIR); rm -f $(ZIPS)
  114.     -cd $(MANDIR); rm -f zip.$(manext)
  115.  
  116. dist:
  117.     zip -u9T zip`sed -e '/VERSION/!d' -e 's/.*"\(.*\)".*/\1/' \
  118.               -e s/[.]//g -e q revision.h` \
  119.       `awk '/^Makefile/,/vms_zip.rnh/ {print $$1}' < contents`
  120.  
  121. flags:  unix/configure
  122.     sh unix/configure "${CC}" "${CFLAGS}"
  123.  
  124. # These symbols, when #defined using -D have these effects on compilation:
  125. # ZMEM                  - includes C language versions of memset(), memcpy(),
  126. #                         and memcmp() (util.c).
  127. # HAVE_DIRENT_H         - use <dirent.h> instead of <sys/dir.h>
  128. # NODIR                 - for 3B1, which has neither getdents() nor opendir().
  129. # HAVE_NDIR_H           - use <ndir.h> (unix/unix.c).
  130. # HAVE_SYS_DIR_H        - use <sys/dir.h>
  131. # HAVE_SYS_NDIR_H       - use <sys/ndir.h>
  132. # UTIL                  - select routines for utilities (note, cloak, split)
  133. # NO_RMDIR              - remove directories using a system("rmdir ...") call.
  134. # NO_PROTO              - cannot handle ANSI prototypes
  135. # NO_CONST              - cannot handle ANSI const
  136.  
  137. #               Generic targets:
  138.  
  139. # end of Makefile
  140.