home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 9 Archive / 09-Archive.zip / zip21.zip / atari / Makefile < prev    next >
Makefile  |  1996-04-01  |  3KB  |  108 lines

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