Browse Source

simplify includes prereq/req order:

- everything that has prereq will also do includes, add it late, so that
gnu stuff (the only part with prereq) happens late.
- new RUN_MAKE snippet, to be able to have the makefile magically decide
between Makefile.bsd-wrapper and Makefile.
So there's no longer any need to remember complicated rules: add it to
RDIRS if it just wants make includes, add it to PRDIRS if it wants prereq too,
and that's all.
okay deraadt@, miod@
OPENBSD_5_2
espie 12 years ago
parent
commit
6a7a036626
1 changed files with 16 additions and 26 deletions
  1. +16
    -26
      src/include/Makefile

+ 16
- 26
src/include/Makefile View File

@ -1,4 +1,4 @@
# $OpenBSD: Makefile,v 1.162 2012/04/22 23:43:38 espie Exp $
# $OpenBSD: Makefile,v 1.163 2012/06/19 17:15:02 espie Exp $
# $NetBSD: Makefile,v 1.59 1996/05/15 21:36:43 jtc Exp $ # $NetBSD: Makefile,v 1.59 1996/05/15 21:36:43 jtc Exp $
# @(#)Makefile 5.45.1.1 (Berkeley) 5/6/91 # @(#)Makefile 5.45.1.1 (Berkeley) 5/6/91
@ -37,6 +37,9 @@ DIRS= arpa protocols rpc rpcsvc
LDIRS= altq crypto ddb dev isofs miscfs msdosfs net netinet netinet6 \ LDIRS= altq crypto ddb dev isofs miscfs msdosfs net netinet netinet6 \
netmpls netnatm net80211 netbt nfs nnpfs ntfs scsi sys ufs uvm netmpls netnatm net80211 netbt nfs nnpfs ntfs scsi sys ufs uvm
# Places that need a prerequisite target met before includes
PRDIRS=
# Directories with an includes target # Directories with an includes target
RDIRS= ../lib/libpthread ../lib/libcompat ../lib/libcurses \ RDIRS= ../lib/libpthread ../lib/libcompat ../lib/libcurses \
../lib/libform ../lib/libssl ../lib/libmenu \ ../lib/libform ../lib/libssl ../lib/libmenu \
@ -46,30 +49,23 @@ RDIRS= ../lib/libpthread ../lib/libcompat ../lib/libcurses \
../lib/libwrap \ ../lib/libwrap \
../lib/libz ../lib/libkeynote ../lib/libevent ../usr.bin/lex \ ../lib/libz ../lib/libkeynote ../lib/libevent ../usr.bin/lex \
../gnu/lib/libreadline ../gnu/usr.sbin/sendmail/libmilter \ ../gnu/lib/libreadline ../gnu/usr.sbin/sendmail/libmilter \
../sys/arch/${MACHINE}
# Places using Makefile that needs a prerequisite target met before includes
PRDIRS=
# Directories with an includes target that use Makefile.bsd-wrapper
WDIRS= ../usr.sbin/httpd
# Places using Makefile.bsd-wrapper that needs a prerequisite target met
# before includes
PWDIRS=
../sys/arch/${MACHINE} ../usr.sbin/httpd
.if ${COMPILER_VERSION:L} == "gcc3" .if ${COMPILER_VERSION:L} == "gcc3"
WDIRS+= ../gnu/lib/libstdc++ ../gnu/usr.bin/gcc ../gnu/lib/libobjc
PWDIRS+= ../gnu/lib/libstdc++
RDIRS+= ../gnu/usr.bin/gcc ../gnu/lib/libobjc
PRDIRS+= ../gnu/lib/libstdc++
.elif ${COMPILER_VERSION:L} == "gcc4" .elif ${COMPILER_VERSION:L} == "gcc4"
RDIRS+= ../gnu/lib/libstdc++-v3 ../gnu/usr.bin/cc/libobjc
RDIRS+= ../gnu/usr.bin/cc/libobjc
PRDIRS+= ../gnu/lib/libstdc++-v3 PRDIRS+= ../gnu/lib/libstdc++-v3
RDIRS+= ../gnu/usr.bin/cc/include RDIRS+= ../gnu/usr.bin/cc/include
.else .else
WDIRS+= ../gnu/egcs/libio ../gnu/egcs/libstdc++ \
RDIRS+= ../gnu/egcs/libio ../gnu/egcs/libstdc++ \
../gnu/lib/libobjc ../gnu/egcs/gcc ../gnu/lib/libobjc ../gnu/egcs/gcc
.endif .endif
# prereq implies includes
RDIRS += ${PRDIRS}
NOOBJ= noobj NOOBJ= noobj
# Change SYS_INCLUDE in bsd.own.mk to "symlinks" if you don't want copies # Change SYS_INCLUDE in bsd.own.mk to "symlinks" if you don't want copies
@ -78,14 +74,12 @@ SYS_INCLUDE?= copies
RDIRS+= ../lib/libkrb5 ../lib/libgssapi ../lib/libkadm5srv RDIRS+= ../lib/libkrb5 ../lib/libgssapi ../lib/libkadm5srv
.endif .endif
RUN_MAKE = if test -f Makefile.bsd-wrapper; then ${MAKE} -f Makefile.bsd-wrapper $@; else ${MAKE} $@; fi
prereq: prereq:
@for i in ${PRDIRS}; do \ @for i in ${PRDIRS}; do \
echo preparing in ${.CURDIR}/$$i; \ echo preparing in ${.CURDIR}/$$i; \
cd ${.CURDIR}/$$i && ${MAKE} prereq; \
done
@for i in ${PWDIRS}; do \
echo preparing in ${.CURDIR}/$$i; \
cd ${.CURDIR}/$$i && ${MAKE} -f Makefile.bsd-wrapper prereq; \
cd ${.CURDIR}/$$i && ${RUN_MAKE}; \
done done
includes: includes:
@ -125,11 +119,7 @@ includes:
xargs -0r chmod u=rwx,go=rx xargs -0r chmod u=rwx,go=rx
@for i in ${RDIRS}; do \ @for i in ${RDIRS}; do \
echo installing in ${.CURDIR}/$$i; \ echo installing in ${.CURDIR}/$$i; \
cd ${.CURDIR}/$$i && ${MAKE} includes; \
done
@for i in ${WDIRS}; do \
echo installing in ${.CURDIR}/$$i; \
cd ${.CURDIR}/$$i && ${MAKE} -f Makefile.bsd-wrapper includes; \
cd ${.CURDIR}/$$i && ${RUN_MAKE}; \
done done
copies: copies:


Loading…
Cancel
Save