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.21 (Berkeley) 05/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 = 28LIB = library.o cerror.o 29SRCDIR = ../src/ 30INSTALL = ${DESTDIR}/usr/bin/pdx 31 32RM = /bin/rm -f 33CFLAGS = -I.. -I../${SRCDIR} -DOBJ -DADDR32 -O 34LINTFLAGS= -I. -I${SRCDIR} -DOBJ -DADDR32 35LDFLAGS = # -i for pdp-11 36 37.c.o: 38 @echo "compiling $*.c" 39 @csh -f -c ' \ 40 set a=$*.c; \ 41 if ($$a:h != $$a) cd $$a:h; \ 42 ${CC} ${CFLAGS} -c $$a:t \ 43 ' 44 45# 46# source directory specifications 47# 48 49MAIN = main/ 50SYMTAB = symtab/ 51SOURCE = source/ 52COMMAND = command/ 53TREE = tree/ 54SYM = sym/ 55BREAKPOINT = breakpoint/ 56RUNTIME = runtime/ 57OBJECT = object/ 58MAPPINGS = mappings/ 59PROCESS = process/ 60MACHINE = machine/ 61 62BPOBJ =\ 63 ${BREAKPOINT}bp.o\ 64 ${BREAKPOINT}bpact.o\ 65 ${BREAKPOINT}fixbps.o\ 66 ${BREAKPOINT}status.o\ 67 ${BREAKPOINT}printnews.o\ 68 ${BREAKPOINT}setbps.o\ 69 ${BREAKPOINT}trinfo.o\ 70 ${BREAKPOINT}trcond.o 71 72OBJOBJ =\ 73 ${OBJECT}readobj.o\ 74 ${OBJECT}readsym.o\ 75 ${OBJECT}maketypes.o 76 77MAPOBJ =\ 78 ${MAPPINGS}functab.o\ 79 ${MAPPINGS}objaddr.o\ 80 ${MAPPINGS}srcfile.o\ 81 ${MAPPINGS}srcline.o 82 83CMDOBJ =\ 84 ${COMMAND}y.tab.o\ 85 ${COMMAND}lex.yy.o\ 86 ${COMMAND}remake.o 87 88RUNTIMEOBJ =\ 89 ${RUNTIME}frame.o\ 90 ${RUNTIME}wheredump.o\ 91 ${RUNTIME}isactive.o\ 92 ${RUNTIME}address.o\ 93 ${RUNTIME}callproc.o\ 94 ${RUNTIME}entry.o 95 96MACHOBJ =\ 97 ${MACHINE}nextaddr.o\ 98 ${MACHINE}setbp.o\ 99 ${MACHINE}optab.o\ 100 ${MACHINE}printdata.o\ 101 ${MACHINE}printerror.o\ 102 ${MACHINE}printinst.o 103 104PROCOBJ =\ 105 ${PROCESS}runcont.o\ 106 ${PROCESS}pstatus.o\ 107 ${PROCESS}rdwr.o\ 108 ${PROCESS}resume.o\ 109 ${PROCESS}start.o\ 110 ${PROCESS}step.o\ 111 ${PROCESS}ptrace.o 112 113SYMOBJ =\ 114 ${SYM}predicates.o\ 115 ${SYM}attributes.o\ 116 ${SYM}printdecl.o\ 117 ${SYM}which.o\ 118 ${SYM}print.o\ 119 ${SYM}printval.o\ 120 ${SYM}tree.o 121 122TREEOBJ =\ 123 ${TREE}build.o\ 124 ${TREE}eval.o\ 125 ${TREE}opinfo.o\ 126 ${TREE}prtree.o\ 127 ${TREE}tfree.o\ 128 ${TREE}tr_equal.o\ 129 ${TREE}tracestop.o\ 130 ${TREE}misc.o\ 131 ${TREE}assign.o 132 133OBJS =\ 134 ${MAIN}main.o\ 135 ${SYMTAB}symtab.o\ 136 ${SOURCE}source.o\ 137 ${CMDOBJ}\ 138 ${TREEOBJ}\ 139 ${SYMOBJ}\ 140 ${BPOBJ}\ 141 ${RUNTIMEOBJ}\ 142 ${OBJOBJ}\ 143 ${MAPOBJ}\ 144 ${PROCOBJ}\ 145 ${MACHOBJ} 146 147all: a.out 148 149a.out: ${OBJS} ${LIB} 150 @echo "linking" 151 @$(CC) ${LDFLAGS} ${OBJS} ${LIB} 152 153profile: ${OBJS} 154 @echo "linking with -p" 155 @$(CC) ${LDFLAGS} -p ${OBJS} ${LIB} 156 157lint: 158 @cd ${COMMAND}; yacc -d grammar.yacc; lex token.lex 159 -@lint ${LINTFLAGS} `echo ${OBJS} library.c | sed 's/\.o/.c/g'` 160 @${RM} ${COMMAND}lex.yy.c ${COMMAND}y.tab.c 161 162cerror.o: 163 @echo "assembling `machine`/$*.s" 164 @$(CC) -c `machine`/$*.s 165 166${COMMAND}y.tab.o: ${COMMAND}grammar.yacc 167 cd ${COMMAND}; yacc -d grammar.yacc; $(CC) -c ${CFLAGS} y.tab.c 168 ${RM} ${COMMAND}y.tab.c 169 170${COMMAND}lex.yy.o: ${COMMAND}token.lex ${COMMAND}y.tab.h 171 cd ${COMMAND}; lex token.lex; $(CC) -c ${CFLAGS} lex.yy.c 172 ${RM} ${COMMAND}lex.yy.c 173 174${BPOBJ}: ${BREAKPOINT}bp.rep 175${RUNTIMEOBJ}: ${RUNTIME}frame.rep 176${PROCOBJ}: ${PROCESS}process.rep 177${SYMOBJ}: ${SYM}sym.rep 178${TREEOBJ}: ${TREE}tree.rep 179${OBJOBJ}: ${OBJECT}objsym.rep 180${OBJECT}readobj.o ${OBJECT}readsym.o: ${SRCDIR}objfmt.h 181 182install: a.out 183 install -s a.out ${INSTALL} 184 185cleandir clean: 186 ${RM} a.out *.o */*.o 187 188depend: 189 190# 191# Warning: This will produce a very long listing. You would be better 192# off just looking at things on-line. 193# 194 195print: 196 pr *.h [a-z]*/*.{h,rep,yacc,lex,c} 197