-
Notifications
You must be signed in to change notification settings - Fork 262
/
Make0
107 lines (95 loc) · 2.83 KB
/
Make0
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
# OCDIR is assumed to have been set
TST=`if test "x$OCDIR" = x ; then echo "OCDIR not defined"; exit 1 fi`
TST=`echo "OCDIR=$OCDIR"`
THISDIR=../oc2
# Make consistent with Makefile.am
SRC=oc.c \
daplex.c dapparse.c dapy.c \
occlientparams.c occompile.c occurlfunctions.c \
ocdata.c ocdebug.c ocdump.c \
ocinternal.c ocnode.c \
ochttp.c \
ocrc.c ocread.c ocutil.c \
ocbytes.c oclist.c ocuri.c oclog.c \
occurlflags.c \
xxdr.c
HDRS=oc.h ocx.h \
dapparselex.h dapy.h \
occlientparams.h occompile.h occonstraints.h occurlfunctions.h \
ocdata.h ocdatatypes.h ocdebug.h ocdump.h \
ocinternal.h ocnode.h \
ochttp.h ocread.h ocutil.h \
ocbytes.h oclist.h ocuri.h oclog.h \
xxdr.h
DOCS=docs/auth.html.in docs/oc.css
MISC=dap.y
FILES=${HDRS} ${SRC} ${MISC} ${DOCS}
all::
makeoc::
rm -f ${THISDIR}/*.[chy]
for file in ${FILES} ; do \
echo "${OCDIR}/$$file" ; \
f="${OCDIR}/$$file" ; \
base=`basename $$f` ; \
cat $$f | tr -d '' >${THISDIR}/$$base; \
done
rm -f ocdebug.h XGetopt.[ch]
sed -e 's|^[#]if 1|#if 0|g' \
< ${OCDIR}/ocdebug.h | tr -d '\r' >./ocdebug.h
# This should match the bison command in Makefile.am
rm -f dap.tab.c dap.tab.h
bison --debug -d -p dap dap.y
mv dap.tab.c dapy.c; mv dap.tab.h dapy.h
changed:
${MAKE} -f Make0 NAMEONLY=1 diffoc
diffoc::
@if ! test -e ${OCDIR} ; then echo "${OCDIR} not found"; exit ; fi
@for file in ${FILES} ; do \
f="${OCDIR}/$$file" ; \
x=`basename $$f|tr -d '' ` ; \
if test "x$${x}" = "xdapy.c" -o "x$${x}" = "xdapy.h" ; then echo "ignore: $${x}"; continue; fi ;\
if ! test -e ${THISDIR}/$$x ; then \
echo "Missing file: $$x"; \
fi ; \
if test -e ${THISDIR}/$$x -a -e ${OCDIR}/$$x ; then \
if ! diff --brief -wBb ${THISDIR}/$$x $$f > /dev/null ; then \
if test "x${NAMEONLY}" = x1 ; then \
echo "$$x" ;\
else \
echo diff -wBb ${THISDIR}/$$x $$f ;\
diff -w ${THISDIR}/$$x $$f ; \
fi; \
fi; \
fi; \
done
olddiff::
if ! test -e ${OCDIR} ; then echo "${OCDIR} not found"; exit ; fi
for file in ${FILES} ; do \
f="${OCDIR}/$$file" ; \
x=`basename $$f | tr -d '' ` ; \
if test "x$${x}" = "xdapy.c" -o "x$${x}" = "xdapy.h" ; then echo "ignore: $${x}"; continue; fi ;\
if test -e ${THISDIR}/$$x -a -e ${OCDIR}/$$x ; then \
diff --brief -wBb ${THISDIR}/$$x $$f ; \
else \
echo "Only in ${OCDIR}: $$x"; \
fi; \
done
for file in ${FILES} ; do \
f="${OCDIR}/$$file" ; \
x=`basename $$f|tr -d '' ` ; \
if test "x$${x}" = "xdapy.c" -o "x$${x}" = "xdapy.h" ; then echo "ignore: $${x}"; continue; fi ;\
if test -e ${THISDIR}/$$x -a -e ${OCDIR}/$$x ; then \
if ! diff --brief -wBb ${THISDIR}/$$x $$f > /dev/null ; then \
echo diff -wBb ${THISDIR}/$$x $$f ;\
diff -w ${THISDIR}/$$x $$f ; \
fi; \
fi; \
done
backoc::
for f in ${FILES} ; do \
cp -f ./$$f ${OCDIR}/$$f ; \
done