xref: /original-bsd/usr.bin/pascal/pdx/Makefile (revision 9a77813a)
1# Copyright (c) 1982 Regents of the University of California.
2# All rights reserved.  The Berkeley software License Agreement
3# specifies the terms and conditions for redistribution.
4#
5#	@(#)Makefile	1.20 (Berkeley) 01/09/89
6#
7# make file for pdx
8#
9# For best results edit this file in vi with tabstop=4.
10#
11# The file "defs.h" is included by all, it has most of the type
12# declarations (since you can't have forward type references in C).
13# It also defines various things of general use and includes <stdio.h>.
14#
15# The file "library.c" contains routines which are generally useful
16# and are independent from pdx.
17#
18# N.B.: My version of cerror in "cerror.s" automatically catches certain errors
19#	such as out of memory, I/O error.  If you re-make pdx with
20#	the standard cerror, the program could fault unexpectedly.
21#
22#	Also, this makefile contains almost NO HEADER DEPENDENCIES.  So
23#	if you modify a header file in a non-trivial way, you need
24#	to touch the C files that include it.
25#
26
27DESTDIR	=
28HOME	= /usr/src/ucb/pdx
29LIB	= library.o cerror.o
30SRCDIR	= ../src/
31INSTALL	= ${DESTDIR}/usr/ucb/pdx
32
33RM	= /bin/rm -f
34CFLAGS	= -I.. -I../${SRCDIR} -DOBJ -DADDR32 -O
35LINTFLAGS= -I. -I${SRCDIR} -DOBJ -DADDR32
36LDFLAGS	= # -i for pdp-11
37
38.c.o:
39	@echo "compiling $*.c"
40	@csh -f -c ' \
41	    set a=$*.c; \
42	    if ($$a:h != $$a) cd $$a:h; \
43	    ${CC} ${CFLAGS} -c $$a:t \
44	'
45
46#
47# source directory specifications
48#
49
50MAIN		= main/
51SYMTAB		= symtab/
52SOURCE		= source/
53COMMAND		= command/
54TREE		= tree/
55SYM		= sym/
56BREAKPOINT	= breakpoint/
57RUNTIME		= runtime/
58OBJECT		= object/
59MAPPINGS	= mappings/
60PROCESS		= process/
61MACHINE		= machine/
62
63BPOBJ =\
64	${BREAKPOINT}bp.o\
65	${BREAKPOINT}bpact.o\
66	${BREAKPOINT}fixbps.o\
67	${BREAKPOINT}status.o\
68	${BREAKPOINT}printnews.o\
69	${BREAKPOINT}setbps.o\
70	${BREAKPOINT}trinfo.o\
71	${BREAKPOINT}trcond.o
72
73OBJOBJ =\
74	${OBJECT}readobj.o\
75	${OBJECT}readsym.o\
76	${OBJECT}maketypes.o
77
78MAPOBJ =\
79	${MAPPINGS}functab.o\
80	${MAPPINGS}objaddr.o\
81	${MAPPINGS}srcfile.o\
82	${MAPPINGS}srcline.o
83
84CMDOBJ =\
85	${COMMAND}y.tab.o\
86	${COMMAND}lex.yy.o\
87	${COMMAND}remake.o
88
89RUNTIMEOBJ =\
90	${RUNTIME}frame.o\
91	${RUNTIME}wheredump.o\
92	${RUNTIME}isactive.o\
93	${RUNTIME}address.o\
94	${RUNTIME}callproc.o\
95	${RUNTIME}entry.o
96
97MACHOBJ =\
98	${MACHINE}nextaddr.o\
99	${MACHINE}setbp.o\
100	${MACHINE}optab.o\
101	${MACHINE}printdata.o\
102	${MACHINE}printerror.o\
103	${MACHINE}printinst.o
104
105PROCOBJ =\
106	${PROCESS}runcont.o\
107	${PROCESS}pstatus.o\
108	${PROCESS}rdwr.o\
109	${PROCESS}resume.o\
110	${PROCESS}start.o\
111	${PROCESS}step.o\
112	${PROCESS}ptrace.o
113
114SYMOBJ =\
115	${SYM}predicates.o\
116	${SYM}attributes.o\
117	${SYM}printdecl.o\
118	${SYM}which.o\
119	${SYM}print.o\
120	${SYM}printval.o\
121	${SYM}tree.o
122
123TREEOBJ =\
124	${TREE}build.o\
125	${TREE}eval.o\
126	${TREE}opinfo.o\
127	${TREE}prtree.o\
128	${TREE}tfree.o\
129	${TREE}tr_equal.o\
130	${TREE}tracestop.o\
131	${TREE}misc.o\
132	${TREE}assign.o
133
134OBJS =\
135	${MAIN}main.o\
136	${SYMTAB}symtab.o\
137	${SOURCE}source.o\
138	${CMDOBJ}\
139	${TREEOBJ}\
140	${SYMOBJ}\
141	${BPOBJ}\
142	${RUNTIMEOBJ}\
143	${OBJOBJ}\
144	${MAPOBJ}\
145	${PROCOBJ}\
146	${MACHOBJ}
147
148all: a.out
149
150a.out: ${OBJS} ${LIB}
151	@echo "linking"
152	@$(CC) ${LDFLAGS} ${OBJS} ${LIB}
153
154profile: ${OBJS}
155	@echo "linking with -p"
156	@$(CC) ${LDFLAGS} -p ${OBJS} ${LIB}
157
158lint:
159	@cd ${COMMAND}; yacc -d grammar.yacc; lex token.lex
160	-@lint ${LINTFLAGS} `echo ${OBJS} library.c | sed 's/\.o/.c/g'`
161	@${RM} ${COMMAND}lex.yy.c ${COMMAND}y.tab.c
162
163cerror.o:
164	@echo "assembling `machine`/$*.s"
165	@$(CC) -c `machine`/$*.s
166
167${COMMAND}y.tab.o: ${COMMAND}grammar.yacc
168	cd ${COMMAND}; yacc -d grammar.yacc; $(CC) -c ${CFLAGS} y.tab.c
169	${RM} ${COMMAND}y.tab.c
170
171${COMMAND}lex.yy.o: ${COMMAND}token.lex ${COMMAND}y.tab.h
172	cd ${COMMAND}; lex token.lex; $(CC) -c ${CFLAGS} lex.yy.c
173	${RM} ${COMMAND}lex.yy.c
174
175${BPOBJ}:	${BREAKPOINT}bp.rep
176${RUNTIMEOBJ}:	${RUNTIME}frame.rep
177${PROCOBJ}:	${PROCESS}process.rep
178${SYMOBJ}:	${SYM}sym.rep
179${TREEOBJ}:	${TREE}tree.rep
180${OBJOBJ}:	${OBJECT}objsym.rep
181${OBJECT}readobj.o ${OBJECT}readsym.o: ${SRCDIR}objfmt.h
182
183install: a.out
184	install -s a.out ${INSTALL}
185
186clean:
187	${RM} a.out *.o */*.o
188
189depend:
190
191#
192# Warning:  This will produce a very long listing.  You would be better
193#           off just looking at things on-line.
194#
195
196print:
197	pr *.h [a-z]*/*.{h,rep,yacc,lex,c}
198