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