home *** CD-ROM | disk | FTP | other *** search
/ Fish 'n' More 2 / fishmore-publicdomainlibraryvol.ii1991xetec.iso / dirs / mkid_448.lzh / Mkid / src / Makefile.unix < prev    next >
Makefile  |  1991-02-01  |  4KB  |  124 lines

  1. #!/bin/make -f
  2.  
  3. # Copyright (c) 1986, Greg McGary
  4. # @(#)makefile    1.3 86/11/06
  5.  
  6. # --------------------------------------------------------------------
  7. # System Dependent Configuration:
  8. #   Choose a pre-packaged set of options below, or roll your own.
  9. #   The relevant options are as follows:
  10. #
  11. # * To use under unix, you MUST define '-DUNIX' in DEFS.
  12. #
  13. # * If you have the `PW' library which includes the regular-expression
  14. #   funcions regcmp(3) and regex(3), then use `-DREGEX' in DEFS, and
  15. #   `-lPW' in LIBS.  If you have the regular-expression functions
  16. #   re_comp(3) and re_exec(3), use `-DRE_EXEC' in DEFS.  If you don't
  17. #   have any regular-expression functions, don't add either to DEFS.
  18. #
  19. # * If you do not have the 4.2 directory access libraries, add `-lndir'
  20. #   to LIBS, and define `-DNDIR' in DEFS. 
  21. #
  22. # * If your string libraries have index(3) and rindex(3) instead of
  23. #   strchr(3) and strrchr(3), use `-DRINDEX' in DEFS.
  24. #
  25. # * If your compiler chokes on pointers to functions returning void,
  26. #   use `-Dvoid=int' in DEFS.
  27. #
  28. # * If you have setlinebuf(3) in your stdio to set line-buffering on
  29. #   a stream, use `-DERRLINEBUF' in DEFS.
  30. #
  31. # * If you have a System-III/V terminal driver, define `TERMIO' in DEFS.
  32. #
  33. # * If you have ranlib(1), define `RANLIB' as such.  If you don't have
  34. #   it, set `RANLIB' to something harmless like `@:', or `echo'
  35. # --------------------------------------------------------------------
  36.  
  37. # DEFS    =    -DUNIX -DREGEX -DNDIR -DTERMIO          # typical System-V defs
  38. # DEFS    =    -DUNIX -Dvoid=int -DRINDEX -DRE_EXEC -DNDIR   # typical V7 defs
  39. DEFS    =    -DUNIX -Dvoid=int -DRINDEX -DRE_EXEC -DERRLINEBUF    # BSD defs
  40.  
  41. # LIBS    =    -lndir -lPW    # typical System-V libs
  42. # LIBS    =    -lndir    # typical V7 libs
  43. LIBS    =    # typical BSD libs (none)
  44.  
  45. #RANLIB    =    @:    # system doesn't have ranlib (Sys-V)
  46. RANLIB    =    ranlib    # system has ranlib (typically V7 & BSD)
  47.  
  48. # --------------------------------------------------------------------
  49. # Compilation / Loading options:
  50. #   Choose options to generate a system as an installed product,
  51. #   for debugging, or for performance profiling.
  52. # --------------------------------------------------------------------
  53.  
  54. # CCFLG    =    -g -DDEBUG     # debugging
  55. # CCFLG    =    -p    # profiling
  56. CCFLG    =    -O    # production
  57.  
  58. # LDFLG    =    -g    # debugging
  59. # LDFLG    =    -p    # profiling
  60. LDFLG    =    # production
  61.  
  62. # --------------------------------------------------------------------
  63.  
  64. SHELL =        /bin/sh
  65. TARGETS =    libid.a $(PROGS)
  66. PROGS =        mkid lid idx fid $(LIDLINKS)
  67. DESTINATION_DIR = /usr/local
  68.  
  69. LIDLINKS =     gid aid eid
  70. CFLAGS =    $(CCFLG) -I. $(DEFS)
  71. LDFLAGS =    $(LDFLG) libid.a $(LIBS)
  72.  
  73. OFILES =    init.o getscan.o scan-c.o scan-asm.o bsearch.o hash.o \
  74.         bitops.o basename.o gets0.o getsFF.o paths.o opensrc.o \
  75.         stoi.o uerror.o document.o bitcount.o wmatch.o bitsvec.o \
  76.         tty.o bzero.o
  77.  
  78. # --------------------------------------------------------------------
  79.  
  80. all:        $(TARGETS)
  81.  
  82. libid.a:    $(OFILES)
  83.         ar rv $@ $?
  84.         $(RANLIB) $@
  85.  
  86. mkid:        mkid.o libid.a
  87.         $(CC) -o $@ $@.o $(LDFLAGS)
  88.  
  89. fid:        fid.o libid.a
  90.         $(CC) -o $@ $@.o $(LDFLAGS)
  91.  
  92. lid:        lid.o libid.a
  93.         $(CC) -o $@ $@.o $(LDFLAGS)
  94.  
  95. idx:        idx.o libid.a
  96.         $(CC) -o $@ $@.o $(LDFLAGS)
  97.  
  98. $(LIDLINKS): lid
  99.         -/bin/rm -f $@
  100.         ln lid $@
  101.  
  102. install:    $(PROGS)
  103.         mv $(PROGS) $(DESTINATION_DIR)
  104.  
  105. clean:
  106.         rm -f $(TARGETS) *.o
  107.  
  108. id.tar:
  109.         cd ..; tar cvbf 20 id/id.tar id/*.[ch1-8] id/makefile id/TODO id/TUTORIAL
  110.  
  111. id.tar.Z:    id.tar
  112.         compress -b 14 <id.tar >id.tar.Z
  113.  
  114. id.shar:    id.shar-1 id.shar-2 id.shar-3
  115.  
  116. id.shar-1:
  117.         shar $(SHARFLAGS) TUTORIAL TODO makefile *.h *.[1-8] >$@
  118.  
  119. id.shar-2:
  120.         shar $(SHARFLAGS) [a-l]*.c >$@
  121.  
  122. id.shar-3:
  123.         shar $(SHARFLAGS) [m-z]*.c >$@
  124.