home *** CD-ROM | disk | FTP | other *** search
/ Amiga Format CD 28 / amigaformatcd28.iso / -seriously_amiga- / archivers / mcvertppc / makefile < prev    next >
Makefile  |  1998-04-27  |  3KB  |  119 lines

  1. ## This file is formatted with a tab-width of 3
  2.  
  3. ## See the README file for hints how to configure this Makefile.
  4.  
  5. CSOURCES    = mcvert.c hqxify.c unpack.c
  6. HSOURCES    = mactypes.h
  7. SOURCES     = $(CSOURCES) $(HSOURCES) \
  8.               Makefile README README-conversion mcvert.idraw mcvert.1
  9. MANIFEST    = $(SOURCES) mcvert.man
  10. OBJECTS     = mcvert.o hqxify.o unpack.o $(XOBJ)
  11. ALL         = mcvert mcvert.man
  12. EVERYTHING  = $(ALL) shar mcvert.ps
  13. CLEAN       = $(OBJECTS) $(EVERYTHING)
  14.  
  15. VERSION=216
  16.  
  17. BIN = .
  18.  
  19. ##
  20. ## *LAST* Defintion Always Wins ##
  21. ##
  22.  
  23. ## Note: when using -lnet, AT&T 3B2 fails with undefined symbols like
  24. ##       t_errno first used in /usr/lib/libnet.a
  25. ##    so extract gettod.o and explicitly bind it in
  26.  
  27. ### Extra Objects
  28. # for AT&T 3B2
  29. XOBJ= gettod.o
  30. # common case
  31. XOBJ=
  32.  
  33. ### Bind Time Library Selection
  34. # for SCO UNIX 3.2v4.1 with SCO TCPIP 1.2.0
  35. LIBS= -lsocket
  36. # for most implementations
  37. LIBS=
  38.  
  39. ## Note that ftime() is obsolete, and has been replaced by gettimeofday()
  40. ## so, in general, you should be using -DTIMEVAL
  41. ## but I am not  able  to test this  on all platforms  on all releases,
  42. ## so we leave the aging recipe in place
  43.  
  44. ### Machine CFLAGS
  45. ## for machines with <timeb.h> and ftime() [and maybe without gettimeofday()]
  46. # eg: works for ULTRIX
  47. CFLAGS_M=
  48. ## for machines with ulong pre-defined
  49. CFLAGS_M= -DULONG
  50. # eg: A/UX, SGI's Irix, AT&T 3B2, IBM RS/6000's AIX
  51. CFLAGS_M= -DTIMEVAL -DULONG
  52. ## for machines with gettimeofday() [and maybe without <timeb.h> and ftime()]
  53. # eg: HP-UX 9.01, SunOS 4.1.3, DomainOS 10.4
  54. CFLAGS_M= -DTIMEVAL
  55.  
  56. ### Byteorder(3n) [eg: htonl()] and Byte Manipulation [eg: bzero, bcopy] CFLAGS
  57. # uncommon case -- without support, eg: AT&T 3B2
  58. CFLAGS_N = -DNOBYTEORDER -DNOBZEROBCOPY
  59. # unknown case 1
  60. CFLAGS_N = -DNOBYTEORDER
  61. # unknown case 2
  62. CFLAGS_N = -DNOBZEROBCOPY
  63. # common case -- with support for  both
  64. CFLAGS_N =
  65.  
  66. ### Debugging/Optimization CFLAGS
  67. # debugging
  68. CFLAGS_D = -g
  69. # optimization
  70. CFLAGS_D = -O
  71.  
  72. ### All CFLAGS
  73. CFLAGS=$(CFLAGS_M) $(CFLAGS_N) $(CFLAGS_D) -DVERSION=$(VERSION)
  74.  
  75. ### lint related
  76. LINT=lint
  77. LFLAGS=$(CFLAGS_M) $(CFLAGS_N) -DVERSION=$(VERSION)
  78.  
  79. all: $(ALL)
  80. everything: $(EVERYTHING)
  81.  
  82. mcvert: $(OBJECTS)
  83.     $(CC) $(CFLAGS) $(OBJECTS) $(LIBS) -o $(BIN)/mcvert
  84.  
  85. lint: $(HSOURCES) $(CSOURCES)
  86.     $(LINT) $(LFLAGS) $(CSOURCES) | fgrep -vf lint-ignore
  87.  
  88. $(SOURCES):
  89.     sccs get $@
  90.  
  91. gettod.o:
  92.     ar -xv /usr/lib/libnet.a $@
  93.  
  94. $(OBJECTS): mactypes.h Makefile
  95.  
  96. shar : mcvert-$(VERSION).shar
  97. mcvert-$(VERSION).shar : $(MANIFEST)
  98.     shar $(MANIFEST) > $@
  99.     @nawk 'length($0) > 80 {exit(1)}' $@ || { make check_linelen; false; }
  100.  
  101. # we punt the issue of expanding tabs
  102. check_linelen: $(MANIFEST)
  103.     @nawk 'length($0) >= 80 { printf "%s: %d: ", FILENAME, FNR; print }' \
  104.         $(MANIFEST)
  105.  
  106. clean:
  107.     rm -f $(CLEAN)
  108.  
  109. man: mcvert.man
  110. mcvert.man: mcvert.1
  111.     nroff -man mcvert.1 | col | sed 's/.//g' | expand > $@
  112. mcvert.ps: mcvert.1
  113.     groff -man mcvert.1 > $@
  114.  
  115. F=mcvert-$(VERSION).shar
  116. info:
  117.     @for todo in "ls -l" "head -3" "tail -3" sum wc; do \
  118.         echo $$todo $F; $$todo $F | sed 's/^/    /'; done
  119.