Makefile 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111
  1. # Makefile for Zip, ZipNote, ZipCloak and ZipSplit
  2. MAKE = make
  3. SHELL = /bin/sh
  4. # (to use the Gnu compiler, change cc to gcc in CC and BIND)
  5. CC = cc
  6. BIND = $(CC)
  7. AS = $(CC) -c
  8. E =
  9. CPP = /lib/cpp
  10. # probably can change this to 'install' if you have it
  11. INSTALL = cp
  12. # target directories - where to install executables and man pages to
  13. BINDIR = /usr/local/bin
  14. manext=1
  15. MANDIR = /usr/local/man/man$(manext)
  16. # flags
  17. # CFLAGS flags for C compile
  18. # LFLAGS1 flags after output file spec, before obj file list
  19. # LFLAGS2 flags after obj file list (libraries, etc)
  20. CFLAGS = -O
  21. LFLAGS1 =
  22. LFLAGS2 = -s
  23. # object file lists
  24. OBJZ = zip.o zipfile.o zipup.o fileio.o util.o crc32.o globals.o \
  25. crypt.o ttyio.o atari.o
  26. OBJI = deflate.o trees.o
  27. OBJA =
  28. OBJU = zipfile_.o fileio_.o util_.o globals.o atari_.o
  29. OBJN = zipnote.o $(OBJU)
  30. OBJC = zipcloak.o $(OBJU) crc32_.o crypt_.o ttyio.o
  31. OBJS = zipsplit.o $(OBJU)
  32. ZIP_H = zip.h ziperr.h tailor.h atari/osdep.h
  33. # suffix rules
  34. .SUFFIXES:
  35. .SUFFIXES: _.o .o .c .doc .1
  36. .c_.o:
  37. rm -f $*_.c; ln $< $*_.c
  38. $(CC) $(CFLAGS) -DUTIL -c $*_.c
  39. rm -f $*_.c
  40. .c.o:
  41. $(CC) $(CFLAGS) -c $<
  42. .1.doc:
  43. nroff -man $< | col -b | uniq > $@
  44. # rules for zip, zipnote, zipcloak, zipsplit, and the Zip MANUAL.
  45. $(OBJZ): $(ZIP_H)
  46. $(OBJI): $(ZIP_H)
  47. $(OBJN): $(ZIP_H)
  48. $(OBJS): $(ZIP_H)
  49. $(OBJC): $(ZIP_H)
  50. zip.o crc32.o crypt.o fileio.o zipfile.o zipup.o: crc32.h
  51. zipcloak.o crc32_.o crypt_.o fileio_.o zipfile_.o: crc32.h
  52. zip.o zipup.o crypt.o ttyio.o zipcloak.o crypt_.o: crypt.h
  53. zip.o zipup.o zipnote.o zipcloak.o zipsplit.o: revision.h
  54. zip.o crypt.o ttyio.o zipcloak.o crypt_.o: ttyio.h
  55. zipup.o: atari/zipup.h
  56. match.o: match.s
  57. $(CPP) match.s > _match.s
  58. $(AS) _match.s
  59. mv _match.o match.o
  60. rm -f _match.s
  61. ZIPS = zip$E zipnote$E zipsplit$E zipcloak$E
  62. zips: $(ZIPS)
  63. zipsman: $(ZIPS) $(ZIPMANUAL)
  64. zip$E: $(OBJZ) $(OBJI) $(OBJA)
  65. $(BIND) -o zip$E $(LFLAGS1) $(OBJZ) $(OBJI) $(OBJA) $(LFLAGS2)
  66. zipnote$E: $(OBJN)
  67. $(BIND) -o zipnote$E $(LFLAGS1) $(OBJN) $(LFLAGS2)
  68. zipcloak$E: $(OBJC)
  69. $(BIND) -o zipcloak$E $(LFLAGS1) $(OBJC) $(LFLAGS2)
  70. zipsplit$E: $(OBJS)
  71. $(BIND) -o zipsplit$E $(LFLAGS1) $(OBJS) $(LFLAGS2)
  72. $(ZIPMANUAL): man/zip.1
  73. nroff -man man/zip.1 | col -b | uniq > $(ZIPMANUAL)
  74. # install
  75. install: $(ZIPS)
  76. $(INSTALL) $(ZIPS) $(BINDIR)
  77. $(INSTALL) man/zip.1 $(MANDIR)/zip.$(manext)
  78. uninstall:
  79. -cd $(BINDIR); rm -f $(ZIPS)
  80. -cd $(MANDIR); rm -f zip.$(manext)
  81. dist: $(ZIPMANUAL)
  82. zip -u9T zip`sed -e '/VERSION/!d' -e 's/.*"\(.*\)".*/\1/' \
  83. -e s/[.]//g -e q revision.h` \
  84. `awk '/^Makefile/,/vms_zip.rnh/ {print $$1}' < contents`
  85. # ATARI version (gcc 2.5.8 and Mintlibs PL46)
  86. atari:
  87. $(MAKE) zips CFLAGS="-O -DATARI" OBJA=atari/atari.o CC=gcc E=.ttp
  88. # clean up after making stuff and installing it
  89. clean:
  90. rm -f *.o $(ZIPS) flags