home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 October / usenetsourcesnewsgroupsinfomagicoctober1994disk2.iso / unix / volume6 / less.patch / makefile.bsd41 < prev    next >
Encoding:
Makefile  |  1986-11-30  |  5.2 KB  |  172 lines

  1. # Makefile for "less"
  2. #
  3. # Invoked as:
  4. #    make all
  5. #   or    make install
  6. # Plain "make" is equivalent to "make all".
  7. #
  8. # If you add or delete functions, remake funcs.h by doing:
  9. #    make newfuncs
  10. # This depends on the coding convention of function headers looking like:
  11. #    " \t public <function-type> \n <function-name> ( ... ) "
  12. #
  13. # Also provided:
  14. #    make lint    # Runs "lint" on all the sources.
  15. #    make clean    # Removes "less" and the .o files.
  16. #    make clobber    # Pretty much the same as make "clean".
  17. #
  18. #    make pager_patch        # makes PAGER environment variable
  19. #    make install_pager_patch    # catcher and installs it (see below)
  20.  
  21. ##########################################################################
  22. # System-specific parameters
  23. ##########################################################################
  24.  
  25. # Define XENIX if running under XENIX 3.0
  26. XENIX = 0
  27.  
  28. # VOID is 1 if your C compiler supports the "void" type,
  29. # 0 if it does not.
  30. VOID = 1
  31.  
  32. # off_t is the type which lseek() returns.
  33. # It is also the type of lseek()'s second argument.
  34. off_t = long
  35.  
  36. # TERMIO is 1 if your system has /usr/include/termio.h.
  37. # This is normally the case for System 5.
  38. # If TERMIO is 0 your system must have /usr/include/sgtty.h.
  39. # This is normally the case for BSD.
  40. TERMIO = 0
  41.  
  42. # SIGSETMASK is 1 if your system has the sigsetmask() call.
  43. # This is normally the case only for BSD 4.2,
  44. # not for BSD 4.1 or System 5.
  45. SIGSETMASK = 0
  46.  
  47.  
  48. ##########################################################################
  49. # Optional and semi-optional features
  50. ##########################################################################
  51.  
  52. # REGCMP is 1 if your system has the regcmp() function.
  53. # This is normally the case for System 5.
  54. # RECOMP is 1 if your system has the re_comp() function.
  55. # This is normally the case for BSD.
  56. # If neither is 1, pattern matching is supported, but without metacharacters.
  57. REGCMP = 0
  58. RECOMP = 1
  59.  
  60. # SHELL_ESCAPE is 1 if you wish to allow shell escapes.
  61. # (This is possible only if your system supplies the system() function.)
  62. SHELL_ESCAPE = 0
  63.  
  64. # EDITOR is 1 if you wish to allow editor invocation (the "v" command).
  65. # (This is possible only if your system supplies the system() function.)
  66. # EDIT_PGM is the name of the (default) editor to be invoked.
  67. EDITOR = 0
  68. EDIT_PGM = /usr/ucb/vi
  69.  
  70. # parameters to "make install_pager_patch".  OLD_PAGER will be moved to
  71. # OLD_PAGER_NEW_LOCATION and pager_patch (in this directory) will be installed
  72. # as OLD_PAGER.  This patch will allow you to set the environment variable
  73. # PAGER to specify your personal pager preference (is this a security hole?)
  74. OLD_PAGER = /usr/ucb/more
  75. OLD_PAGER_NEW_LOCATION = /usr/ucb/More
  76.  
  77. # ONLY_RETURN is 1 if you want RETURN to be the only input which
  78. # will continue past an error message.
  79. # Otherwise, any key will continue past an error message.
  80. ONLY_RETURN = 0
  81.  
  82.  
  83. ##########################################################################
  84. # Compilation environment.
  85. ##########################################################################
  86.  
  87. # LIBS is the list of libraries needed.
  88. LIBS = -ltermcap
  89.  
  90. # INSTALL_LESS is a list of the public versions of less.
  91. # INSTALL_MAN is a list of the public versions of the manual page.
  92. INSTALL_LESS =    /usr/local/less
  93. INSTALL_MAN =    /usr/man/manl/less.l
  94.  
  95. # OPTIM is passed to the compiler and the loader.
  96. # It is normally "-O" but may be, for example, "-g".
  97. OPTIM = -O
  98.  
  99.  
  100. ##########################################################################
  101. # Files
  102. ##########################################################################
  103.  
  104. SRC1 =    main.c option.c prim.c 
  105. SRC2 =    ch.c position.c input.c output.c screen.c \
  106.     prompt.c line.c signal.c help.c ttyin.c command.c version.c
  107. SRC =    $(SRC1) $(SRC2)
  108. OBJ =    main.o option.o prim.o ch.o position.o input.o output.o screen.o \
  109.     prompt.o line.o signal.o help.o ttyin.o command.o version.o
  110.  
  111.  
  112. ##########################################################################
  113. # Rules
  114. ##########################################################################
  115.  
  116. DEFS =    "-DTERMIO=$(TERMIO)" \
  117.     "-DSIGSETMASK=$(SIGSETMASK)" \
  118.     "-Doff_t=$(off_t)" "-DVOID=$(VOID)" \
  119.     "-DREGCMP=$(REGCMP)" "-DRECOMP=$(RECOMP)" \
  120.     "-DSHELL_ESCAPE=$(SHELL_ESCAPE)" \
  121.     "-DEDITOR=$(EDITOR)" "-DEDIT_PGM=\"$(EDIT_PGM)\"" \
  122.     "-DONLY_RETURN=$(ONLY_RETURN)" \
  123.     "-DXENIX=$(XENIX)" \
  124.     "-DOLD_PAGER_NEW_LOCATION=\"$(OLD_PAGER_NEW_LOCATION)\""
  125.  
  126. CFLAGS = $(OPTIM) $(DEFS)
  127.  
  128.  
  129. all: less
  130.  
  131. less: $(OBJ)
  132.     cc $(OPTIM) -o less $(OBJ) $(LIBS)
  133.  
  134. install: install_man install_less
  135.  
  136. install_man: less.l
  137.     for f in $(INSTALL_MAN); do  rm -f $$f; cp less.l $$f;  done
  138.     touch install_man
  139.     
  140. install_less: less
  141.     for f in $(INSTALL_LESS); do  rm -f $$f; cp less $$f;  done
  142.     touch install_less
  143.  
  144. pager_patch: pager_patch.c
  145.     cc $(CFLAGS) -s -o pager_patch pager_patch.c
  146.  
  147. install_pager_patch: pager_patch
  148.     if [ -s $(OLD_PAGER) -a ! -s $(OLD_PAGER_NEW_LOCATION) ]; then \
  149.         mv $(OLD_PAGER) $(OLD_PAGER_NEW_LOCATION); \
  150.         cp pager_patch $(OLD_PAGER); \
  151.     fi
  152.     touch install_pager_patch
  153.  
  154. $(OBJ): less.h funcs.h
  155.  
  156. lint:
  157.     lint -hp $(DEFS) $(SRC)
  158.  
  159. newfuncs:
  160.     mv funcs.h funcs.h.OLD
  161.     awk -f mkfuncs.awk $(SRC) >funcs.h
  162.  
  163. clean:
  164.     rm -f $(OBJ) less pager_patch
  165.  
  166. clobber:
  167.     rm -f *.o less pager_patch install_less install_man install_pager_patch
  168.  
  169. shar:
  170.     shar -v INSTALLATION less.l makefile.* *.h *.awk $(SRC1) > less.shar.a
  171.     shar -v $(SRC2) pager_patch.c > less.shar.b
  172.