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.19 (Berkeley) 10/26/87 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 148a.out: ${OBJS} ${LIB} 149 @echo "linking" 150 @cc ${LDFLAGS} ${OBJS} ${LIB} 151 152profile: ${OBJS} 153 @echo "linking with -p" 154 @cc ${LDFLAGS} -p ${OBJS} ${LIB} 155 156lint: 157 @cd ${COMMAND}; yacc -d grammar.yacc; lex token.lex 158 -@lint ${LINTFLAGS} `echo ${OBJS} library.c | sed 's/\.o/.c/g'` 159 @${RM} ${COMMAND}lex.yy.c ${COMMAND}y.tab.c 160 161cerror.o: 162 @echo "assembling `machine`/$*.s" 163 @cc -c `machine`/$*.s 164 165${COMMAND}y.tab.o: ${COMMAND}grammar.yacc 166 cd ${COMMAND}; yacc -d grammar.yacc; cc -c ${CFLAGS} y.tab.c 167 ${RM} ${COMMAND}y.tab.c 168 169${COMMAND}lex.yy.o: ${COMMAND}token.lex ${COMMAND}y.tab.h 170 cd ${COMMAND}; lex token.lex; cc -c ${CFLAGS} lex.yy.c 171 ${RM} ${COMMAND}lex.yy.c 172 173${BPOBJ}: ${BREAKPOINT}bp.rep 174${RUNTIMEOBJ}: ${RUNTIME}frame.rep 175${PROCOBJ}: ${PROCESS}process.rep 176${SYMOBJ}: ${SYM}sym.rep 177${TREEOBJ}: ${TREE}tree.rep 178${OBJOBJ}: ${OBJECT}objsym.rep 179${OBJECT}readobj.o ${OBJECT}readsym.o: ${SRCDIR}objfmt.h 180 181install: a.out 182 install -s a.out ${INSTALL} 183 184clean: 185 ${RM} a.out *.o */*.o 186 187depend: 188 189# 190# Warning: This will produce a very long listing. You would be better 191# off just looking at things on-line. 192# 193 194print: 195 pr *.h [a-z]*/*.{h,rep,yacc,lex,c} 196