xref: /original-bsd/include/Makefile.install (revision 1db732ef)
1#
2# Copyright (c) 1983,1986 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.install	5.3 (Berkeley) 10/13/86
7#
8# Makefile for /usr/include, used to convert system include subdirectories
9# between symbolic links and copies of kernel headers.
10# May also be used to update copies from kernel header files.
11#
12# The ``rm -rf''s used below are safe because rm doesn't
13# follow symbolic links.
14#
15DESTDIR=
16#ifdef vax
17#MACHINE=vax
18#MACHDEP=${MACHINE} vaxif vaxmba vaxuba
19#endif
20MACHINE=tahoe
21MACHDEP=${MACHINE} tahoeif tahoevba
22NETDIRS=net netimp netinet netns
23SYSDIRS=${NETDIRS} stand ${MACHDEP}
24SYS=/sys
25
26all:
27	@echo "\"make symlinks\", \"make copies\", or \"make update\" only"
28	@false
29
30symlinks:
31	for i in ${SYSDIRS}; do \
32		rm -rf $$i; \
33		ln -s ${SYS}/$$i $$i; \
34	done
35	rm -rf sys
36	ln -s ${SYS}/h sys
37
38copies:
39	-for i in ${SYSDIRS}; do \
40		rm -rf $$i; \
41		(cd ${SYS}; tar cf - $$i/*.h) | tar xpfB -; \
42	done
43	rm -rf sys;
44	mkdir sys;
45	chmod 775 sys;
46	-(cd ${SYS}/h; tar cf - *.h) | (cd sys; tar xpfB -)
47
48update:
49	-for i in ${SYSDIRS}; do \
50		if [ ! -d $$i ]; \
51		then \
52			mkdir $$i; \
53		fi; \
54		for j in `cd ${SYS}/$$i; echo *.[ih]`; do \
55			cmp -s ${SYS}/$$i/$$j $$i/$$j || \
56			install -c -m 444 ${SYS}/$$i/$$j $$i/$$j; \
57		done; \
58	done
59	for j in `cd ${SYS}/h; echo *.[ih]`; do \
60		cmp -s ${SYS}/h/$$j sys/$$j || \
61		{ echo "install -c -m 444 ${SYS}/h/$$j sys/$$j"; \
62		install -c -m 444 ${SYS}/h/$$j sys/$$j; } \
63	done;
64