Commit | Line | Data |
---|---|---|
a63f5c90 KB |
1 | # Specify the name of the program. |
2 | # All documentation and installation keys on this value. | |
3 | # | |
4 | name=sc | |
5 | NAME=SC | |
6 | ||
7 | # This is where the install step puts it. | |
8 | #EXDIR=/v/rgb/bin/psx | |
9 | EXDIR=/usr/local/bin | |
10 | ||
11 | # This is where the man page goes. | |
12 | #MANDIR=/usr/man/man1 | |
13 | MANDIR=/usr/man/manl | |
14 | ||
15 | # Set SIMPLE for lex.c if you don't want arrow keys or lex.c blows up | |
16 | #SIMPLE=-DSIMPLE | |
17 | ||
18 | # Set DOBACKUPS if you would like a backup copy of a source file on a save | |
19 | DOBACKUPS=-DDOBACKUPS | |
20 | ||
21 | # Set INTERNATIONAL if you need 8 bit characters. You should | |
22 | # not set this if you are running 5.3.0. I think it is OK in 5.3.1. | |
23 | #INTERNATIONAL=-DINTERNATIONAL | |
24 | # Set SIGVOID if signal routines are type void. System 5.3, VMS and ANSI C | |
25 | # Compliant systems use this. Most BSD systems do not. | |
26 | #SIGVOID=-DSIGVOID | |
27 | ||
28 | # Set IEEE_MATH if you need setsticky() calls in your signal handlers | |
29 | # | |
30 | #IEEE_MATH=-DIEEE_MATH | |
31 | ||
32 | # This is the name of a pager like "more" If the line is commented out | |
33 | # then "more" will be used. "pg" may be appropriate for SYSV | |
34 | PAGER=-DDFLT_PAGER=\"less\" | |
35 | ||
36 | # Use this for system V.2 | |
37 | #CFLAGS= -O -DSYSV2 | |
38 | #LDFLAGS= | |
39 | #LIB=-lm -lPW -lcurses | |
40 | ||
41 | # Use this for system V.3 | |
42 | #CFLAGS= -g -DSYSV3 | |
43 | #LDFLAGS= | |
44 | #LIB=-lm -lcurses -lPW | |
45 | ||
46 | # Microport | |
47 | #CFLAGS= -DSYSV2 -O -DUPORT -Ml | |
48 | #LDFLAGS=-Ml | |
49 | #LIB=-lm -lcurses -lPW | |
50 | ||
51 | # Use this for BSD 4.2 | |
52 | #CFLAGS= -O -DBSD42 | |
53 | #LDFLAGS= | |
54 | #LIB=-lm -lcurses -ltermcap | |
55 | ||
56 | # Use this for Sequent boxes | |
57 | #CC=atscc | |
58 | #CFLAGS=-O -DBSD42 | |
59 | #LDFLAGS= -s | |
60 | #LIB=-lm -lcurses -ltermcap | |
61 | #PSCLIB=-lseq | |
62 | ||
63 | # Use this for BSD 4.3 | |
64 | CFLAGS= -O -DBSD43 | |
65 | LDFLAGS= | |
66 | LIB=-lm -lcurses -ltermcap | |
67 | ||
68 | # Use this for system III (XENIX) | |
69 | #CFLAGS= -O -DSYSIII | |
70 | #LDFLAGS= -i | |
71 | #LIB=-lm -lcurses -ltermcap | |
72 | ||
73 | # Use this for VENIX | |
74 | #CFLAGS= -DVENIX -DBSD42 -DV7 | |
75 | #LDFLAGS= -z -i | |
76 | #LIB=-lm -lcurses -ltermcap | |
77 | ||
78 | # All of the source files | |
79 | SRC=sc.h sc.c lex.c gram.y interp.c crypt.c xmalloc.c cmds.c range.c help.c \ | |
80 | vi.c eres.sed sres.sed Makefile psc.c vmtbl.c version.c | |
81 | ||
82 | # The objects | |
83 | OBJS=sc.o interp.o cmds.o crypt.o xmalloc.o range.o help.o vi.o lex.o gram.o \ | |
84 | vmtbl.o version.o | |
85 | ||
86 | # The documents in the Archive | |
87 | DOCS=README CHANGES sc.doc psc.doc tutorial.sc VMS_NOTES BSD_BUGS | |
88 | ||
89 | $(name):$(PAR) $(OBJS) | |
90 | $(CC) ${CFLAGS} ${LDFLAGS} ${OBJS} ${LIB} -o $(name) | |
91 | ||
92 | diff_to_sc: diff_to_sc.c | |
93 | $(CC) ${CFLAGS} -o dtv diff_to_sc.c | |
94 | ||
95 | p$(name): psc.c pvmtbl.o | |
96 | $(CC) ${CFLAGS} -o p$(name) psc.c pvmtbl.o ${PSCLIB} | |
97 | cp p$(name) $(EXDIR)/p$(name) | |
98 | ||
99 | pvmtbl.o: sc.h vmtbl.c | |
100 | $(CC) ${CFLAGS} -c -DPSC vmtbl.c | |
101 | mv vmtbl.o pvmtbl.o | |
102 | ||
103 | lex.o: sc.h y.tab.h gram.o lex.c | |
104 | $(CC) ${CFLAGS} ${SIMPLE} ${IEEE_MATH} ${INTERNATIONAL} ${SIGVOID} -c lex.c | |
105 | ||
106 | sc.o: sc.h sc.c | |
107 | $(CC) ${CFLAGS} ${INTERNATIONAL} ${PAGER} ${SIGVOID} -c sc.c | |
108 | ||
109 | interp.o: interp.c sc.h | |
110 | $(CC) ${CFLAGS} ${IEEE_MATH} ${SIGVOID} -c interp.c | |
111 | ||
112 | gram.o: sc.h y.tab.h | |
113 | ||
114 | cmds.o: cmds.c sc.h | |
115 | $(CC) ${CFLAGS} ${DOBACKUPS} -c cmds.c | |
116 | ||
117 | crypt.o: crypt.c sc.h | |
118 | $(CC) ${CFLAGS} ${DOBACKUPS} -c crypt.c | |
119 | ||
120 | range.o: range.c sc.h | |
121 | ||
122 | help.o: help.c sc.h | |
123 | ||
124 | vi.o: vi.c sc.h | |
125 | ||
126 | y.tab.h: gram.y | |
127 | ||
128 | gram.o: sc.h y.tab.h gram.c | |
129 | $(CC) ${CFLAGS} -c gram.c | |
130 | sed<gram.y >experres.h -f eres.sed;sed < gram.y > statres.h -f sres.sed | |
131 | ||
132 | gram.c: gram.y | |
133 | $(YACC) -d gram.y; mv y.tab.c gram.c | |
134 | ||
135 | clean: | |
136 | rm -f *.o *res.h y.tab.h $(name) p$(name) debug core gram.c $(name).1 \ | |
137 | $(name).man p$(name).man p$(name).1 y.output | |
138 | ||
139 | shar: ${SRC} ${DOCS} | |
140 | shar -c -m 64000 -f shar ${DOCS} ${SRC} | |
141 | ||
142 | sshar: ${SRC} | |
143 | shar -c -m 1000000 -f shar ${SRC} | |
144 | ||
145 | lint: sc.h sc.c lex.c gram.c interp.c cmds.c crypt.c | |
146 | lint ${CFLAGS} ${SIMPLE} sc.c lex.c gram.c interp.c cmds.c crypt.c \ | |
147 | range.c xmalloc.c help.c vi.c -lcurses -lm | |
148 | ||
149 | inspect: sc.h sc.c lex.c gram.c interp.c cmds.c crypt.c | |
150 | /bruces/ianj/bin/i386/inspect -abv -t 8 sc.c lex.c gram.c interp.c \ | |
151 | cmds.c crypt.c range.c xmalloc.c help.c vi.c | |
152 | ||
153 | print: sc.h gram.y sc.c lex.c interp.c cmds.c crypt.c | |
154 | prc sc.h gram.y sc.c lex.c interp.c cmds.c crypt.c | lpr | |
155 | ||
156 | $(name).1: sc.doc | |
157 | sed -e s/pname/$(name)/g -e s/PNAME/$(NAME)/g sc.doc > $(name).1 | |
158 | ||
159 | $(name).man: $(name).1 | |
160 | nroff -man $(name).1 > $(name).man | |
161 | ||
162 | laser: $(name).1 | |
163 | itpf -x -Pim2 -man $(name).1 | |
164 | ||
165 | p$(name).1: psc.doc | |
166 | sed -e s/pname/$(name)/g -e s/PNAME/$(NAME)/g psc.doc > p$(name).1 | |
167 | ||
168 | p$(name).man: p$(name).1 | |
169 | nroff -man p$(name).1 > p$(name).man | |
170 | ||
171 | install: $(EXDIR)/$(name) | |
172 | ||
173 | inst-man: $(MANDIR)/$(name).1 | |
174 | ||
175 | $(EXDIR)/$(name): $(name) | |
176 | -mv $(EXDIR)/$(name) $(EXDIR)/$(name).old | |
177 | cp $(name) $(EXDIR) | |
178 | strip $(EXDIR)/$(name) | |
179 | ||
180 | $(MANDIR)/$(name).1: $(name).1 | |
181 | cp $(name).1 $(MANDIR) | |
182 | ||
183 | diffs: ${SRC} | |
184 | for i in ${SRC} ${DOCS} ;\ | |
185 | do \ | |
186 | rcsdiff -c -r6.1 $$i ;\ | |
187 | done | |
188 | ||
189 | test: test.o vmtbl.o | |
190 | $(CC) ${CFLAGS} ${LDFLAGS} test.o vmtbl.o ${LIB} -o test |