diff options
author | ru <ru@FreeBSD.org> | 2002-05-12 16:01:00 +0000 |
---|---|---|
committer | ru <ru@FreeBSD.org> | 2002-05-12 16:01:00 +0000 |
commit | 59049318b65ea166adda623a5ac132b7502ae843 (patch) | |
tree | 57ff969855b4ca919ff4d533236ef90e163b1e76 /share/mk | |
parent | d47372f8ae9362037b3ca8651d6783b14df01e70 (diff) | |
download | FreeBSD-src-59049318b65ea166adda623a5ac132b7502ae843.zip FreeBSD-src-59049318b65ea166adda623a5ac132b7502ae843.tar.gz |
Added new bsd.incs.mk which handles installing of header files
via INCS. Implemented INCSLINKS (equivalent to SYMLINKS) to
handle symlinking include files. Allow for multiple groups of
include files to be installed, with the powerful INCSGROUPS knob.
Documentation to follow.
Added standard `includes' and `incsinstall' targets, use them
in Makefile.inc1. Headers from the following makefiles were
not installed before (during `includes' in Makefile.inc1):
kerberos5/lib/libtelnet/Makefile
lib/libbz2/Makefile
lib/libdevinfo/Makefile
lib/libform/Makefile
lib/libisc/Makefile
lib/libmenu/Makefile
lib/libmilter/Makefile
lib/libpanel/Makefile
Replaced all `beforeinstall' targets for installing includes
with the INCS stuff.
Renamed INCDIR to INCSDIR, for consistency with FILES and SCRIPTS,
and for compatibility with NetBSD. Similarly for INCOWN, INCGRP,
and INCMODE.
Consistently use INCLUDEDIR instead of /usr/include.
gnu/lib/libstdc++/Makefile and gnu/lib/libsupc++/Makefile changes
were only lightly tested due to the missing contrib/libstdc++-v3.
I fully tested the pre-WIP_GCC31 version of this patch with the
contrib/libstdc++.295 stuff.
These changes have been tested on i386 with the -DNO_WERROR "make
world" and "make release".
Diffstat (limited to 'share/mk')
-rw-r--r-- | share/mk/Makefile | 2 | ||||
-rw-r--r-- | share/mk/bsd.incs.mk | 81 | ||||
-rw-r--r-- | share/mk/bsd.lib.mk | 29 | ||||
-rw-r--r-- | share/mk/bsd.own.mk | 13 | ||||
-rw-r--r-- | share/mk/bsd.prog.mk | 10 | ||||
-rw-r--r-- | share/mk/bsd.subdir.mk | 2 |
6 files changed, 97 insertions, 40 deletions
diff --git a/share/mk/Makefile b/share/mk/Makefile index 87cafe7..9dd75ce 100644 --- a/share/mk/Makefile +++ b/share/mk/Makefile @@ -2,7 +2,7 @@ # @(#)Makefile 8.1 (Berkeley) 6/8/93 FILES= bsd.README -FILES+= bsd.cpu.mk bsd.dep.mk bsd.doc.mk bsd.info.mk bsd.init.mk +FILES+= bsd.cpu.mk bsd.dep.mk bsd.doc.mk bsd.info.mk bsd.incs.mk bsd.init.mk FILES+= bsd.kern.mk bsd.kmod.mk FILES+= bsd.lib.mk bsd.libnames.mk bsd.man.mk bsd.nls.mk bsd.obj.mk bsd.own.mk FILES+= bsd.port.mk bsd.port.post.mk bsd.port.pre.mk bsd.port.subdir.mk diff --git a/share/mk/bsd.incs.mk b/share/mk/bsd.incs.mk new file mode 100644 index 0000000..c619590 --- /dev/null +++ b/share/mk/bsd.incs.mk @@ -0,0 +1,81 @@ +# $FreeBSD$ + +.if !target(__<bsd.init.mk>__) +.error bsd.incs.mk cannot be included directly. +.endif + +INCSGROUPS?= INCS + +.if !target(includes) +.for group in ${INCSGROUPS} +includes: ${${group}} +.endfor +.endif + +_incsinstall: .USE + +.if !target(incsinstall) +incsinstall: _incsinstall +.endif + +.for group in ${INCSGROUPS} +.if defined(${group}) && !empty(${group}) + +all: ${${group}} + +${group}OWN?= ${BINOWN} +${group}GRP?= ${BINGRP} +${group}MODE?= ${NOBINMODE} +${group}DIR?= ${INCLUDEDIR} + +_${group}INCS= +.for header in ${${group}} +.if defined(${group}OWN_${header:T}) || defined(${group}GRP_${header:T}) || \ + defined(${group}MODE_${header:T}) || defined(${group}DIR_${header:T}) || \ + defined(${group}NAME_${header:T}) +${group}OWN_${header:T}?= ${${group}OWN} +${group}GRP_${header:T}?= ${${group}GRP} +${group}MODE_${header:T}?= ${${group}MODE} +${group}DIR_${header:T}?= ${${group}DIR} +.if defined(${group}NAME) +${group}NAME_${header:T}?= ${${group}NAME} +.else +${group}NAME_${header:T}?= ${header:T} +.endif +_incsinstall: _${group}INS_${header:T} +_${group}INS_${header:T}: ${header} + ${INSTALL} -C -o ${${group}OWN_${.ALLSRC:T}} \ + -g ${${group}GRP_${.ALLSRC:T}} -m ${${group}MODE_${.ALLSRC:T}} \ + ${.ALLSRC} \ + ${DESTDIR}${${group}DIR_${.ALLSRC:T}}/${${group}NAME_${.ALLSRC:T}} +.else +_${group}INCS+= ${header} +.endif +.endfor +.if !empty(_${group}INCS) +_incsinstall: _${group}INS +_${group}INS: ${_${group}INCS} +.if defined(${group}NAME) + ${INSTALL} -C -o ${${group}OWN} -g ${${group}GRP} -m ${${group}MODE} \ + ${.ALLSRC} ${DESTDIR}${${group}DIR}/${${group}NAME} +.else + ${INSTALL} -C -o ${${group}OWN} -g ${${group}GRP} -m ${${group}MODE} \ + ${.ALLSRC} ${DESTDIR}${${group}DIR} +.endif +.endif + +.endif defined(${group}) && !empty(${group}) +.endfor + +.if defined(INCSLINKS) && !empty(INCSLINKS) +_incsinstall: + @set ${INCSLINKS}; \ + while test $$# -ge 2; do \ + l=$$1; \ + shift; \ + t=${DESTDIR}$$1; \ + shift; \ + ${ECHO} $$t -\> $$l; \ + ln -fs $$l $$t; \ + done; true +.endif diff --git a/share/mk/bsd.lib.mk b/share/mk/bsd.lib.mk index 4272ec8..a007f59 100644 --- a/share/mk/bsd.lib.mk +++ b/share/mk/bsd.lib.mk @@ -271,18 +271,6 @@ _EXTRADEPEND: .endif .if !target(install) -.if !target(beforeinstall) -beforeinstall: _includeinstall -.endif - -_includeinstall: -.if defined(INCS) -.for header in ${INCS} - cd ${.CURDIR} && \ - ${INSTALL} -C -o ${INCOWN} -g ${INCGRP} -m ${INCMODE} \ - ${header} ${DESTDIR}${INCDIR} -.endfor -.endif .if defined(PRECIOUSLIB) && !defined(NOFSCHG) SHLINSTALLFLAGS+= -fschg @@ -297,7 +285,6 @@ _SHLINSTALLFLAGS:= ${SHLINSTALLFLAGS} _SHLINSTALLFLAGS:= ${_SHLINSTALLFLAGS${ie}} .endfor -realinstall: beforeinstall realinstall: _libinstall _libinstall: .if !defined(INTERNALLIB) @@ -320,6 +307,12 @@ _libinstall: ${INSTALL} ${COPY} -o ${LIBOWN} -g ${LIBGRP} -m ${LIBMODE} \ ${_INSTALLFLAGS} lib${LIB}_pic.a ${DESTDIR}${LIBDIR} .endif +.if defined(WANT_LINT) && defined(LIB) && defined(LINTOBJS) && !empty(LINTOBJS) + ${INSTALL} ${COPY} -o ${LIBOWN} -g ${LIBGRP} -m ${LIBMODE} \ + ${_INSTALLFLAGS} ${LINTLIB} ${DESTDIR}${LINTLIBDIR} +.endif + +realinstall: .if defined(LINKS) && !empty(LINKS) @set ${LINKS}; \ while test $$# -ge 2; do \ @@ -342,17 +335,13 @@ _libinstall: ln -fs $$l $$t; \ done; true .endif -.if defined(WANT_LINT) && defined(LIB) && defined(LINTOBJS) && !empty(LINTOBJS) - ${INSTALL} ${COPY} -o ${LIBOWN} -g ${LIBGRP} -m ${LIBMODE} \ - ${_INSTALLFLAGS} ${LINTLIB} ${DESTDIR}${LINTLIBDIR} -.endif + +realinstall: _incsinstall .if !defined(NOMAN) realinstall: _maninstall .endif -install: afterinstall -afterinstall: realinstall .endif .if !target(lint) @@ -360,6 +349,8 @@ lint: ${SRCS:M*.c} ${LINT} ${LINTOBJFLAGS} ${CFLAGS:M-[DIU]*} ${.ALLSRC} .endif +.include <bsd.incs.mk> + .if !defined(NOMAN) .include <bsd.man.mk> .endif diff --git a/share/mk/bsd.own.mk b/share/mk/bsd.own.mk index 3b39b4e..6d80dfe 100644 --- a/share/mk/bsd.own.mk +++ b/share/mk/bsd.own.mk @@ -39,14 +39,6 @@ # # NOBINMODE Mode for non-executable files. [444] # -# INCOWN Include owner. [root] -# -# INCGRP Include group. [wheel] -# -# INCMODE Include mode. [444] -# -# INCDIR Base path for include files. [/usr/include] -# # LIBDIR Base path for libraries. [/usr/lib] # # LIBCOMPATDIR Base path for compat libraries. [/usr/lib/compat] @@ -133,11 +125,6 @@ BINGRP?= wheel BINMODE?= 555 NOBINMODE?= 444 -INCOWN?= root -INCGRP?= wheel -INCMODE?= 444 -INCDIR?= /usr/include - KMODDIR?= /boot/kernel KMODOWN?= ${BINOWN} KMODGRP?= ${BINGRP} diff --git a/share/mk/bsd.prog.mk b/share/mk/bsd.prog.mk index 0a5fcc7..83f57a5 100644 --- a/share/mk/bsd.prog.mk +++ b/share/mk/bsd.prog.mk @@ -94,9 +94,6 @@ _EXTRADEPEND: .endif .if !target(install) -.if !target(beforeinstall) -beforeinstall: -.endif _INSTALLFLAGS:= ${INSTALLFLAGS} .for ie in ${INSTALLFLAGS_EDIT} @@ -144,7 +141,6 @@ realinstall: done; true .endif .endif !target(realinstall) -realinstall: beforeinstall .if defined(SCRIPTS) && !empty(SCRIPTS) realinstall: _scriptsinstall @@ -200,12 +196,12 @@ _FILESINS_${file:T}: ${file} .endfor .endif +realinstall: _incsinstall + .if !defined(NOMAN) realinstall: _maninstall .endif -install: afterinstall -afterinstall: realinstall .endif .if !target(lint) @@ -229,6 +225,8 @@ tags: ${SRCS} .endif .endif +.include <bsd.incs.mk> + .if !defined(NOMAN) .include <bsd.man.mk> .endif diff --git a/share/mk/bsd.subdir.mk b/share/mk/bsd.subdir.mk index 1043802..9a6d466 100644 --- a/share/mk/bsd.subdir.mk +++ b/share/mk/bsd.subdir.mk @@ -58,7 +58,7 @@ ${SUBDIR}:: .for __target in all all-man checkdpadd clean cleandepend cleandir \ - depend distribute lint maninstall \ + depend distribute includes incsinstall lint maninstall \ obj objlink realinstall regress tags ${__target}: _SUBDIR .endfor |