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