]>
Commit | Line | Data |
---|---|---|
1 | # $Source$ | |
2 | # $Author$ | |
3 | # $Header$ | |
4 | # | |
5 | # Copyright 1987 by the Massachusetts Institute of Technology. | |
6 | # | |
7 | # For copying and distribution information, | |
8 | # please see the file <mit-copyright.h>. | |
9 | # | |
10 | # Utility to build makefile header dependancies from C source. | |
11 | # | |
12 | # If you have source for cpp... | |
13 | # | |
14 | #ifdef cpp_source_path | |
15 | SRCS = include.c main.c parse.c pr.c cppsetup.c cpp.c cpy.y | |
16 | SOURCES = \ | |
17 | ${SRCDIR}/util/makedepend/include.c \ | |
18 | ${SRCDIR}/util/makedepend/main.c \ | |
19 | ${SRCDIR}/util/makedepend/parse.c \ | |
20 | ${SRCDIR}/util/makedepend/pr.c \ | |
21 | ${SRCDIR}/util/makedepend/cppsetup.c \ | |
22 | ${SRCDIR}/util/makedepend/cpp.ed \ | |
23 | ${SRCDIR}/util/makedepend/def.h \ | |
24 | ${SRCDIR}/util/makedepend/Imakefile \ | |
25 | ${SRCDIR}/util/makedepend/Makefile | |
26 | OBJS = include.o main.o parse.o pr.o cppsetup.o cpp.o cpy.o | |
27 | DEFINES = -DCPP '-DINCLUDEDIR="/usr/include"' | |
28 | CPPSRC = cpp_source_path | |
29 | ||
30 | #else | |
31 | ||
32 | # | |
33 | # But if you don't have cpp source... | |
34 | # | |
35 | SRCS = include.c main.c parse.c pr.c cppsetup.c | |
36 | SOURCES = \ | |
37 | ${SRCDIR}/util/makedepend/include.c \ | |
38 | ${SRCDIR}/util/makedepend/main.c \ | |
39 | ${SRCDIR}/util/makedepend/parse.c \ | |
40 | ${SRCDIR}/util/makedepend/pr.c \ | |
41 | ${SRCDIR}/util/makedepend/cppsetup.c \ | |
42 | ${SRCDIR}/util/makedepend/def.h \ | |
43 | ${SRCDIR}/util/makedepend/Imakefile \ | |
44 | ${SRCDIR}/util/makedepend/Makefile | |
45 | OBJS = include.o main.o parse.o pr.o cppsetup.o | |
46 | DEFINES = '-DINCLUDEDIR="/usr/include"' | |
47 | ||
48 | #endif | |
49 | ||
50 | CODE=$(SRCS) Imakefile | |
51 | ||
52 | genutil(makedepend,$(OBJS),,) | |
53 | ||
54 | cpy.c: cpy.y yylex.c | |
55 | yacc cpy.y | |
56 | sed -e '/^# *line/d' < y.tab.c > cpy.c | |
57 | $(RM) y.tab.c | |
58 | ||
59 | cpy.y: $(CPPSRC)/cpy.y | |
60 | $(RM) $@ | |
61 | $(LN) $(CPPSRC)/cpy.y . | |
62 | ||
63 | yylex.c: $(CPPSRC)/yylex.c | |
64 | $(RM) $@ | |
65 | sed -e 's/#if pdp11 | vax | mc68000/& | ns16000 | ibm032/' \ | |
66 | $(CPPSRC)/yylex.c > yylex.c | |
67 | ||
68 | cpp.c: $(CPPSRC)/cpp.c cpp.ed | |
69 | $(RM) cpp.c | |
70 | /lib/cpp $(CPPSRC)/cpp.c \ | |
71 | | cb \ | |
72 | | sed -e '/^$$/d' -e '/^#/d' -e 's/ / /g' > cpp.c | |
73 | sed -e '/^#/d' < cpp.ed | ed - cpp.c | |
74 | ||
75 | cpp.o: cpp.c | |
76 | cpy.o: cpy.c | |
77 | ||
78 | clean:: | |
79 | $(RM) cpp.c cpy.? yylex.c | |
80 | ||
81 | config: $(SOURCES) | |
82 | -mkdir $(DESTDIR)/util/makedepend | |
83 | for i in $(SOURCES); do \ | |
84 | $(RM) ${DESTDIR}/util/makedepend/`basename $$i`; \ | |
85 | $(CP) $$i ${DESTDIR}/util/makedepend/`basename $$i`; done | |
86 |