Makefile 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146
  1. ######################################################################
  2. #
  3. # Makefile for Info-ZIP's zip, zipcloak, zipnote, and zipsplit on AtheOS
  4. #
  5. # Copyright (C) 1999-2007 Info-ZIP
  6. # Chris Herborth (chrish@pobox.com)
  7. # Ruslan Nickolaev (nruslan@hotbox.ru)
  8. #
  9. ######################################################################
  10. # Things that don't change:
  11. # Punish people who don't have SMP hardware.
  12. MAKE = make -j 4 -f atheos/Makefile
  13. SHELL = /bin/sh
  14. LN = ln -s
  15. RM = rm -f
  16. BIND = $(CC)
  17. AS = as
  18. INSTALL = install
  19. # Target directories
  20. prefix = /usr
  21. BINDIR = $(prefix)/bin
  22. manext = 1
  23. MANDIR = $(prefix)/man/man$(manext)
  24. ZIPMANUAL = MANUAL
  25. VERSION = Version 2.3 of __DATE__
  26. ######################################################################
  27. CC:=gcc
  28. CFLAGS:=-O3 -march=i586 -Wall -I. -DHAVE_DIRENT_H -DPASSWD_FROM_STDIN -DASMV -DASM_CRC
  29. LFLAGS1:=
  30. LFLAGS2:=
  31. TARGET=$(ZIPS)
  32. ######################################################################
  33. # Helpful targets
  34. all:
  35. $(MAKE) CC=$(CC) CFLAGS="$(CFLAGS)" \
  36. LFLAGS1="$(LFLAGS1)" LFLAGS2="$(LFLAGS2)" \
  37. $(TARGET)
  38. ######################################################################
  39. # Object file lists and other build goodies
  40. # Object file lists
  41. OBJZ = zip.o zipfile.o zipup.o fileio.o util.o globals.o crc32.o crypt.o \
  42. ttyio.o atheos.o
  43. OBJI = deflate.o trees.o
  44. OBJA = match.o crc_i386.o
  45. OBJU = zipfile_.o fileio_.o util_.o globals.o atheos_.o
  46. OBJN = zipnote.o $(OBJU)
  47. OBJC = zipcloak.o $(OBJU) crc32_.o crypt_.o ttyio.o
  48. OBJS = zipsplit.o $(OBJU)
  49. # Headers
  50. ZIP_H = zip.h ziperr.h tailor.h atheos/osdep.h
  51. # What to build?
  52. ZIPS = zip zipnote zipsplit zipcloak
  53. # suffix rules
  54. .SUFFIXES:
  55. .SUFFIXES: _.o .o .c .doc .1
  56. .c_.o:
  57. $(RM) $*_.c; $(LN) $< $*_.c
  58. $(CC) -c $(CFLAGS) -DUTIL $*_.c
  59. $(RM) $*_.c
  60. .c.o:
  61. $(CC) -c $(CFLAGS) $<
  62. .1.doc:
  63. groff -man -Tascii $< > $@
  64. # rules for zip, zipnote, zipcloak, zipsplit, and the Zip MANUAL.
  65. $(OBJZ): $(ZIP_H)
  66. $(OBJI): $(ZIP_H)
  67. $(OBJN): $(ZIP_H)
  68. $(OBJS): $(ZIP_H)
  69. $(OBJC): $(ZIP_H)
  70. zip.o crc32.o crypt.o fileio.o zipfile.o zipup.o: crc32.h
  71. zipcloak.o crc32_.o crypt_.o fileio_.o zipfile_.o: crc32.h
  72. zip.o zipup.o crypt.o ttyio.o zipcloak.o crypt_.o: crypt.h
  73. zip.o zipup.o zipnote.o zipcloak.o zipsplit.o: revision.h
  74. zip.o crypt.o ttyio.o zipcloak.o crypt_.o: ttyio.h
  75. zipup.o: atheos/zipup.h
  76. match.o: match.S
  77. $(CC) -E match.S > matchs.s
  78. $(AS) -o $@ matchs.s
  79. $(RM) matchs.s
  80. crc_i386.o: crc_i386.S
  81. $(CC) -E crc_i386.S > crc_i386s.s
  82. $(AS) -o $@ crc_i386s.s
  83. $(RM) crc_i386s.s
  84. atheos.o: atheos/atheos.c
  85. $(CC) -c $(CFLAGS) atheos/atheos.c
  86. atheos_.o: atheos/atheos.c
  87. $(RM) $*_.c; $(LN) atheos/atheos.c $*_.c
  88. $(CC) -c $(CFLAGS) -DUTIL $*_.c
  89. $(RM) $*_.c
  90. zips: $(ZIPS)
  91. zipsman: $(ZIPS) $(ZIPMANUAL)
  92. zip: $(OBJZ) $(OBJI) $(OBJA)
  93. $(BIND) -o zip $(LFLAGS1) $(OBJZ) $(OBJI) $(OBJA) $(LFLAGS2)
  94. zipnote: $(OBJN)
  95. $(BIND) -o zipnote $(LFLAGS1) $(OBJN) $(LFLAGS2)
  96. zipcloak: $(OBJC)
  97. $(BIND) -o zipcloak $(LFLAGS1) $(OBJC) $(LFLAGS2)
  98. zipsplit: $(OBJS)
  99. $(BIND) -o zipsplit $(LFLAGS1) $(OBJS) $(LFLAGS2)
  100. $(ZIPMANUAL): man/zip.1
  101. groff -man -Tascii man/zip.1 > $(ZIPMANUAL)
  102. # install
  103. install: $(ZIPS)
  104. $(INSTALL) -m755 $(ZIPS) $(BINDIR)
  105. mkdir -p $(MANDIR)
  106. $(INSTALL) -m644 man/zip.1 $(MANDIR)/zip.$(manext)
  107. uninstall:
  108. -cd $(BINDIR); $(RM) $(ZIPS)
  109. -cd $(MANDIR); $(RM) zip.$(manext)
  110. dist: $(ZIPMANUAL)
  111. zip -u9T zip`sed -e '/VERSION/!d' -e 's/.*"\(.*\)".*/\1/' \
  112. -e s/[.]//g -e q revision.h` \
  113. `awk '/^Makefile/,/vms_zip.rnh/ {print $$1}' < contents`
  114. # clean up after making stuff and installing it
  115. clean:
  116. $(RM) *.o $(ZIPS) flags
  117. # end of Makefile