xref: /original-bsd/usr.sbin/config/Makefile (revision 981eef3c)
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.3 (Berkeley) 02/18/86
7#
8#
9CFILES=	y.tab.c main.c lex.yy.c mkioconf.c mkmakefile.c \
10	mkglue.c mkheaders.c mkswapconf.c
11OBJS=	y.tab.o main.o lex.yy.o mkioconf.o mkmakefile.o \
12	mkglue.o mkheaders.o mkswapconf.o
13
14CFLAGS=-O
15LDFLAGS=-ll
16
17config: ${OBJS}
18	${CC} ${OBJS} -o config ${LDFLAGS}
19
20lex.yy.c: config.l
21	lex config.l
22
23y.tab.h y.tab.c: config.y
24	yacc -d config.y
25
26clean:
27	rm -f ${OBJS} lex.yy.c y.tab.c y.tab.h config
28
29install:
30	install -s config ${DESTDIR}/etc/config
31
32lint: ${CFILES}
33	lint ${CFILES}
34
35depend:
36	grep '^#include' ${CFILES} | grep -v '<' | \
37	sed -e 's/:[^"]*"\([^"]*\)".*/: \1/' \
38	    -e 's/\.c/.o/' \
39	    -e 's,../[a-zA-Z]*/,,' | \
40	awk ' { if ($$1 != prev) { print rec; rec = $$0; prev = $$1; } \
41		else { if (length(rec $$2) > 78) { print rec; rec = $$0; } \
42		       else rec = rec " " $$2 } } \
43	      END { print rec } ' > makedep
44	echo '$$r makedep' >>eddep
45	echo '/^# DO NOT DELETE THIS LINE/+1,$$d' >eddep
46	echo '$$r makedep' >>eddep
47	echo 'w' >>eddep
48	cp Makefile Makefile.bak
49	ed - Makefile < eddep
50	rm eddep makedep
51
52# DO NOT DELETE THIS LINE -- make depend uses it
53
54main.o: y.tab.h config.h
55mkioconf.o: y.tab.h config.h
56mkmakefile.o: y.tab.h config.h
57mkglue.o: config.h y.tab.h
58mkheaders.o: config.h y.tab.h
59mkswapconf.o: config.h
60