Updated docs/README-ATTACHMENTS, mainly to reflect that no setup is
[mmh] / docs / historical / mh-6.8.5 / miscellany / less-177 / makefile
1 # Makefile for "less"
2 # Generated Sun Aug 16 09:47:26 PDT 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
29 # INSTALL_LESS is a list of the public versions of less.
30 # INSTALL_KEY is a list of the public versions of lesskey.
31 # INSTALL_HELP is a list of the public version of the help file.
32 # INSTALL_LESSMAN is a list of the public versions of the less manual page.
33 # INSTALL_KEYMAN is a list of the public versions of the lesskey manual page.
34 INSTALL_LESS =          $(ROOT)/usr/local/bin/less
35 INSTALL_KEY =           $(ROOT)/usr/local/bin/lesskey
36 INSTALL_HELP =          $(ROOT)/usr/local/bin/less.hlp
37 INSTALL_LESSMAN =       $(ROOT)/usr/local/man/man1/less.1
38 INSTALL_KEYMAN =        $(ROOT)/usr/local/man/man1/lesskey.1
39 LESS_MANUAL =           less.nro
40 KEY_MANUAL =            lesskey.nro
41 HELPFILE =              /usr/local/bin/less.hlp
42
43
44 # OPTIM is passed to the compiler and the loader.
45 # It is normally "-O" but may be, for example, "-g".
46 OPTIM = -O
47
48 CFLAGS = $(OPTIM)
49
50
51
52 ##########################################################################
53 # Files
54 ##########################################################################
55
56 SRC1 =  ch.c cmdbuf.c command.c decode.c help.c input.c 
57 SRC2 =  line.c linenum.c main.c edit.c option.c optfunc.c \
58         opttbl.c os.c 
59 SRC3 =  charset.c filename.c lsystem.c output.c position.c ifile.c \
60         brac.c forwback.c jump.c search.c 
61 SRC4 =  mark.c prompt.c screen.c signal.c tags.c ttyin.c version.c
62
63 SRC =   $(SRC1) $(SRC2) $(SRC3) $(SRC4)
64
65 OBJ =   brac.o ch.o charset.o cmdbuf.o command.o decode.o edit.o filename.o \
66         forwback.o help.o input.o jump.o line.o linenum.o \
67         lsystem.o main.o option.o optfunc.o opttbl.o os.o \
68         output.o position.o mark.o ifile.o prompt.o screen.o \
69         search.o signal.o tags.o ttyin.o version.o
70
71
72 ##########################################################################
73 # Rules for building stuff
74 ##########################################################################
75
76 all: less lesskey
77 install: install_less install_help install_key install_lman install_kman
78
79 less: $(OBJ)
80         $(CC) $(LDFLAGS) $(OPTIM) -o less $(OBJ) $(LIBS) $(LDLIBS)
81
82 lesskey: lesskey.o
83         $(CC) $(LDFLAGS) $(OPTIM) -o lesskey lesskey.o $(LDLIBS)
84
85 install_less: less
86         for f in $(INSTALL_LESS); do  rm -f $$f; cp less $$f;  done
87         touch install_less
88
89 install_key: lesskey
90         for f in $(INSTALL_KEY); do  rm -f $$f; cp lesskey $$f;  done
91         touch install_key
92
93 install_help: less.hlp
94         for f in $(INSTALL_HELP); do  rm -f $$f; cp less.hlp $$f;  done
95         touch install_help
96
97 install_lman: $(LESS_MANUAL) 
98         for f in $(INSTALL_LESSMAN); do  rm -f $$f; cp $(LESS_MANUAL) $$f;  done
99         touch install_lman
100
101 install_kman: $(KEY_MANUAL)
102         for f in $(INSTALL_KEYMAN); do  rm -f $$f; cp $(KEY_MANUAL) $$f;  done
103         touch install_kman
104
105 ##########################################################################
106 # Maintenance
107 ##########################################################################
108
109 lint:
110         lint -hp $(SRC)
111
112 newfuncs funcs.h:
113         if [ -f funcs.h ]; then mv funcs.h funcs.h.OLD; fi
114         awk -f mkfuncs.awk $(SRC) >funcs.h
115
116 clean:
117         rm -f $(OBJ) lesskey.o less lesskey vecho
118
119 clobber:
120         rm -f *.o less lesskey vecho install_less install_key \
121                 install_help install_lman install_kman
122
123 shar:
124         shar -v README CHANGES linstall \
125                 less.nro lesskey.nro \
126                 vecho.c mkfuncs.awk > less1.shr
127         shar -v less.man lesskey.man \
128                 less.h position.h cmd.h option.h > less2.shr 
129         shar -v lesskey.c $(SRC1) > less3.shr
130         shar -v $(SRC2) > less4.shr
131         shar -v $(SRC3) less.hlp > less5.shr
132         shar -v $(SRC4) funcs.h > less6.shr
133
134
135 ##########################################################################
136 # Dependencies
137 ##########################################################################
138
139 $(OBJ): less.h funcs.h defines.h position.h
140 command.o decode.o: cmd.h
141 option.o opttbl.o optfunc.o: option.h
142
143 lesskey.o: less.h funcs.h defines.h cmd.h
144