xref: /original-bsd/usr.bin/pascal/pc2/Makefile (revision df6dbad5)
1#
2# Copyright (c) 1980 Regents of the University of California.
3# All rights reserved.  The Berkeley software License Agreement
4# specifies the terms and conditions for redistribution.
5#
6#	@(#)Makefile	5.5 (Berkeley) 10/26/87
7#
8DESTDIR=
9CFLAGS=	-O
10INCPATH=-I${SRCDIR}
11LFLAGS=
12SRCDIR=	/sys/${MACHINE}/inline
13
14# The program itself
15#
16PROG=	pc2
17
18# Sources
19#
20RMTSRCS=${SRCDIR}/main.c ${SRCDIR}/machdep.c ${SRCDIR}/machpats.c \
21	${SRCDIR}/libcpats.c
22LOCSRCS=langpats.c
23
24# Objects
25#
26RMTOBJS=main.o machdep.o machpats.o libcpats.o
27LOCOBJS=langpats.o
28
29# Header files
30#
31HDRS=	${SRCDIR}/inline.h
32
33${PROG}: ${RMTOBJS} ${LOCOBJS} ${HDRS}
34	cc ${LFLAGS} -o ${PROG} ${RMTOBJS} ${LOCOBJS}
35
36${RMTOBJS}:
37	cc ${CFLAGS} ${INCPATH} -c ${SRCDIR}/$*.c
38
39${LOCOBJS}:
40	cc ${CFLAGS} ${INCPATH} -c $*.c
41
42install: ${PROG}
43	install -s ${PROG} ${DESTDIR}/usr/lib/${PROG}
44
45clean:
46	rm -f a.out core ${RMTOBJS} ${LOCOBJS} ${PROG}
47
48lint:
49	lint ${LOCSRCS} ${RMTSRCS}
50
51depend:
52	cc -M ${INCPATH} ${LOCSRCS} ${RMTSRCS} | \
53	sed 's/${MACHINE}/$${MACHINE}/' | \
54	awk ' { if ($$1 != prev) { print rec; rec = $$0; prev = $$1; } \
55		else { if (length(rec $$2) > 78) { print rec; rec = $$0; } \
56		       else rec = rec " " $$2 } } \
57	      END { print rec } ' > makedep
58	echo '/^# DO NOT DELETE THIS LINE/+2,$$d' >eddep
59	echo '$$r makedep' >>eddep
60	echo 'w' >>eddep
61	cp Makefile Makefile.bak
62	ed - Makefile < eddep
63	rm eddep makedep
64	echo '# DEPENDENCIES MUST END AT END OF FILE' >> Makefile
65	echo '# IF YOU PUT STUFF HERE IT WILL GO AWAY' >> Makefile
66	echo '# see make depend above' >> Makefile
67
68# DO NOT DELETE THIS LINE -- make depend uses it
69
70
71langpats.o: langpats.c /sys/${MACHINE}/inline/inline.h
72main.o: /sys/${MACHINE}/inline/main.c /usr/include/stdio.h /usr/include/ctype.h
73main.o: /sys/${MACHINE}/inline/inline.h
74machdep.o: /sys/${MACHINE}/inline/machdep.c /usr/include/stdio.h
75machdep.o: /usr/include/ctype.h /sys/${MACHINE}/inline/inline.h
76machpats.o: /sys/${MACHINE}/inline/machpats.c /sys/${MACHINE}/inline/inline.h
77libcpats.o: /sys/${MACHINE}/inline/libcpats.c /sys/${MACHINE}/inline/inline.h
78# DEPENDENCIES MUST END AT END OF FILE
79# IF YOU PUT STUFF HERE IT WILL GO AWAY
80# see make depend above
81