1#/* Copyright (c) 1982 Regents of the University of California */ 2# 3# static char sccsid[] = "@(#)Makefile 1.4 1/23/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 subdirectory "library" contains routines which are generally useful 14# and are independent from pdx. These are compiled into a separate archive 15# and they must be made independently from pdx. 16# 17# N.B.: My version of cerror automatically catches certain erros 18# such as out of memory, I/O error. If you re-make pdx with 19# the standard cerror, the program could fault unexpectedly. 20# 21# Also, this makefile contains almost NO HEADER DEPENDENCIES. So 22# if you modify a header file in a non-trivial way, you need 23# to touch the C files that include it. 24# 25 26HOME = /usr/src/cmd/pdx 27LIB = ${HOME}/library/pdxlib 28PASCAL = /usr/src/cmd/pascal/ 29INSTALL = /usr/ucb/pdx 30 31# 32# LDFLAGS should be -i for pdp-11 33# 34 35CFLAGS = -Disvaxpx -I.. -I${PASCAL} -DOBJ -DVAX -O 36LDFLAGS = 37 38.c.o: 39 @echo "compiling $*.c" 40 @csh -f -c ' \ 41 set a=$*.c; \ 42 if ($$a:h != $$a) chdir $$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 ${MACHINE}pxerrors.o 105 106PROCOBJ =\ 107 ${PROCESS}runcont.o\ 108 ${PROCESS}pstatus.o\ 109 ${PROCESS}rdwr.o\ 110 ${PROCESS}resume.o\ 111 ${PROCESS}start.o\ 112 ${PROCESS}step.o\ 113 ${PROCESS}ptrace.o 114 115SYMOBJ =\ 116 ${SYM}predicates.o\ 117 ${SYM}attributes.o\ 118 ${SYM}printdecl.o\ 119 ${SYM}which.o\ 120 ${SYM}print.o\ 121 ${SYM}printval.o\ 122 ${SYM}tree.o 123 124TREEOBJ =\ 125 ${TREE}build.o\ 126 ${TREE}eval.o\ 127 ${TREE}opinfo.o\ 128 ${TREE}prtree.o\ 129 ${TREE}tfree.o\ 130 ${TREE}tr_equal.o\ 131 ${TREE}tracestop.o\ 132 ${TREE}misc.o\ 133 ${TREE}assign.o 134 135OBJS =\ 136 ${MAIN}main.o\ 137 ${SYMTAB}symtab.o\ 138 ${SOURCE}source.o\ 139 ${CMDOBJ}\ 140 ${TREEOBJ}\ 141 ${SYMOBJ}\ 142 ${BPOBJ}\ 143 ${RUNTIMEOBJ}\ 144 ${OBJOBJ}\ 145 ${MAPOBJ}\ 146 ${PROCOBJ}\ 147 ${MACHOBJ} 148 149a.out: ${OBJS} 150 @echo "linking" 151 @cc ${LDFLAGS} ${OBJS} ${LIB} 152 153profile: ${OBJS} 154 @echo "linking with -p" 155 @cc ${LDFLAGS} -p ${OBJS} ${LIB} 156 157${COMMAND}y.tab.o: ${COMMAND}grammar.yacc 158 chdir ${COMMAND}; yacc -d grammar.yacc; cc -c ${CFLAGS} y.tab.c 159 rm ${COMMAND}y.tab.c 160 161${COMMAND}lex.yy.o: ${COMMAND}token.lex ${COMMAND}y.tab.h 162 chdir ${COMMAND}; lex token.lex; cc -c ${CFLAGS} lex.yy.c 163 rm ${COMMAND}lex.yy.c 164 165${BPOBJ}: ${BREAKPOINT}bp.rep 166${RUNTIMEOBJ}: ${RUNTIME}frame.rep 167${PROCOBJ}: ${PROCESS}process.rep 168${SYMOBJ}: ${SYM}sym.rep 169${TREEOBJ}: ${TREE}tree.rep 170${OBJOBJ}: ${OBJECT}objsym.rep 171${OBJECT}readobj.o ${OBJECT}readsym.o: ${PASCAL}objfmt.h 172 173install: 174 mv a.out ${INSTALL} 175