2004-01-29 12:27:53 +03:00
|
|
|
# $NetBSD: Makefile,v 1.42 2004/01/29 09:27:53 lukem Exp $
|
2000-03-28 04:38:06 +04:00
|
|
|
|
|
|
|
# The `all' target must appear before bsd.own.mk is pulled in.
|
|
|
|
all:
|
|
|
|
@echo "Please understand what you are doing, first."
|
|
|
|
@false
|
|
|
|
|
|
|
|
.include <bsd.own.mk>
|
2002-05-02 22:02:14 +04:00
|
|
|
.include "${NETBSDSRCDIR}/distrib/common/Makefile.distrib"
|
2000-03-28 04:38:06 +04:00
|
|
|
|
2002-02-27 13:51:47 +03:00
|
|
|
SETSENV= DESTDIR=${DESTDIR:Q} \
|
|
|
|
MACHINE=${MACHINE:Q} MACHINE_ARCH=${MACHINE_ARCH:Q} \
|
2003-07-10 14:33:58 +04:00
|
|
|
CKSUM=${TOOL_CKSUM:Q} MAKE=${MAKE:Q} MTREE=${TOOL_MTREE:Q} \
|
2003-12-29 06:13:25 +03:00
|
|
|
MKTEMP=${TOOL_MKTEMP:Q} PAX=${TOOL_PAX:Q} HOST_SH=${HOST_SH:Q}
|
2002-02-27 13:51:47 +03:00
|
|
|
|
2004-01-08 04:48:45 +03:00
|
|
|
.if ${MKX11} != "no"
|
|
|
|
MAKEFLIST_FLAGS= -b
|
|
|
|
.else
|
|
|
|
MAKEFLIST_FLAGS=
|
|
|
|
.endif
|
|
|
|
|
2003-12-20 01:25:53 +03:00
|
|
|
.if !defined(MAKETARSETS)
|
2004-01-08 04:48:45 +03:00
|
|
|
MAKETARSETS!= ${SETSENV} ${HOST_SH} ${.CURDIR}/makeflist -l ${MAKEFLIST_FLAGS}
|
2003-12-20 01:25:53 +03:00
|
|
|
.endif
|
|
|
|
|
2004-01-29 11:34:21 +03:00
|
|
|
print_have_gcc3: .PHONY
|
2003-09-21 23:26:02 +04:00
|
|
|
@echo ${HAVE_GCC3}
|
|
|
|
|
2001-11-24 05:54:50 +03:00
|
|
|
print_machine: .PHONY
|
|
|
|
@echo ${MACHINE}
|
|
|
|
|
|
|
|
print_machine_arch: .PHONY
|
|
|
|
@echo ${MACHINE_ARCH}
|
|
|
|
|
|
|
|
print_machine_cpu: .PHONY
|
|
|
|
@echo ${MACHINE_CPU}
|
|
|
|
|
|
|
|
print_object_fmt: .PHONY
|
|
|
|
@echo ${OBJECT_FMT}
|
|
|
|
|
2002-09-20 02:04:34 +04:00
|
|
|
print_toolchain_missing: .PHONY
|
|
|
|
@echo "${TOOLCHAIN_MISSING}"
|
2001-11-24 05:54:50 +03:00
|
|
|
|
2003-08-04 09:53:20 +04:00
|
|
|
print_use_tools_toolchain: .PHONY
|
|
|
|
@echo "${USE_TOOLS_TOOLCHAIN}"
|
|
|
|
|
2002-02-11 19:23:17 +03:00
|
|
|
print_x11_version: .PHONY
|
2004-01-08 04:48:45 +03:00
|
|
|
${HOST_SH} -c '. ${.CURDIR}/sets.subr; echo $$x11_version'
|
2002-02-11 19:23:17 +03:00
|
|
|
|
2001-11-24 05:54:50 +03:00
|
|
|
# This target has debugging value only, really.
|
2002-03-05 06:51:21 +03:00
|
|
|
makeflist: .PHONY check_DESTDIR
|
2004-01-08 04:48:45 +03:00
|
|
|
${SETSENV} ${HOST_SH} ${.CURDIR}/makeflist ${MAKEFLIST_FLAGS}
|
2001-11-24 05:54:50 +03:00
|
|
|
|
2000-03-28 04:38:06 +04:00
|
|
|
#
|
|
|
|
# SET BUILDING TARGETS
|
|
|
|
#
|
|
|
|
|
2003-07-18 12:26:01 +04:00
|
|
|
.if ${MKUNPRIVED} == "no"
|
|
|
|
METALOG.unpriv=
|
|
|
|
.else
|
|
|
|
METALOG.unpriv= -M ${METALOG}
|
|
|
|
.endif
|
|
|
|
|
2004-01-29 11:34:21 +03:00
|
|
|
checkflist: .PRECIOUS .PHONY check_DESTDIR
|
2004-01-08 04:48:45 +03:00
|
|
|
${SETSENV} ${HOST_SH} ${.CURDIR}/checkflist \
|
|
|
|
${MAKEFLIST_FLAGS} ${CHECKFLIST_FLAGS} ${METALOG.unpriv}
|
2000-03-28 04:38:06 +04:00
|
|
|
|
2004-01-29 11:34:21 +03:00
|
|
|
checkflist-x11: .PHONY check_DESTDIR
|
2003-09-30 10:26:37 +04:00
|
|
|
${SETSENV} ${HOST_SH} ${.CURDIR}/checkflist -x ${CHECKFLIST_FLAGS}
|
2002-01-01 10:59:32 +03:00
|
|
|
|
2004-01-29 11:34:21 +03:00
|
|
|
maketars: .PRECIOUS .PHONY check_DESTDIR check_RELEASEDIR .WAIT \
|
|
|
|
maketarsetup .WAIT ${MAKETARSETS:@.TARS.@do-${.TARS.}@}
|
2003-12-20 01:25:53 +03:00
|
|
|
@true
|
|
|
|
|
|
|
|
maketarsetup: .PHONY
|
2003-01-12 21:51:26 +03:00
|
|
|
.if defined(DESTDIR) && ${DESTDIR} != ""
|
2003-09-30 10:26:37 +04:00
|
|
|
${MAKE} checkflist
|
2002-07-09 20:08:38 +04:00
|
|
|
.endif
|
2003-01-30 15:16:18 +03:00
|
|
|
mkdir -p ${RELEASEDIR}/${MACHINE}/binary/sets
|
2003-12-22 07:56:53 +03:00
|
|
|
for i in BSDSUM CKSUM MD5 SYSVSUM; do \
|
2003-12-29 07:46:18 +03:00
|
|
|
rm -f ${RELEASEDIR}/${MACHINE}/binary/sets/$$i ${RELEASEDIR}/${MACHINE}/binary/sets/$$i.tmp; done
|
2003-12-22 07:56:53 +03:00
|
|
|
|
2003-12-20 01:25:53 +03:00
|
|
|
.for tar in ${MAKETARSETS}
|
2003-12-29 07:46:18 +03:00
|
|
|
do-${tar}: .PHONY
|
2003-05-10 10:08:12 +04:00
|
|
|
${SETSENV} ${HOST_SH} ${.CURDIR}/maketars -d ${DESTDIR:S,^$,/,} \
|
2003-07-18 12:26:01 +04:00
|
|
|
${METALOG.unpriv} -N ${NETBSDSRCDIR}/etc \
|
2004-01-29 12:27:53 +03:00
|
|
|
-t ${RELEASEDIR}/${MACHINE}/binary/sets ${tar} \
|
|
|
|
|| rm -f ${RELEASEDIR}/${MACHINE}/binary/sets/${tar}.tgz
|
2003-12-20 01:25:53 +03:00
|
|
|
.endfor
|
2000-03-28 04:38:06 +04:00
|
|
|
|
2004-01-29 11:34:21 +03:00
|
|
|
makesrctars: .PRECIOUS .PHONY check_RELEASEDIR
|
2003-05-10 10:08:12 +04:00
|
|
|
mkdir -p ${RELEASEDIR}/source/sets
|
|
|
|
${SETSENV} ${HOST_SH} ${.CURDIR}/makesrctars \
|
|
|
|
${NETBSDSRCDIR} ${RELEASEDIR}/source/sets
|
|
|
|
|
2004-01-29 11:34:21 +03:00
|
|
|
makesums: .PRECIOUS .PHONY check_RELEASEDIR .WAIT \
|
|
|
|
${MAKETARSETS:@.TARS.@do-sum-${.TARS.}@}
|
2003-12-22 07:56:53 +03:00
|
|
|
for i in BSDSUM CKSUM MD5 SYSVSUM; do \
|
|
|
|
mv ${RELEASEDIR}/${MACHINE}/binary/sets/$$i.tmp \
|
|
|
|
${RELEASEDIR}/${MACHINE}/binary/sets/$$i; done
|
2003-12-20 01:25:53 +03:00
|
|
|
|
|
|
|
.for tar in ${MAKETARSETS}
|
2003-12-29 07:46:18 +03:00
|
|
|
do-sum-${tar}: .PHONY do-${tar}
|
2004-01-29 11:34:21 +03:00
|
|
|
${SETSENV} ${MAKESUMS} \
|
|
|
|
-t ${RELEASEDIR}/${MACHINE}/binary/sets ${tar}.tgz
|
2003-12-22 07:56:53 +03:00
|
|
|
for i in BSDSUM CKSUM MD5 SYSVSUM; do \
|
2004-01-29 11:34:21 +03:00
|
|
|
${TOOL_CAT} ${RELEASEDIR}/${MACHINE}/binary/sets/$$i \
|
|
|
|
>> ${RELEASEDIR}/${MACHINE}/binary/sets/$$i.tmp; \
|
2003-12-22 07:56:53 +03:00
|
|
|
done
|
2003-12-20 01:25:53 +03:00
|
|
|
.endfor
|
2003-12-28 12:27:41 +03:00
|
|
|
.ORDER: ${MAKETARSETS:@.TARS.@do-sum-${.TARS.}@}
|
2000-03-28 04:38:06 +04:00
|
|
|
|
2004-01-29 11:34:21 +03:00
|
|
|
installsets: .PHONY check_DESTDIR
|
2002-12-12 11:54:25 +03:00
|
|
|
.if !defined(INSTALLDIR)
|
|
|
|
@echo "setenv INSTALLDIR before doing that!"
|
|
|
|
@false
|
|
|
|
.endif
|
2003-05-10 10:08:12 +04:00
|
|
|
${SETSENV} ${HOST_SH} ${.CURDIR}/maketars -d ${DESTDIR:S,^$,/,} \
|
2004-01-29 11:34:21 +03:00
|
|
|
${METALOG.unpriv} -N ${NETBSDSRCDIR}/etc ${MAKEFLIST_FLAGS} \
|
2002-12-19 09:21:45 +03:00
|
|
|
-i ${INSTALLDIR} ${INSTALLSETS}
|
2002-12-12 11:54:25 +03:00
|
|
|
|
2000-03-28 04:38:06 +04:00
|
|
|
#
|
|
|
|
# MAIN ENTRY POINTS
|
|
|
|
#
|
|
|
|
|
2004-01-29 11:34:21 +03:00
|
|
|
sets: .PHONY maketars .WAIT makesums
|
2000-03-28 04:38:06 +04:00
|
|
|
@true
|
2002-03-23 02:15:32 +03:00
|
|
|
|
2004-01-29 11:34:21 +03:00
|
|
|
sourcesets: .PHONY makesrctars
|
2003-05-10 10:08:12 +04:00
|
|
|
@true
|
|
|
|
|
2002-03-23 02:15:32 +03:00
|
|
|
.include <bsd.sys.mk>
|