home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 11 Util / 11-Util.zip / LESS177.ZIP / src / makefile < prev    next >
Makefile  |  1992-07-18  |  5KB  |  160 lines

  1. # Makefile for "less"
  2. # Generated Wed Jun 10 19:52:11 CDT 1992 by linstall.
  3. #
  4. # Invoked as:
  5. #    make all
  6. #   or    make install
  7. # Plain "make" is equivalent to "make all".
  8. #
  9. # If you add or delete functions, remake funcs.h by doing:
  10. #    make newfuncs
  11. # This depends on the coding convention of function headers looking like:
  12. #    " \t public <function-type> \n <function-name> ( ... ) "
  13. #
  14. # Also provided:
  15. #    make lint    # Runs "lint" on all the sources.
  16. #    make clean    # Removes "less" and the .o files.
  17. #    make clobber    # Pretty much the same as make "clean".
  18.  
  19. SHELL = /bin/sh
  20.  
  21.  
  22. ##########################################################################
  23. # Compilation environment.
  24. ##########################################################################
  25.  
  26. # LIBS is the list of libraries needed.
  27. #LIBS = -ltermcap
  28. LIBS = -ltermc
  29.  
  30. # INSTALL_LESS is a list of the public versions of less.
  31. # INSTALL_KEY is a list of the public versions of lesskey.
  32. # INSTALL_HELP is a list of the public version of the help file.
  33. # INSTALL_LESSMAN is a list of the public versions of the less manual page.
  34. # INSTALL_KEYMAN is a list of the public versions of the lesskey manual page.
  35. INSTALL_LESS =        $(ROOT)/usr/local/bin/less.exe
  36. INSTALL_KEY =        $(ROOT)/usr/local/bin/lesskey.exe
  37. INSTALL_HELP =        $(ROOT)/usr/local/bin/less.hlp
  38. INSTALL_LESSMAN =    $(ROOT)/usr/man/man1/less.1
  39. INSTALL_KEYMAN =    $(ROOT)/usr/man/man1/lesskey.1
  40. LESS_MANUAL =        less.nro
  41. KEY_MANUAL =        lesskey.nro
  42. HELPFILE =        less.hlp
  43.  
  44.  
  45. # OPTIM is passed to the compiler and the loader.
  46. # It is normally "-O" but may be, for example, "-g".
  47. OPTIM = -O2
  48.  
  49. CFLAGS = $(OPTIM) -DOS2
  50.  
  51.  
  52.  
  53. ##########################################################################
  54. # Files
  55. ##########################################################################
  56.  
  57. SRC1 =    ch.c cmdbuf.c command.c decode.c help.c input.c 
  58. SRC2 =    line.c linenum.c edit.c option.c optfunc.c \
  59.     opttbl.c os.c 
  60. SRC3 =    charset.c filename.c lsystem.c output.c position.c ifile.c \
  61.     brac.c forwback.c jump.c search.c main.c vecho.c glob.c
  62. SRC4 =    mark.c prompt.c screen.c signal.c tags.c ttyin.c version.c regex.c
  63.  
  64. SRC =    $(SRC1) $(SRC2) $(SRC3) $(SRC4)
  65.  
  66. OBJ =    brac.o ch.o charset.o cmdbuf.o command.o decode.o edit.o filename.o \
  67.     forwback.o help.o input.o jump.o line.o linenum.o \
  68.     lsystem.o option.o optfunc.o opttbl.o os.o \
  69.     output.o position.o mark.o ifile.o prompt.o screen.o \
  70.     search.o signal.o tags.o ttyin.o version.o regex.o
  71.  
  72. OBJ2 = main.o glob.o
  73.  
  74. ##########################################################################
  75. # Rules for building stuff
  76. ##########################################################################
  77.  
  78. all: less.exe lesskey.exe vecho.exe
  79. install: install_less install_help install_key install_lman install_kman
  80.  
  81. less.exe: $(OBJ) $(OBJ2)
  82.     $(CC) $(LDFLAGS) $(OBJ) $(OBJ2) $(LIBS) $(LDLIBS)
  83.     strip a.out
  84.     emxbind \emx\bin\emxl.exe a.out less.exe -c
  85.     del a.out
  86.  
  87. lesskey.exe: lesskey.o
  88.     $(CC) $(LDFLAGS) lesskey.o $(LDLIBS)
  89.     strip a.out
  90.     emxbind \emx\bin\emxl.exe a.out lesskey.exe -c
  91.     del a.out
  92.  
  93. vecho.exe: vecho.o glob.o
  94.     $(CC) vecho.o glob.o
  95.     strip a.out
  96.     emxbind \emx\bin\emxl.exe a.out vecho.exe -c
  97.     del a.out
  98.  
  99. install_less: less
  100.     for f in $(INSTALL_LESS); do  rm -f $$f; cp less $$f;  done
  101.     touch install_less
  102.  
  103. install_key: lesskey
  104.     for f in $(INSTALL_KEY); do  rm -f $$f; cp lesskey $$f;  done
  105.     touch install_key
  106.  
  107. install_help: less.hlp
  108.     for f in $(INSTALL_HELP); do  rm -f $$f; cp less.hlp $$f;  done
  109.     touch install_help
  110.  
  111. install_lman: $(LESS_MANUAL) 
  112.     for f in $(INSTALL_LESSMAN); do  rm -f $$f; cp $(LESS_MANUAL) $$f;  done
  113.     touch install_lman
  114.  
  115. install_kman: $(KEY_MANUAL)
  116.     for f in $(INSTALL_KEYMAN); do  rm -f $$f; cp $(KEY_MANUAL) $$f;  done
  117.     touch install_kman
  118.  
  119. ##########################################################################
  120. # Maintenance
  121. ##########################################################################
  122.  
  123. lint:
  124.     lint -hp $(SRC)
  125.  
  126. newfuncs funcs.h:
  127.     if [ -f funcs.h ]; then mv funcs.h funcs.h.OLD; fi
  128.     awk -f mkfuncs.awk $(SRC) >funcs.h
  129.  
  130. clean:
  131.     rm -f $(OBJ) lesskey.o less lesskey vecho.exe
  132.  
  133. clobber:
  134.     rm -f *.o less lesskey vecho install_less install_key \
  135.         install_help install_lman install_kman
  136.  
  137. shar:
  138.     shar -v README CHANGES linstall \
  139.         less.nro lesskey.nro \
  140.         vecho.c mkfuncs.awk > less1.shr
  141.     shar -v less.man lesskey.man \
  142.         less.h position.h cmd.h option.h > less2.shr 
  143.     shar -v lesskey.c $(SRC1) > less3.shr
  144.     shar -v $(SRC2) > less4.shr
  145.     shar -v $(SRC3) less.hlp > less5.shr
  146.     shar -v $(SRC4) funcs.h > less6.shr
  147.  
  148.  
  149. ##########################################################################
  150. # Dependencies
  151. ##########################################################################
  152.  
  153. $(OBJ) $(OBJ2): less.h funcs.h defines.h position.h regex.h
  154. command.o decode.o: cmd.h
  155. option.o opttbl.o optfunc.o: option.h
  156. $(OBJ2): glob.h
  157.  
  158. lesskey.o: less.h funcs.h defines.h cmd.h
  159.  
  160. vecho.o: glob.h