2024-08-12 13:56:55 -07:00
|
|
|
# $OpenBSD: Makefile,v 1.232 2024/08/12 20:56:55 guenther Exp $
|
1996-05-22 04:34:43 -07:00
|
|
|
# $NetBSD: Makefile,v 1.59 1996/05/15 21:36:43 jtc Exp $
|
1995-10-18 01:37:01 -07:00
|
|
|
|
|
|
|
# @(#)Makefile 5.45.1.1 (Berkeley) 5/6/91
|
|
|
|
|
|
|
|
# The ``rm -rf''s used below are safe because rm doesn't follow symbolic
|
|
|
|
# links.
|
|
|
|
|
|
|
|
|
2004-01-23 10:21:13 -08:00
|
|
|
.include <bsd.own.mk>
|
|
|
|
|
2017-10-15 16:40:33 -07:00
|
|
|
FILES= a.out.h ar.h asr.h assert.h \
|
|
|
|
bitstring.h blf.h bsd_auth.h \
|
|
|
|
complex.h cpio.h ctype.h curses.h \
|
2022-08-30 11:50:06 -07:00
|
|
|
db.h dirent.h dlfcn.h \
|
2017-10-17 02:34:52 -07:00
|
|
|
elf.h elf_abi.h err.h errno.h \
|
2017-10-15 16:40:33 -07:00
|
|
|
fenv.h float.h fnmatch.h fstab.h fts.h ftw.h \
|
|
|
|
getopt.h glob.h grp.h \
|
|
|
|
icdb.h ieeefp.h ifaddrs.h inttypes.h iso646.h \
|
|
|
|
kvm.h \
|
|
|
|
langinfo.h libgen.h limits.h link.h link_elf.h locale.h login_cap.h \
|
|
|
|
math.h md5.h memory.h \
|
|
|
|
ndbm.h netdb.h netgroup.h nlist.h nl_types.h \
|
|
|
|
paths.h poll.h pthread.h pthread_np.h pwd.h \
|
|
|
|
ranlib.h readpassphrase.h regex.h resolv.h rmd160.h \
|
|
|
|
sched.h search.h setjmp.h semaphore.h sha1.h sha2.h \
|
|
|
|
signal.h siphash.h sndio.h spawn.h stdbool.h stddef.h \
|
2024-08-12 13:56:55 -07:00
|
|
|
stdio.h stdio_ext.h stdlib.h string.h strings.h sysexits.h \
|
2017-10-15 16:40:33 -07:00
|
|
|
tar.h tgmath.h tib.h time.h ttyent.h \
|
2023-08-20 08:02:50 -07:00
|
|
|
uchar.h unistd.h utime.h utmp.h uuid.h \
|
2017-10-15 16:40:33 -07:00
|
|
|
vis.h \
|
|
|
|
wchar.h wctype.h
|
2000-10-10 05:12:28 -07:00
|
|
|
|
2012-06-26 09:12:42 -07:00
|
|
|
MFILES= frame.h
|
2014-07-12 09:25:08 -07:00
|
|
|
LFILES= endian.h fcntl.h syslog.h termios.h stdarg.h stdint.h varargs.h
|
1995-10-18 01:37:01 -07:00
|
|
|
|
|
|
|
DIRS= arpa protocols rpc rpcsvc
|
2014-04-19 08:58:56 -07:00
|
|
|
LDIRS= crypto ddb dev isofs miscfs msdosfs net netinet netinet6 \
|
2014-07-11 14:50:28 -07:00
|
|
|
netmpls net80211 nfs ntfs scsi sys ufs uvm
|
1995-10-18 01:37:01 -07:00
|
|
|
|
2012-06-19 10:15:02 -07:00
|
|
|
# Places that need a prerequisite target met before includes
|
2016-10-16 12:28:44 -07:00
|
|
|
PRDIRS= ../lib/libcrypto ../lib/librpcsvc
|
2012-06-19 10:15:02 -07:00
|
|
|
|
1999-03-02 13:47:32 -08:00
|
|
|
# Directories with an includes target
|
2020-10-26 08:50:31 -07:00
|
|
|
RDIRS= ../lib/libagentx ../lib/libcbor ../lib/libcurses ../lib/libedit \
|
|
|
|
../lib/libelf ../lib/libevent ../lib/libexpat ../lib/libfido2 \
|
|
|
|
../lib/libform ../lib/libfuse ../lib/libkeynote ../lib/libmenu \
|
2016-09-23 02:18:05 -07:00
|
|
|
../lib/libossaudio ../lib/libpanel ../lib/libpcap \
|
2017-10-15 16:40:33 -07:00
|
|
|
../lib/libradius \
|
2016-09-23 02:18:05 -07:00
|
|
|
../lib/libskey ../lib/libssl ../lib/libtls \
|
2014-10-31 06:46:17 -07:00
|
|
|
../lib/libusbhid ../lib/libutil ../lib/libz \
|
2021-06-09 12:44:55 -07:00
|
|
|
../usr.bin/lex ../gnu/lib/libexecinfo ../gnu/lib/libreadline \
|
2013-12-04 14:58:24 -08:00
|
|
|
../sys/arch/${MACHINE}
|
2004-01-23 10:21:13 -08:00
|
|
|
|
2017-04-17 08:53:21 -07:00
|
|
|
.if ${BUILD_GCC3:L} == "yes"
|
2019-04-05 19:56:16 -07:00
|
|
|
RDIRS+= ../gnu/usr.bin/gcc
|
2012-06-19 10:15:02 -07:00
|
|
|
PRDIRS+= ../gnu/lib/libstdc++
|
2017-04-17 08:53:21 -07:00
|
|
|
.endif
|
|
|
|
.if ${BUILD_GCC4:L} == "yes"
|
2016-10-16 12:28:44 -07:00
|
|
|
PRDIRS+= ../gnu/lib/libstdc++-v3 ../gnu/usr.bin/cc/include
|
2017-04-17 08:53:21 -07:00
|
|
|
.endif
|
|
|
|
.if ${BUILD_CLANG:L} == "yes"
|
2021-01-02 12:04:36 -08:00
|
|
|
RDIRS+= ../gnu/lib/libcxxabi ../gnu/lib/libcxx \
|
2019-03-05 01:44:38 -08:00
|
|
|
../gnu/usr.bin/clang/libLLVM
|
2004-01-23 10:21:13 -08:00
|
|
|
.endif
|
1999-03-02 13:47:32 -08:00
|
|
|
|
2012-06-19 10:15:02 -07:00
|
|
|
# prereq implies includes
|
|
|
|
RDIRS += ${PRDIRS}
|
|
|
|
|
1995-10-18 01:37:01 -07:00
|
|
|
NOOBJ= noobj
|
|
|
|
|
|
|
|
# Change SYS_INCLUDE in bsd.own.mk to "symlinks" if you don't want copies
|
|
|
|
SYS_INCLUDE?= copies
|
2013-06-17 12:16:02 -07:00
|
|
|
|
2012-06-19 10:15:02 -07:00
|
|
|
RUN_MAKE = if test -f Makefile.bsd-wrapper; then ${MAKE} -f Makefile.bsd-wrapper $@; else ${MAKE} $@; fi
|
|
|
|
|
1999-03-02 13:47:32 -08:00
|
|
|
prereq:
|
2001-05-14 05:34:26 -07:00
|
|
|
@for i in ${PRDIRS}; do \
|
1999-03-08 16:01:41 -08:00
|
|
|
echo preparing in ${.CURDIR}/$$i; \
|
2012-06-19 10:15:02 -07:00
|
|
|
cd ${.CURDIR}/$$i && ${RUN_MAKE}; \
|
1999-03-02 13:47:32 -08:00
|
|
|
done
|
|
|
|
|
1996-05-01 06:09:10 -07:00
|
|
|
includes:
|
1995-10-18 01:37:01 -07:00
|
|
|
@echo installing ${FILES}
|
2001-05-14 05:34:26 -07:00
|
|
|
@for i in ${FILES}; do \
|
1995-10-18 01:37:01 -07:00
|
|
|
cmp -s $$i ${DESTDIR}/usr/include/$$i || \
|
1997-04-27 13:55:40 -07:00
|
|
|
${INSTALL} ${INSTALL_COPY} -m 444 $$i ${DESTDIR}/usr/include/$$i; \
|
1995-10-18 01:37:01 -07:00
|
|
|
done
|
|
|
|
@echo installing ${DIRS}
|
2001-05-14 05:34:26 -07:00
|
|
|
@for i in ${DIRS}; do \
|
1996-12-08 07:26:51 -08:00
|
|
|
${INSTALL} -d -o ${BINOWN} -g ${BINGRP} -m 755 \
|
1995-10-18 01:37:01 -07:00
|
|
|
${DESTDIR}/usr/include/$$i; \
|
2001-05-14 05:34:26 -07:00
|
|
|
cd ${.CURDIR}/$$i && for j in *.[ih]; do \
|
1995-10-18 01:37:01 -07:00
|
|
|
cmp -s $$j ${DESTDIR}/usr/include/$$i/$$j || \
|
1997-04-27 13:55:40 -07:00
|
|
|
${INSTALL} ${INSTALL_COPY} -m 444 $$j ${DESTDIR}/usr/include/$$i/$$j; \
|
2001-05-14 05:34:26 -07:00
|
|
|
done; \
|
1995-10-18 01:37:01 -07:00
|
|
|
done
|
|
|
|
@echo installing ${LFILES}
|
2001-05-14 05:34:26 -07:00
|
|
|
@for i in ${LFILES}; do \
|
|
|
|
rm -f ${DESTDIR}/usr/include/$$i && \
|
1995-10-18 01:37:01 -07:00
|
|
|
ln -s sys/$$i ${DESTDIR}/usr/include/$$i; \
|
|
|
|
done
|
|
|
|
@echo installing ${MFILES}
|
2001-05-14 05:34:26 -07:00
|
|
|
@for i in ${MFILES}; do \
|
|
|
|
rm -f ${DESTDIR}/usr/include/$$i && \
|
1995-10-18 01:37:01 -07:00
|
|
|
ln -s machine/$$i ${DESTDIR}/usr/include/$$i; \
|
|
|
|
done
|
2001-05-14 05:34:26 -07:00
|
|
|
@for i in ${RDIRS}; do \
|
1996-05-06 14:44:03 -07:00
|
|
|
echo installing in ${.CURDIR}/$$i; \
|
2012-06-19 10:15:02 -07:00
|
|
|
cd ${.CURDIR}/$$i && ${RUN_MAKE}; \
|
1998-03-03 13:15:22 -08:00
|
|
|
done
|
2016-11-08 11:56:56 -08:00
|
|
|
chown -RP ${BINOWN}:${BINGRP} ${DESTDIR}/usr/include
|
2017-10-06 12:58:37 -07:00
|
|
|
find ${DESTDIR}/usr/include \
|
|
|
|
-type f -exec chmod a=r {} + -o \
|
|
|
|
\( -type d -o -type l \) -exec chmod -h u=rwx,go=rx {} +
|
1995-10-18 01:37:01 -07:00
|
|
|
|
|
|
|
copies:
|
|
|
|
@echo copies: ${LDIRS}
|
2001-05-14 05:34:26 -07:00
|
|
|
@for i in ${LDIRS}; do \
|
|
|
|
rm -rf ${DESTDIR}/usr/include/$$i && \
|
1996-12-08 07:26:51 -08:00
|
|
|
${INSTALL} -d -o ${BINOWN} -g ${BINGRP} -m 755 \
|
1995-10-18 01:37:01 -07:00
|
|
|
${DESTDIR}/usr/include/$$i ; \
|
|
|
|
done
|
|
|
|
cd ../sys; \
|
|
|
|
pax -rw -pa -L \
|
2013-03-20 23:48:48 -07:00
|
|
|
`find ${LDIRS} -follow -type f -name '*.h' '!' \
|
2015-09-27 07:52:47 -07:00
|
|
|
'(' -path 'dev/microcode/*' -or -path 'dev/pci/drm/*' ')' \
|
2013-03-20 23:48:48 -07:00
|
|
|
-print` ${DESTDIR}/usr/include
|
2010-02-03 12:49:58 -08:00
|
|
|
cd ${DESTDIR}/usr/include && rm -rf ${MACHINE} ${MACHINE_CPU} machine
|
1996-12-08 07:26:51 -08:00
|
|
|
${INSTALL} -d -o ${BINOWN} -g ${BINGRP} -m 755 \
|
1999-05-18 08:43:58 -07:00
|
|
|
${DESTDIR}/usr/include/${MACHINE}
|
2002-06-09 11:40:35 -07:00
|
|
|
pax -rw -pa -s "|\.\./sys/arch/${MACHINE}/include||" \
|
|
|
|
../sys/arch/${MACHINE}/include/*.h \
|
|
|
|
${DESTDIR}/usr/include/${MACHINE}
|
2010-02-03 12:49:58 -08:00
|
|
|
if test ${MACHINE} != ${MACHINE_CPU} -a \
|
|
|
|
-d ../sys/arch/${MACHINE_CPU}/include; then \
|
1996-12-08 07:26:51 -08:00
|
|
|
${INSTALL} -d -o ${BINOWN} -g ${BINGRP} -m 755 \
|
2010-02-03 12:49:58 -08:00
|
|
|
${DESTDIR}/usr/include/${MACHINE_CPU}; \
|
|
|
|
pax -rw -pa -s "|\.\./sys/arch/${MACHINE_CPU}/include||" \
|
|
|
|
../sys/arch/${MACHINE_CPU}/include/*.h \
|
|
|
|
${DESTDIR}/usr/include/${MACHINE_CPU}; \
|
1995-10-18 01:37:01 -07:00
|
|
|
fi
|
1999-05-18 08:43:58 -07:00
|
|
|
ln -sf ${MACHINE} ${DESTDIR}/usr/include/machine; \
|
1995-10-18 01:37:01 -07:00
|
|
|
|
|
|
|
symlinks:
|
|
|
|
@echo symlinks: ${LDIRS}
|
|
|
|
@for i in ${LDIRS}; do \
|
2001-05-14 05:34:26 -07:00
|
|
|
rm -rf ${DESTDIR}/usr/include/$$i && \
|
1995-10-18 01:37:01 -07:00
|
|
|
ln -s /sys/$$i ${DESTDIR}/usr/include/$$i; \
|
|
|
|
done
|
2010-02-03 12:49:58 -08:00
|
|
|
cd ${DESTDIR}/usr/include && rm -rf ${MACHINE} ${MACHINE_CPU} machine
|
1999-05-18 08:43:58 -07:00
|
|
|
ln -s /sys/arch/${MACHINE}/include ${DESTDIR}/usr/include/${MACHINE}
|
2010-02-03 12:49:58 -08:00
|
|
|
if test ${MACHINE} != ${MACHINE_CPU} -a \
|
|
|
|
-d ../sys/arch/${MACHINE_CPU}/include ; then \
|
|
|
|
ln -s /sys/arch/${MACHINE_CPU}/include \
|
|
|
|
${DESTDIR}/usr/include/${MACHINE_CPU} ; \
|
1995-10-18 01:37:01 -07:00
|
|
|
fi
|
2001-05-14 05:34:26 -07:00
|
|
|
ln -sf ${MACHINE} ${DESTDIR}/usr/include/machine
|
1995-10-18 01:37:01 -07:00
|
|
|
|
1996-05-01 06:09:10 -07:00
|
|
|
includes: ${SYS_INCLUDE}
|
1995-10-18 01:37:01 -07:00
|
|
|
|
2001-05-14 05:34:26 -07:00
|
|
|
.PHONY: prereq includes copies symlink
|
1996-05-01 06:09:10 -07:00
|
|
|
.include <bsd.prog.mk>
|