Makefile.qlzip 3.8 KB

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