xref: /freebsd/include/Makefile (revision b902e8b239be392c308d8099220da051d3d4d919)
1996997fdSBruce Evans#	@(#)Makefile	8.2 (Berkeley) 1/4/94
2a4add9a9SPeter Wemm# $FreeBSD$
359deaec5SRodney W. Grimes#
4a270eca5SBruce Evans# Doing a "make install" builds /usr/include.
559deaec5SRodney W. Grimes
6976cca35SBruce EvansCLEANFILES= osreldate.h version vers.c
7c7b111cbSRuslan ErmilovSUBDIR= arpa protocols rpcsvc rpc
829284d71SMike BarcroftINCS=	a.out.h ar.h assert.h bitstring.h complex.h cpio.h ctype.h db.h \
9c544e42bSMarcel Moolenaar	dirent.h dlfcn.h elf.h elf-hints.h err.h fmtmsg.h fnmatch.h fstab.h \
10b03b864aSDavid Schultz	fts.h ftw.h getopt.h glob.h grp.h \
11b03b864aSDavid Schultz	hesiod.h histedit.h ieeefp.h ifaddrs.h \
12c544e42bSMarcel Moolenaar	inttypes.h iso646.h kenv.h langinfo.h libgen.h limits.h link.h \
13c544e42bSMarcel Moolenaar	locale.h malloc.h memory.h monetary.h mpool.h ndbm.h netconfig.h \
1446d93063SJacques Vidrine	netdb.h nl_types.h nlist.h nss.h nsswitch.h objformat.h paths.h \
15a3d4136aSDavid Xu	proc_service.h pthread.h \
16c544e42bSMarcel Moolenaar	pthread_np.h pwd.h ranlib.h readpassphrase.h regex.h regexp.h \
17c544e42bSMarcel Moolenaar	resolv.h rune.h runetype.h search.h setjmp.h sgtty.h signal.h stab.h \
1879211790SPeter Wemm	stdbool.h stddef.h stdio.h stdlib.h string.h stringlist.h \
19b902e8b2SStefan Farfeleder	strings.h sysexits.h tar.h tgmath.h \
20b902e8b2SStefan Farfeleder	time.h timeconv.h timers.h ttyent.h \
21fefa0fd5SAlexander Kabaev	ulimit.h unistd.h utime.h utmp.h uuid.h varargs.h vis.h wchar.h \
22fefa0fd5SAlexander Kabaev	wctype.h wordexp.h
2359deaec5SRodney W. Grimes
24fefa0fd5SAlexander KabaevMHDRS=	float.h floatingpoint.h stdarg.h
25917e476dSPeter Dufault
26793afc3aSMike Barcroft# posix4/mqueue.h is useless without an implementation and isn't installed:
275b0f380cSMike BarcroftPHDRS=	sched.h semaphore.h _semaphore.h # mqueue.h
28917e476dSPeter Dufault
29a7aaf57eSRuslan ErmilovLHDRS=	aio.h errno.h fcntl.h linker_set.h poll.h stdint.h syslog.h \
300e8911b3SJohn Baldwin	termios.h ucontext.h
3159deaec5SRodney W. Grimes
32d1ab0560SSam LefflerLDIRS=	cam geom net net80211 netatalk netatm netgraph netinet netinet6 \
33d1ab0560SSam Leffler	netipsec netipx netkey netnatm netncp netsmb nfs nfsclient nfsserver \
3491196234SPeter Wemm	pccard posix4 sys vm
3515f3c66cSMarcel Moolenaar
36a5b5101fSDavid E. O'BrienLSUBDIRS=	cam/scsi dev/an dev/bktr dev/firewire dev/ic dev/iicbus \
37a5b5101fSDavid E. O'Brien	dev/ofw dev/ppbus dev/smbus dev/usb dev/wi dev/utopia fs/devfs \
388a8402d3SRuslan Ermilov	fs/fdescfs fs/fifofs fs/msdosfs fs/ntfs fs/nullfs fs/nwfs fs/portalfs \
3901b013a1SPawel Jakub Dawidek	fs/procfs fs/smbfs fs/udf fs/umapfs fs/unionfs \
408a8fbacaSPawel Jakub Dawidek	geom/concat geom/gate geom/label geom/mirror geom/nop geom/stripe \
4101b013a1SPawel Jakub Dawidek	isofs/cd9660 netatm/ipatm netatm/sigpvc netatm/spans netatm/uni \
421a589a2bSHartmut Brandt	netgraph/atm security/mac_biba security/mac_bsdextended \
431a589a2bSHartmut Brandt	security/mac_lomac security/mac_mls security/mac_partition \
441a589a2bSHartmut Brandt	ufs/ffs ufs/ufs
4515f3c66cSMarcel Moolenaar
4618d948adSMaksim Yevmenkin.if !defined(NO_BLUETOOTH)
47a270eca5SBruce EvansLSUBSUBDIRS=	netgraph/bluetooth/include
4818d948adSMaksim Yevmenkin.endif
49c2608318SRuslan Ermilov
5015f3c66cSMarcel Moolenaar# Define SHARED to indicate whether you want symbolic links to the system
5115f3c66cSMarcel Moolenaar# source (``symlinks''), or a separate copy (``copies'').  ``symlinks'' is
5215f3c66cSMarcel Moolenaar# probably only useful for developers and should be avoided if you do not
5315f3c66cSMarcel Moolenaar# wish to tie your /usr/include and /usr/src together.
5415f3c66cSMarcel Moolenaar#SHARED=	symlinks
5515f3c66cSMarcel MoolenaarSHARED?=	copies
5659deaec5SRodney W. Grimes
57c7b111cbSRuslan ErmilovINCS+=	osreldate.h
583672faeaSPeter Wemm
593933c622SEivind Eklundosreldate.h:	${.CURDIR}/../sys/conf/newvers.sh \
60766ea92bSPeter Wemm		${.CURDIR}/../sys/sys/param.h \
61766ea92bSPeter Wemm		${.CURDIR}/Makefile
623672faeaSPeter Wemm	@${ECHO} creating osreldate.h from newvers.sh
6325634026SRuslan Ermilov	@setvar PARAMFILE ${.CURDIR}/../sys/sys/param.h; \
643672faeaSPeter Wemm	. ${.CURDIR}/../sys/conf/newvers.sh;			\
653672faeaSPeter Wemm	echo "$$COPYRIGHT" > osreldate.h;			\
6644cde775SPeter Wemm	echo "#ifdef _KERNEL" >> osreldate.h;			\
67a270eca5SBruce Evans	echo '#error "<osreldate.h> cannot be used in the kernel, use <sys/param.h>"' >> osreldate.h; \
6844cde775SPeter Wemm	echo "#else" >> osreldate.h;				\
693672faeaSPeter Wemm	echo \#'undef __FreeBSD_version' >> osreldate.h;	\
7044cde775SPeter Wemm	echo \#'define __FreeBSD_version' $$RELDATE >> osreldate.h; \
7144cde775SPeter Wemm	echo "#endif" >> osreldate.h
723672faeaSPeter Wemm
73a7aaf57eSRuslan Ermilov.for i in ${LHDRS}
74c7b111cbSRuslan ErmilovINCSLINKS+=	sys/$i ${INCLUDEDIR}/$i
7502cca882SMarcel Moolenaar.endfor
76a7aaf57eSRuslan Ermilov.for i in ${MHDRS}
77c7b111cbSRuslan ErmilovINCSLINKS+=	machine/$i ${INCLUDEDIR}/$i
7802cca882SMarcel Moolenaar.endfor
79a7aaf57eSRuslan Ermilov.for i in ${PHDRS}
80c7b111cbSRuslan ErmilovINCSLINKS+=	posix4/$i ${INCLUDEDIR}/$i
8102cca882SMarcel Moolenaar.endfor
8215f3c66cSMarcel Moolenaar
83a270eca5SBruce Evans.include <bsd.prog.mk>
84a270eca5SBruce Evans
85a270eca5SBruce Evansinstallincludes: ${SHARED}
86a270eca5SBruce Evans${SHARED}: compat
87a270eca5SBruce Evans
88a270eca5SBruce Evans# Take care of stale directory-level symlinks.
89a270eca5SBruce Evanscompat:
90a270eca5SBruce Evans.for i in ${LDIRS} ${LSUBDIRS} machine crypto
91a270eca5SBruce Evans	if [ -L ${DESTDIR}${INCLUDEDIR}/$i ]; then \
92a270eca5SBruce Evans		rm -f ${DESTDIR}${INCLUDEDIR}/$i; \
9315f3c66cSMarcel Moolenaar	fi
9415f3c66cSMarcel Moolenaar.endfor
95a270eca5SBruce Evans	mtree -deU ${MTREE_FOLLOWS_SYMLINKS} \
96a270eca5SBruce Evans	    -f ${.CURDIR}/../etc/mtree/BSD.include.dist \
97a270eca5SBruce Evans	    -p ${DESTDIR}${INCLUDEDIR}
98a270eca5SBruce Evans
99a270eca5SBruce Evanscopies:
100a270eca5SBruce Evans.for i in ${LDIRS} ${LSUBDIRS} crypto machine machine/pc
101a270eca5SBruce Evans.if exists(${DESTDIR}${INCLUDEDIR}/$i)
102a270eca5SBruce Evans	cd ${DESTDIR}${INCLUDEDIR}/$i; \
103a270eca5SBruce Evans	for h in *.h; do \
104a270eca5SBruce Evans		if [ -L $$h ]; then rm -f $$h; fi; \
105a270eca5SBruce Evans	done
106a270eca5SBruce Evans.endif
107a270eca5SBruce Evans.endfor
108a5b5101fSDavid E. O'Brien.for i in ${LDIRS} ${LSUBDIRS:Ndev/bktr} ${LSUBSUBDIRS}
10915f3c66cSMarcel Moolenaar	cd ${.CURDIR}/../sys; \
11015f3c66cSMarcel Moolenaar	${INSTALL} -C -o ${BINOWN} -g ${BINGRP} -m 444 $i/*.h \
111a270eca5SBruce Evans	    ${DESTDIR}${INCLUDEDIR}/$i
11215f3c66cSMarcel Moolenaar.endfor
113a5b5101fSDavid E. O'Brien	cd ${.CURDIR}/../sys/dev/bktr; \
114a5b5101fSDavid E. O'Brien	${INSTALL} -C -o ${BINOWN} -g ${BINGRP} -m 444 ioctl_*.h \
115a5b5101fSDavid E. O'Brien	    ${DESTDIR}${INCLUDEDIR}/dev/bktr
11602b199f1SMax Laier	cd ${.CURDIR}/../sys/contrib/altq/altq; \
11702b199f1SMax Laier	${INSTALL} -C -o ${BINOWN} -g ${BINGRP} -m 444 *.h \
11802b199f1SMax Laier	    ${DESTDIR}${INCLUDEDIR}/altq
119a97ec006SRuslan Ermilov	cd ${.CURDIR}/../sys/contrib/ipfilter/netinet; \
120a97ec006SRuslan Ermilov	${INSTALL} -C -o ${BINOWN} -g ${BINGRP} -m 444 *.h \
121a97ec006SRuslan Ermilov	    ${DESTDIR}${INCLUDEDIR}/netinet
122278445baSMax Laier	cd ${.CURDIR}/../sys/contrib/pf/net; \
123278445baSMax Laier	${INSTALL} -C -o ${BINOWN} -g ${BINGRP} -m 444 *.h \
124278445baSMax Laier	    ${DESTDIR}${INCLUDEDIR}/net
125a97ec006SRuslan Ermilov	cd ${.CURDIR}/../sys/opencrypto; \
126a97ec006SRuslan Ermilov	${INSTALL} -C -o ${BINOWN} -g ${BINGRP} -m 444 *.h \
127a270eca5SBruce Evans	    ${DESTDIR}${INCLUDEDIR}/crypto
12886663b44SJonathan Lemon	cd ${.CURDIR}/../sys/${MACHINE_ARCH}/include; \
12986663b44SJonathan Lemon	${INSTALL} -C -o ${BINOWN} -g ${BINGRP} -m 444 *.h \
130a270eca5SBruce Evans	    ${DESTDIR}${INCLUDEDIR}/machine
1319f1207d5SRuslan Ermilov.if exists(${.CURDIR}/../sys/${MACHINE_ARCH}/include/pc)
1329f1207d5SRuslan Ermilov	cd ${.CURDIR}/../sys/${MACHINE_ARCH}/include/pc; \
1339f1207d5SRuslan Ermilov	${INSTALL} -C -o ${BINOWN} -g ${BINGRP} -m 444 *.h \
134a270eca5SBruce Evans	    ${DESTDIR}${INCLUDEDIR}/machine/pc
1359f1207d5SRuslan Ermilov.endif
13659deaec5SRodney W. Grimes
13715f3c66cSMarcel Moolenaarsymlinks:
13815f3c66cSMarcel Moolenaar	@${ECHO} "Setting up symlinks to kernel source tree..."
139400dc950SPeter Wemm.for i in ${LDIRS}
140a270eca5SBruce Evans	cd ${.CURDIR}/../sys/$i; \
141a270eca5SBruce Evans	for h in *.h; do \
142a270eca5SBruce Evans		ln -fs ../../../sys/$i/$$h ${DESTDIR}${INCLUDEDIR}/$i; \
143a270eca5SBruce Evans	done
14415f3c66cSMarcel Moolenaar.endfor
145a270eca5SBruce Evans.for i in ${LSUBDIRS}
146a270eca5SBruce Evans	cd ${.CURDIR}/../sys/$i; \
147a270eca5SBruce Evans	for h in *.h; do \
148a270eca5SBruce Evans		ln -fs ../../../../sys/$i/$$h ${DESTDIR}${INCLUDEDIR}/$i; \
149a270eca5SBruce Evans	done
150400dc950SPeter Wemm.endfor
151a270eca5SBruce Evans.for i in ${LSUBSUBDIRS}
152a270eca5SBruce Evans	cd ${.CURDIR}/../sys/$i; \
153a270eca5SBruce Evans	for h in *.h; do \
154a270eca5SBruce Evans		ln -fs ../../../../../sys/$i/$$h ${DESTDIR}${INCLUDEDIR}/$i; \
155a270eca5SBruce Evans	done
156a270eca5SBruce Evans.endfor
15702b199f1SMax Laier	cd ${.CURDIR}/../sys/contrib/altq/altq; \
15802b199f1SMax Laier	for h in *.h; do \
15902b199f1SMax Laier		ln -fs ../../../sys/contrib/altq/altq/$$h \
16002b199f1SMax Laier		    ${DESTDIR}${INCLUDEDIR}/altq; \
16102b199f1SMax Laier	done
162a97ec006SRuslan Ermilov	cd ${.CURDIR}/../sys/contrib/ipfilter/netinet; \
163a97ec006SRuslan Ermilov	for h in *.h; do \
164a97ec006SRuslan Ermilov		ln -fs ../../../sys/contrib/ipfilter/netinet/$$h \
165a97ec006SRuslan Ermilov		    ${DESTDIR}${INCLUDEDIR}/netinet; \
166a97ec006SRuslan Ermilov	done
167278445baSMax Laier	cd ${.CURDIR}/../sys/contrib/pf/net; \
168278445baSMax Laier	for h in *.h; do \
169278445baSMax Laier		ln -fs ../../../sys/contrib/pf/net/$$h \
170278445baSMax Laier		    ${DESTDIR}${INCLUDEDIR}/net; \
171278445baSMax Laier	done
172a270eca5SBruce Evans	cd ${.CURDIR}/../sys/opencrypto; \
173a270eca5SBruce Evans	for h in *.h; do \
174a270eca5SBruce Evans		ln -fs ../../../sys/opencrypto/$$h \
175a270eca5SBruce Evans		    ${DESTDIR}${INCLUDEDIR}/crypto; \
176a270eca5SBruce Evans	done
177a270eca5SBruce Evans	cd ${.CURDIR}/../sys/${MACHINE_ARCH}/include; \
178a270eca5SBruce Evans	for h in *.h; do \
179a270eca5SBruce Evans		ln -fs ../../../sys/${MACHINE_ARCH}/include/$$h \
180a270eca5SBruce Evans		    ${DESTDIR}${INCLUDEDIR}/machine; \
181a270eca5SBruce Evans	done
182a270eca5SBruce Evans.if exists(${.CURDIR}/../sys/${MACHINE_ARCH}/include/pc)
183a270eca5SBruce Evans	cd ${.CURDIR}/../sys/${MACHINE_ARCH}/include/pc; \
184a270eca5SBruce Evans	for h in *.h; do \
185a270eca5SBruce Evans		ln -fs ../../../../sys/${MACHINE_ARCH}/include/pc/$$h \
186a270eca5SBruce Evans		    ${DESTDIR}${INCLUDEDIR}/machine/pc; \
187a270eca5SBruce Evans	done
188a270eca5SBruce Evans.endif
189