1 # $NetBSD: Makefile,v 1.38 2003/12/29 03:13:25 lukem Exp $ 2 3 # The `all' target must appear before bsd.own.mk is pulled in. 4 all: 5 @echo "Please understand what you are doing, first." 6 @false 7 8 .include <bsd.own.mk> 9 .include "${NETBSDSRCDIR}/distrib/common/Makefile.distrib" 10 11 SETSENV= DESTDIR=${DESTDIR:Q} \ 12 MACHINE=${MACHINE:Q} MACHINE_ARCH=${MACHINE_ARCH:Q} \ 13 CKSUM=${TOOL_CKSUM:Q} MAKE=${MAKE:Q} MTREE=${TOOL_MTREE:Q} \ 14 MKTEMP=${TOOL_MKTEMP:Q} PAX=${TOOL_PAX:Q} HOST_SH=${HOST_SH:Q} 15 16 .if !defined(MAKETARSETS) 17 MAKETARSETS!= ${SETSENV} ${HOST_SH} -c '. ${.CURDIR}/sets.subr; echo $${nlists}' 18 .endif 19 20 print_have_gcc3: 21 @echo ${HAVE_GCC3} 22 23 print_machine: .PHONY 24 @echo ${MACHINE} 25 26 print_machine_arch: .PHONY 27 @echo ${MACHINE_ARCH} 28 29 print_machine_cpu: .PHONY 30 @echo ${MACHINE_CPU} 31 32 print_object_fmt: .PHONY 33 @echo ${OBJECT_FMT} 34 35 print_toolchain_missing: .PHONY 36 @echo "${TOOLCHAIN_MISSING}" 37 38 print_use_tools_toolchain: .PHONY 39 @echo "${USE_TOOLS_TOOLCHAIN}" 40 41 print_x11_version: .PHONY 42 .if defined(USE_XF86_4) && (${USE_XF86_4} != no) 43 @echo 4 44 .else 45 @echo 3 46 .endif 47 48 # This target has debugging value only, really. 49 makeflist: .PHONY check_DESTDIR 50 ${SETSENV} ${HOST_SH} ${.CURDIR}/makeflist 51 52 # 53 # SET BUILDING TARGETS 54 # 55 56 .if ${MKUNPRIVED} == "no" 57 METALOG.unpriv= 58 .else 59 METALOG.unpriv= -M ${METALOG} 60 .endif 61 62 .PRECIOUS: checkflist 63 checkflist: check_DESTDIR 64 ${SETSENV} ${HOST_SH} ${.CURDIR}/checkflist ${CHECKFLIST_FLAGS} \ 65 ${METALOG.unpriv} 66 67 .PRECIOUS: checkflist-x11 68 checkflist-x11: check_DESTDIR 69 ${SETSENV} ${HOST_SH} ${.CURDIR}/checkflist -x ${CHECKFLIST_FLAGS} 70 71 .PRECIOUS: maketars 72 maketars: check_DESTDIR check_RELEASEDIR .WAIT maketarsetup .WAIT ${MAKETARSETS:@.TARS.@${RELEASEDIR}/${MACHINE}/binary/sets/${.TARS.}.tgz@} 73 @true 74 75 maketarsetup: .PHONY 76 .if defined(DESTDIR) && ${DESTDIR} != "" 77 ${MAKE} checkflist 78 .endif 79 mkdir -p ${RELEASEDIR}/${MACHINE}/binary/sets 80 for i in BSDSUM CKSUM MD5 SYSVSUM; do \ 81 rm -f ${RELEASEDIR}/${MACHINE}/binary/sets/$$i.tmp; done 82 -[ "${MAKETARSETS}" ] && for i in ${MAKETARSETS}; do \ 83 rm -f ${RELEASEDIR}/${MACHINE}/binary/sets/$$i.tgz; done 84 85 .for tar in ${MAKETARSETS} 86 ${RELEASEDIR}/${MACHINE}/binary/sets/${tar}.tgz: 87 ${SETSENV} ${HOST_SH} ${.CURDIR}/maketars -d ${DESTDIR:S,^$,/,} \ 88 ${METALOG.unpriv} -N ${NETBSDSRCDIR}/etc \ 89 -t ${RELEASEDIR}/${MACHINE}/binary/sets ${tar} 90 .endfor 91 92 .PRECIOUS: makesrctars 93 makesrctars: check_RELEASEDIR 94 mkdir -p ${RELEASEDIR}/source/sets 95 ${SETSENV} ${HOST_SH} ${.CURDIR}/makesrctars \ 96 ${NETBSDSRCDIR} ${RELEASEDIR}/source/sets 97 98 .PRECIOUS: makesums 99 makesums: check_RELEASEDIR .WAIT ${MAKETARSETS:@.TARS.@do-sum-${.TARS.}@} 100 for i in BSDSUM CKSUM MD5 SYSVSUM; do \ 101 mv ${RELEASEDIR}/${MACHINE}/binary/sets/$$i.tmp \ 102 ${RELEASEDIR}/${MACHINE}/binary/sets/$$i; done 103 104 .for tar in ${MAKETARSETS} 105 do-sum-${tar}: .PHONY ${RELEASEDIR}/${MACHINE}/binary/sets/${tar}.tgz 106 ${SETSENV} ${MAKESUMS} -t ${RELEASEDIR}/${MACHINE}/binary/sets ${tar}.tgz 107 for i in BSDSUM CKSUM MD5 SYSVSUM; do \ 108 ${TOOL_CAT} ${RELEASEDIR}/${MACHINE}/binary/sets/$$i >> ${RELEASEDIR}/${MACHINE}/binary/sets/$$i.tmp; \ 109 done 110 .endfor 111 .ORDER: ${MAKETARSETS:@.TARS.@do-sum-${.TARS.}@} 112 113 .PRECIOUS: installsets 114 installsets: check_DESTDIR 115 .if !defined(INSTALLDIR) 116 @echo "setenv INSTALLDIR before doing that!" 117 @false 118 .endif 119 ${SETSENV} ${HOST_SH} ${.CURDIR}/maketars -d ${DESTDIR:S,^$,/,} \ 120 ${METALOG.unpriv} -N ${NETBSDSRCDIR}/etc \ 121 -i ${INSTALLDIR} ${INSTALLSETS} 122 123 # 124 # MAIN ENTRY POINTS 125 # 126 127 sets: maketars .WAIT makesums 128 @true 129 130 sourcesets: makesrctars 131 @true 132 133 .include <bsd.sys.mk> 134