Home | History | Annotate | Line # | Download | only in mtree
Makefile revision 1.37.4.1
      1  1.37.4.1  christos #	$NetBSD: Makefile,v 1.37.4.1 2019/06/10 21:42:45 christos Exp $
      2       1.6       mrg 
      3       1.6       mrg .include <bsd.own.mk>
      4       1.6       mrg 
      5  1.37.4.1  christos EXTRA_DIST_FILES=	NetBSD.dist.machine	# autogenerated
      6  1.37.4.1  christos 
      7       1.6       mrg .if ${MKX11} != "no"
      8  1.37.4.1  christos EXTRA_DIST_FILES+=	NetBSD.dist.Xorg
      9       1.6       mrg .endif
     10       1.6       mrg 
     11  1.37.4.1  christos # Derived from MACHINE_CPU, but keeping 32/64bit for most.
     12  1.37.4.1  christos MTREE_MACHINE_ARCH=${MACHINE_ARCH:C/mipse[bl]/mips/:C/mips64e[bl]/mips64/:C/sh3e[bl]/sh3/:S/coldfire/m68k/:S/m68000/m68k/:C/arm.*/arm/:C/earm.*/arm/:S/earm/arm/:S/aarch64eb/aarch64/:S/or1knd/or1k/}
     13  1.37.4.1  christos 
     14  1.37.4.1  christos # The compat specific files
     15  1.37.4.1  christos 
     16      1.28    martin .if defined(MKCOMPAT) && ${MKCOMPAT} != "no"
     17      1.25      matt .include "${NETBSDSRCDIR}/compat/archdirs.mk"
     18  1.37.4.1  christos .if exists(NetBSD.compat.${MTREE_MACHINE_ARCH})
     19  1.37.4.1  christos EXTRA_DIST_FILES+=	NetBSD.compat.${MTREE_MACHINE_ARCH}
     20      1.13       mrg .endif
     21      1.25      matt EXTRA_DIST_FILES+=	NetBSD.dist.compat	# autogenerated
     22      1.29       mrg .if defined(MKCOMPATX11) && ${MKCOMPATX11} != "no" && ${MKX11} != "no"
     23      1.26      matt EXTRA_DIST_FILES+=	NetBSD.dist.xcompat	# autogenerated
     24      1.26      matt .endif
     25      1.19       mrg .endif
     26      1.13       mrg 
     27  1.37.4.1  christos 
     28  1.37.4.1  christos # Platform specific files.
     29  1.37.4.1  christos # First we grab the mtree-specific, then either the MACHINE_ARCH or
     30  1.37.4.1  christos # MACHINE_CPU files, and finally the MACHINE files, as long as they
     31  1.37.4.1  christos # aren't the same files.
     32  1.37.4.1  christos 
     33  1.37.4.1  christos .if exists(NetBSD.dist.${MTREE_MACHINE_ARCH})
     34  1.37.4.1  christos EXTRA_DIST_FILES+=	NetBSD.dist.${MTREE_MACHINE_ARCH}
     35  1.37.4.1  christos .endif
     36  1.37.4.1  christos 
     37  1.37.4.1  christos .if empty(MTREE_MACHINE_ARCH:M${MACHINE_ARCH}) && \
     38  1.37.4.1  christos     exists(NetBSD.dist.${MACHINE_ARCH})
     39  1.37.4.1  christos EXTRA_DIST_FILES+=	NetBSD.dist.${MACHINE_ARCH}
     40  1.37.4.1  christos .elif empty(MTREE_MACHINE_ARCH:M${MACHINE_CPU}) && \
     41  1.37.4.1  christos     exists(NetBSD.dist.${MACHINE_CPU})
     42  1.37.4.1  christos EXTRA_DIST_FILES+=	NetBSD.dist.${MACHINE_CPU}
     43  1.37.4.1  christos .endif
     44  1.37.4.1  christos 
     45  1.37.4.1  christos .if empty(MTREE_MACHINE_ARCH:M${MACHINE}) && \
     46  1.37.4.1  christos     exists(NetBSD.dist.${MACHINE})
     47      1.37       mrg EXTRA_DIST_FILES+=	NetBSD.dist.${MACHINE}
     48      1.37       mrg .endif
     49      1.37       mrg 
     50  1.37.4.1  christos 
     51  1.37.4.1  christos # The build specific files.
     52  1.37.4.1  christos 
     53      1.18     njoly .if ${MKATF} != "no"
     54      1.33  christos EXTRA_DIST_FILES+=	NetBSD.dist.tests
     55      1.28    martin .if defined(MKCOMPATTESTS) && ${MKCOMPATTESTS} != "no"
     56      1.25      matt EXTRA_DIST_FILES+=	NetBSD.dist.tests.compat
     57      1.25      matt .endif
     58      1.18     njoly .endif
     59      1.18     njoly 
     60      1.30       riz .if ${MKDTRACE} != "no"
     61      1.33  christos EXTRA_DIST_FILES+=	NetBSD.dist.dtrace
     62      1.30       riz .endif
     63      1.30       riz 
     64      1.11  uebayasi .if ${MKEXTSRC} != "no"
     65      1.33  christos EXTRA_DIST_FILES+=	NetBSD.dist.extsrc
     66      1.11  uebayasi .endif
     67      1.11  uebayasi 
     68  1.37.4.1  christos .if ${MKISCSI} != "no"
     69  1.37.4.1  christos EXTRA_DIST_FILES+=	NetBSD.dist.iscsi
     70  1.37.4.1  christos .endif
     71  1.37.4.1  christos 
     72      1.22       apb NetBSD.dist:	NetBSD.dist.tmp
     73      1.22       apb 	cmp -s NetBSD.dist.tmp NetBSD.dist || { \
     74      1.14  uebayasi 		echo "Updating NetBSD.dist"; \
     75      1.22       apb 		mv NetBSD.dist.tmp NetBSD.dist; \
     76      1.14  uebayasi 	}
     77      1.35  christos # Rebuild every time
     78      1.35  christos .PHONY: NetBSD.dist.tmp
     79      1.33  christos NetBSD.dist.tmp: NetBSD.dist.base ${EXTRA_DIST_FILES}
     80      1.33  christos 	${TOOL_CAT} ${.ALLSRC} > ${.TARGET}
     81       1.1       mrg 
     82  1.37.4.1  christos NetBSD.dist.machine:
     83  1.37.4.1  christos 	${MKCREATE}
     84  1.37.4.1  christos 	echo ./usr/include/${MACHINE} > ${.TARGET}
     85  1.37.4.1  christos 
     86      1.33  christos NetBSD.dist.compat: NetBSD.dist.compat.in mkcompat.awk
     87      1.25      matt 	${MKCREATE}
     88      1.33  christos 	${TOOL_AWK} -f ${.ALLSRC:M*.awk} -v COMPATDIRS=${ARCHDIR_SUBDIR:T:Q} \
     89      1.33  christos 	    ${.ALLSRC:M*.in} > ${.TARGET}
     90      1.25      matt 
     91      1.33  christos NetBSD.dist.xcompat: NetBSD.dist.xcompat.in mkcompat.awk
     92      1.26      matt 	${MKCREATE}
     93      1.33  christos 	${TOOL_AWK} -f ${.ALLSRC:M*.awk} -v COMPATDIRS=${ARCHDIR_SUBDIR:T:Q} \
     94      1.33  christos 	    ${.ALLSRC:M*.in} > ${.TARGET}
     95      1.26      matt 
     96      1.33  christos NetBSD.dist.tests.compat: NetBSD.dist.tests mkcompattree.awk 
     97      1.25      matt 	${MKCREATE}
     98      1.36      matt 	${TOOL_AWK} -f ${.ALLSRC:M*.awk} \
     99      1.25      matt 	    -v COMPATDIRS=${ARCHDIR_SUBDIR:T:Q} -v S="usr/tests" \
    100      1.33  christos 		${.ALLSRC:M*.tests} > ${.TARGET}
    101      1.25      matt 
    102       1.5     lukem CONFIGFILES=	NetBSD.dist special
    103       1.1       mrg FILESDIR=	/etc/mtree
    104       1.1       mrg 
    105       1.6       mrg # distrib-dirs --
    106       1.6       mrg #	Populate $DESTDIR with directories needed by NetBSD
    107       1.6       mrg #
    108       1.6       mrg .if ${MKUNPRIVED} == "no"
    109       1.6       mrg TOOL_MTREE.unpriv=
    110       1.6       mrg .else
    111       1.6       mrg TOOL_MTREE.unpriv=	-W
    112       1.6       mrg .endif
    113       1.6       mrg 
    114      1.17    dyoung # postinstall(8) invokes this target to produce the right
    115      1.17    dyoung # /etc/mtree/NetBSD.dist content without duplicating logic from
    116      1.17    dyoung # the Makefile.
    117      1.17    dyoung #
    118      1.33  christos emit_dist_file:	NetBSD.dist.base ${EXTRA_DIST_FILES}
    119      1.33  christos 	@cat ${.ALLSRC}
    120      1.16    dyoung 
    121      1.10  drochner distrib-dirs: .PHONY check_DESTDIR NetBSD.dist
    122       1.6       mrg .if !defined(DISTRIBUTION_DONE)						# {
    123       1.6       mrg # Create DESTDIR using HOST_INSTALL_DIR, not INSTALL_DIR, because
    124       1.6       mrg # INSTALL_DIR would want to write to the metalog, and it can't do that
    125       1.6       mrg # if the metalog is inside DESTDIR but DESTDIR doesn't yet exist.
    126       1.6       mrg 	${HOST_INSTALL_DIR} -m 755 ${DESTDIR}
    127      1.20       jym # Invoke mtree to create the directories listed in NetBSD.dist;
    128       1.6       mrg # then invoke mtree again to register those directories in the metalog.
    129       1.6       mrg 	${TOOL_MTREE} -def ${.OBJDIR}/NetBSD.dist -N ${.CURDIR}/.. \
    130       1.6       mrg 	    -p ${DESTDIR}/ -U ${TOOL_MTREE.unpriv}
    131       1.6       mrg .if ${MKUNPRIVED} != "no"						# {
    132       1.6       mrg 	${TOOL_MTREE} -def ${.OBJDIR}/NetBSD.dist -N ${.CURDIR}/.. \
    133       1.6       mrg 	    -p ${DESTDIR}/ -C -k all | \
    134       1.6       mrg 	    ${TOOL_AWK} '/ optional/ {next} // {print}' | ${METALOG.add}
    135       1.6       mrg .endif	# MKUNPRIVED							# }
    136       1.6       mrg .endif	# DISTRIBUTION_DONE						# }
    137       1.6       mrg 
    138      1.22       apb CLEANFILES+=	NetBSD.dist NetBSD.dist.tmp
    139  1.37.4.1  christos CLEANFILES+=	NetBSD.dist.machine
    140      1.25      matt CLEANFILES+=	NetBSD.dist.compat
    141      1.25      matt CLEANFILES+=	NetBSD.dist.tests.compat
    142      1.10  drochner 
    143       1.1       mrg .include <bsd.prog.mk>
    144