Commit | Line | Data |
---|---|---|
2a24676e DF |
1 | # |
2 | # Copyright (c) 1983 Regents of the University of California. | |
3 | # All rights reserved. The Berkeley software License Agreement | |
4 | # specifies the terms and conditions for redistribution. | |
5 | # | |
406de4bf | 6 | # @(#)Makefile 5.13 (Berkeley) %G% |
723343f2 SL |
7 | # |
8 | # make file for debugger "dbx" | |
9 | # | |
10 | # The file "defs.h" is included by all. | |
11 | # | |
723343f2 SL |
12 | |
13 | .SUFFIXES: | |
406de4bf | 14 | .SUFFIXES: .h .c .s .o .1 .0 |
723343f2 | 15 | |
0022c355 | 16 | AOUT = tdbx |
17b4042d | 17 | DESTDIR = |
0022c355 ML |
18 | DEST = /usr/ucb/dbx |
19 | ||
20 | CC = cc | |
adbf81b2 DS |
21 | AS = as |
22 | # | |
23 | # if you want gripes | |
24 | # CFLAGS = -g '-DMAINTAINER="linton@shasta.stanford.edu"' | |
25 | # | |
26 | CFLAGS = -O # -g | |
0022c355 ML |
27 | |
28 | LD = cc | |
adbf81b2 DS |
29 | LDFLAGS = # -g |
30 | LIBRARIES = # -lPW for IRIS (System V) | |
0022c355 ML |
31 | |
32 | OBJ = \ | |
33 | y.tab.o \ | |
34 | asm.o \ | |
35 | events.o \ | |
36 | c.o \ | |
37 | cerror.o \ | |
38 | check.o \ | |
39 | coredump.o \ | |
40 | debug.o \ | |
41 | eval.o \ | |
42 | fortran.o \ | |
43 | keywords.o \ | |
44 | languages.o \ | |
45 | library.o \ | |
46 | lists.o \ | |
47 | machine.o \ | |
48 | main.o \ | |
49 | mappings.o \ | |
50 | modula-2.o \ | |
51 | names.o \ | |
52 | object.o \ | |
53 | operators.o \ | |
54 | pascal.o \ | |
55 | printsym.o \ | |
56 | process.o \ | |
57 | runtime.o \ | |
58 | scanner.o \ | |
59 | source.o \ | |
60 | stabstring.o \ | |
61 | symbols.o \ | |
62 | tree.o \ | |
63 | ops.o | |
64 | ||
65 | HDR = \ | |
66 | asm.h \ | |
67 | events.h \ | |
68 | c.h \ | |
69 | check.h \ | |
70 | coredump.h \ | |
71 | debug.h \ | |
72 | eval.h \ | |
73 | fortran.h \ | |
74 | keywords.h \ | |
75 | languages.h \ | |
76 | lists.h \ | |
77 | machine.h \ | |
78 | main.h \ | |
79 | mappings.h \ | |
80 | modula-2.h \ | |
81 | names.h \ | |
82 | object.h \ | |
83 | operators.h \ | |
84 | pascal.h \ | |
85 | printsym.h \ | |
86 | process.h \ | |
87 | runtime.h \ | |
88 | scanner.h \ | |
89 | source.h \ | |
90 | stabstring.h \ | |
91 | symbols.h \ | |
92 | tree.h \ | |
93 | ops.h | |
94 | ||
95 | SRC = \ | |
96 | defs.h \ | |
97 | commands.y \ | |
98 | asm.c \ | |
99 | events.c \ | |
100 | c.c \ | |
fb427eb7 | 101 | cerror.${MACHINE}.s \ |
0022c355 ML |
102 | check.c \ |
103 | coredump.c \ | |
104 | debug.c \ | |
105 | eval.c \ | |
106 | fortran.c \ | |
107 | keywords.c \ | |
108 | languages.c \ | |
109 | library.c \ | |
110 | lists.c \ | |
0022c355 ML |
111 | main.c \ |
112 | mappings.c \ | |
113 | modula-2.c \ | |
114 | names.c \ | |
115 | object.c \ | |
116 | operators.c \ | |
117 | pascal.c \ | |
118 | printsym.c \ | |
119 | process.c \ | |
0022c355 ML |
120 | scanner.c \ |
121 | source.c \ | |
122 | stabstring.c \ | |
123 | symbols.c \ | |
124 | tree.c \ | |
fb427eb7 SL |
125 | ${MACHINE}.c \ |
126 | runtime.${MACHINE}.c \ | |
127 | ops.${MACHINE}.c | |
0022c355 | 128 | |
723343f2 | 129 | .c.o: |
0022c355 ML |
130 | @echo "compiling $*.c" |
131 | @${CC} ${CFLAGS} -c $*.c | |
723343f2 SL |
132 | |
133 | .s.o: | |
0022c355 | 134 | @echo "assembling $*.s" |
adbf81b2 DS |
135 | @rm -f tmp |
136 | @/lib/cpp $*.s | grep -v "^#" > tmp | |
137 | @${AS} -o $*.o tmp | |
138 | @rm -f tmp | |
723343f2 SL |
139 | |
140 | .c.h: | |
0022c355 | 141 | ./makedefs -f $*.c $*.h |
723343f2 | 142 | |
0022c355 | 143 | ${AOUT}: makedefs mkdate ${HDR} ${OBJ} |
1c39daec ML |
144 | @rm -f date.c |
145 | @./mkdate > date.c | |
723343f2 | 146 | @echo "linking" |
0022c355 ML |
147 | @${CC} ${CFLAGS} -c date.c |
148 | @${LD} ${LDFLAGS} date.o ${OBJ} ${LIBRARIES} -o ${AOUT} | |
723343f2 | 149 | |
0022c355 | 150 | profile: ${HDR} ${OBJ} |
1c39daec ML |
151 | @rm -f date.c |
152 | @./mkdate > date.c | |
723343f2 | 153 | @echo "linking with -p" |
0022c355 | 154 | @${CC} ${LDFLAGS} -p date.c ${OBJ} ${LIBRARIES} -o ${AOUT} |
723343f2 SL |
155 | |
156 | y.tab.c: commands.y | |
2fd0f574 | 157 | @echo "expect 2 shift/reduce conflicts" |
0022c355 | 158 | yacc -d commands.y |
723343f2 | 159 | |
fb427eb7 SL |
160 | cerror.s: cerror.${MACHINE}.s |
161 | @rm -f cerror.s | |
162 | @ln -s cerror.${MACHINE}.s cerror.s | |
163 | ||
164 | machine.c: ${MACHINE}.c | |
165 | @rm -f machine.c | |
166 | @ln -s ${MACHINE}.c machine.c | |
167 | ||
168 | ops.c: ops.${MACHINE}.c | |
169 | @rm -f ops.c | |
170 | @ln -s ops.${MACHINE}.c ops.c | |
171 | ||
172 | runtime.c: runtime.${MACHINE}.c | |
173 | @rm -f runtime.c | |
174 | @ln -s runtime.${MACHINE}.c runtime.c | |
175 | ||
723343f2 | 176 | makedefs: makedefs.c library.o cerror.o |
adbf81b2 | 177 | ${CC} -g makedefs.c library.o cerror.o -o makedefs |
723343f2 | 178 | |
1c39daec | 179 | mkdate: mkdate.c |
adbf81b2 | 180 | ${CC} -g ${CFLAGS} mkdate.c -o mkdate |
1c39daec | 181 | |
723343f2 SL |
182 | print: |
183 | @echo "don't print it, it's too long" | |
184 | ||
300a5f74 KB |
185 | depend: |
186 | ||
723343f2 SL |
187 | # |
188 | # Don't worry about the removal of header files, they're created from | |
189 | # the source files. | |
190 | # | |
0022c355 | 191 | |
723343f2 | 192 | clean: |
0022c355 | 193 | rm -f ${HDR} ${OBJ} y.tab.c y.tab.h ${AOUT} mkdate mkdate.o \ |
fb427eb7 | 194 | makedefs makedefs.o date.c core mon.out prof.out make.out \ |
8d27e971 | 195 | cerror.s ops.c machine.c runtime.c date.o |
9489dbbe | 196 | @chdir tests; make clean |
0022c355 | 197 | |
406de4bf KB |
198 | cleandir: clean |
199 | rm -f dbx.0 tags .depend | |
200 | ||
0022c355 ML |
201 | cleandefs: |
202 | rm -f ${HDR} y.tab.h | |
723343f2 | 203 | |
2fd0f574 SL |
204 | testinstall: ${AOUT} test install |
205 | ||
206 | test: | |
adbf81b2 | 207 | @cd tests; make |
2fd0f574 | 208 | |
406de4bf | 209 | install: ${AOUT} dbx.0 |
7c8d5816 | 210 | install -s -o bin -g bin -m 755 ${AOUT} ${DESTDIR}${DEST} |
406de4bf | 211 | install -c -o bin -g bin -m 444 dbx.0 ${DESTDIR}/usr/man/cat1 |
723343f2 | 212 | |
0022c355 ML |
213 | # |
214 | # Create a tar file called "tape" containing relevant files. | |
215 | # | |
216 | ||
adbf81b2 | 217 | TAPE = f tape |
0022c355 ML |
218 | |
219 | tape: | |
adbf81b2 DS |
220 | @tar c${TAPE} Makefile History READ_ME ${SRC} \ |
221 | makedefs.c mkdate.c tests pc0mods dbx.1 newdbx.1 dbxstab.5 | |
222 | ||
223 | # | |
224 | # without tests subdirectory | |
225 | # | |
226 | srconlytape: | |
227 | @tar c${TAPE} Makefile History READ_ME ${SRC} \ | |
228 | makedefs.c mkdate.c dbx.1 newdbx.1 dbxstab.5 | |
c64c6a16 | 229 | |
723343f2 SL |
230 | # |
231 | # Header dependencies are purposely incomplete since header files | |
232 | # are "written" every time the accompanying source file changes even if | |
233 | # the resulting contents of the header don't change. The alternative is | |
234 | # to force a "makedefs" to be invoked for every header file each time dbx | |
235 | # is made. | |
236 | # | |
237 | # Also, there should be a dependency of scanner.o and keywords.o on y.tab.h | |
238 | # but misfortunately silly make does a "makedefs y.tab.c y.tab.h" which | |
239 | # destroys y.tab.h. | |
240 | # | |
0022c355 | 241 | |
723343f2 | 242 | symbols.o tree.o check.o eval.o events.o: operators.h |