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