1 # @(#)Makefile 8.2 (Berkeley) 1/4/94
2 # $FreeBSD: src/include/Makefile,v 1.109.2.27 2003/01/24 05:12:29 sam Exp $
3 # $DragonFly: src/include/Makefile,v 1.2 2003/06/17 04:25:56 dillon Exp $
5 # Doing a make install builds /usr/include
7 # The ``rm -rf''s used below are safe because rm doesn't follow symbolic
10 CLEANFILES= osreldate.h version vers.c
11 SUBDIR= arpa protocols rpc rpcsvc
12 INCS= a.out.h ar.h assert.h bitstring.h complex.h ctype.h db.h \
14 dlfcn.h elf.h elf-hints.h err.h fnmatch.h fstab.h \
15 fts.h glob.h grp.h strhash.h histedit.h ieeefp.h ifaddrs.h iso646.h \
16 langinfo.h libgen.h limits.h link.h locale.h malloc.h memory.h mpool.h \
17 ndbm.h netdb.h nl_types.h nlist.h objformat.h \
18 paths.h pthread.h pthread_np.h pwd.h \
19 ranlib.h readpassphrase.h regex.h regexp.h resolv.h rune.h runetype.h \
20 search.h setjmp.h sgtty.h \
21 signal.h stab.h stdbool.h stddef.h stdio.h stdlib.h \
22 string.h stringlist.h strings.h struct.h sysexits.h tar.h time.h \
23 timers.h ttyent.h unistd.h utime.h utmp.h vis.h wchar.h wctype.h
25 MHDRS= float.h floatingpoint.h stdarg.h varargs.h
27 # posix4/aio.h conflicts with dysons and isn't installed:
28 PHDRS= mqueue.h sched.h semaphore.h # aio.h
30 # Only for default SHARED=copies case
31 SHDRS= soundcard.h joystick.h
33 LHDRS= aio.h errno.h fcntl.h inttypes.h linker_set.h poll.h syslog.h \
36 LDIRS= cam msdosfs net netatalk netatm netgraph netinet netinet6 netipsec \
37 netipx netkey netnatm netncp netns netsmb nfs ntfs nwfs pccard posix4 \
40 LSUBDIRS= cam/scsi dev/an dev/firewire dev/ppbus dev/usb dev/wi \
41 fs/smbfs isofs/cd9660 \
42 netatm/ipatm netatm/sigpvc netatm/spans netatm/uni \
43 ufs/ffs ufs/mfs ufs/ufs
45 # For SHARED=symlinks, cam and netatm are symlinks, so cam/scsi and netatm/*
47 LSYMSUBDIRS= ${LSUBDIRS:Ncam/scsi:Nnetatm/*}
49 # Define SHARED to indicate whether you want symbolic links to the system
50 # source (``symlinks''), or a separate copy (``copies''). ``symlinks'' is
51 # probably only useful for developers and should be avoided if you do not
52 # wish to tie your /usr/include and /usr/src together.
58 osreldate.h: ${.CURDIR}/../sys/conf/newvers.sh \
59 ${.CURDIR}/../sys/sys/param.h
60 @${ECHO} creating osreldate.h from newvers.sh
61 setvar PARAMFILE ${.CURDIR}/../sys/sys/param.h; \
62 . ${.CURDIR}/../sys/conf/newvers.sh; \
63 echo "$$COPYRIGHT" > osreldate.h; \
64 echo "#ifdef _KERNEL" >> osreldate.h; \
65 echo '#error "osreldate.h must not be used in the kernel, use sys/param.h"' >> osreldate.h; \
66 echo "#else" >> osreldate.h; \
67 echo \#'undef __FreeBSD_version' >> osreldate.h; \
68 echo \#'define __FreeBSD_version' $$RELDATE >> osreldate.h; \
69 echo "#endif" >> osreldate.h
72 INCSLINKS+= sys/$i ${INCLUDEDIR}/$i
75 INCSLINKS+= machine/$i ${INCLUDEDIR}/$i
78 INCSLINKS+= posix4/$i ${INCLUDEDIR}/$i
82 .for i in ${LDIRS} ${LSYMSUBDIRS} machine crypto
83 if [ -h ${DESTDIR}/usr/include/$i ]; then \
84 rm -f ${DESTDIR}/usr/include/$i; \
87 mtree -deU -f ${.CURDIR}/../etc/mtree/BSD.include.dist \
88 -p ${DESTDIR}/usr/include
89 .for i in ${LDIRS} ${LSUBDIRS}
90 cd ${.CURDIR}/../sys; \
91 ${INSTALL} -C -o ${BINOWN} -g ${BINGRP} -m 444 $i/*.h \
92 ${DESTDIR}/usr/include/$i
94 cd ${.CURDIR}/../sys; \
95 ${INSTALL} -C -o ${BINOWN} -g ${BINGRP} -m 444 opencrypto/*.h \
96 ${DESTDIR}/usr/include/crypto
97 .if exists(${.CURDIR}/../sys/${MACHINE_ARCH}/include)
98 cd ${.CURDIR}/../sys/${MACHINE_ARCH}/include; \
99 ${INSTALL} -C -o ${BINOWN} -g ${BINGRP} -m 444 *.h \
100 ${DESTDIR}/usr/include/machine
101 .if exists(${.CURDIR}/../sys/${MACHINE_ARCH}/include/pc)
102 cd ${.CURDIR}/../sys/${MACHINE_ARCH}/include/pc; \
103 ${INSTALL} -C -o ${BINOWN} -g ${BINGRP} -m 444 *.h \
104 ${DESTDIR}/usr/include/machine/pc
108 ln -sf ../sys/$i ${DESTDIR}/usr/include/machine/$i
112 @${ECHO} "Setting up symlinks to kernel source tree..."
114 rm -rf ${DESTDIR}/usr/include/$i
115 ln -s ../../sys/$i ${DESTDIR}/usr/include/$i
117 rm -rf ${DESTDIR}/usr/include/crypto
118 ln -s ../../sys/opencrypto ${DESTDIR}/usr/include/crypto
119 .for i in ${LSYMSUBDIRS}
120 rm -rf ${DESTDIR}/usr/include/$i
121 ln -s ../../../sys/$i ${DESTDIR}/usr/include/$i
123 rm -rf ${DESTDIR}/usr/include/machine
124 ln -s ../../sys/${MACHINE_ARCH}/include ${DESTDIR}/usr/include/machine
126 .include <bsd.prog.mk>
128 installincludes: ${SHARED}