Makefile revision 1.39
1#	$NetBSD: Makefile,v 1.39 2003/12/29 04:46:18 jmc Exp $
2
3# The `all' target must appear before bsd.own.mk is pulled in.
4all:
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
11SETSENV=	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)
17MAKETARSETS!=	${SETSENV} ${HOST_SH} -c '. ${.CURDIR}/sets.subr; echo $${nlists}'
18.endif
19
20print_have_gcc3:
21	@echo ${HAVE_GCC3}
22
23print_machine: .PHONY
24	@echo ${MACHINE}
25
26print_machine_arch: .PHONY
27	@echo ${MACHINE_ARCH}
28
29print_machine_cpu: .PHONY
30	@echo ${MACHINE_CPU}
31
32print_object_fmt: .PHONY
33	@echo ${OBJECT_FMT}
34
35print_toolchain_missing: .PHONY
36	@echo "${TOOLCHAIN_MISSING}"
37
38print_use_tools_toolchain: .PHONY
39	@echo "${USE_TOOLS_TOOLCHAIN}"
40
41print_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.
49makeflist: .PHONY check_DESTDIR
50	${SETSENV} ${HOST_SH} ${.CURDIR}/makeflist
51
52#
53# SET BUILDING TARGETS
54#
55
56.if ${MKUNPRIVED} == "no"
57METALOG.unpriv=
58.else
59METALOG.unpriv=	-M ${METALOG}
60.endif
61
62.PRECIOUS: checkflist
63checkflist: check_DESTDIR
64	${SETSENV} ${HOST_SH} ${.CURDIR}/checkflist ${CHECKFLIST_FLAGS} \
65	    ${METALOG.unpriv}
66
67.PRECIOUS: checkflist-x11
68checkflist-x11: check_DESTDIR
69	${SETSENV} ${HOST_SH} ${.CURDIR}/checkflist -x ${CHECKFLIST_FLAGS}
70
71.PRECIOUS: maketars
72maketars: check_DESTDIR check_RELEASEDIR .WAIT maketarsetup .WAIT ${MAKETARSETS:@.TARS.@do-${.TARS.}@}
73	@true
74
75maketarsetup: .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 ${RELEASEDIR}/${MACHINE}/binary/sets/$$i.tmp; done
82	
83.for tar in ${MAKETARSETS}
84do-${tar}: .PHONY
85	${SETSENV} ${HOST_SH} ${.CURDIR}/maketars -d ${DESTDIR:S,^$,/,} \
86	    ${METALOG.unpriv} -N ${NETBSDSRCDIR}/etc \
87	    -t ${RELEASEDIR}/${MACHINE}/binary/sets ${tar}
88.endfor
89
90.PRECIOUS: makesrctars
91makesrctars: check_RELEASEDIR
92	mkdir -p ${RELEASEDIR}/source/sets
93	${SETSENV} ${HOST_SH} ${.CURDIR}/makesrctars \
94	    ${NETBSDSRCDIR} ${RELEASEDIR}/source/sets
95
96.PRECIOUS: makesums
97makesums: check_RELEASEDIR .WAIT ${MAKETARSETS:@.TARS.@do-sum-${.TARS.}@}
98	for i in BSDSUM CKSUM MD5 SYSVSUM; do \
99		mv ${RELEASEDIR}/${MACHINE}/binary/sets/$$i.tmp \
100			${RELEASEDIR}/${MACHINE}/binary/sets/$$i; done
101
102.for tar in ${MAKETARSETS}
103do-sum-${tar}: .PHONY do-${tar}
104	${SETSENV} ${MAKESUMS} -t ${RELEASEDIR}/${MACHINE}/binary/sets ${tar}.tgz
105	for i in BSDSUM CKSUM MD5 SYSVSUM; do \
106		${TOOL_CAT} ${RELEASEDIR}/${MACHINE}/binary/sets/$$i >> ${RELEASEDIR}/${MACHINE}/binary/sets/$$i.tmp; \
107	done
108.endfor
109.ORDER: ${MAKETARSETS:@.TARS.@do-sum-${.TARS.}@}
110
111.PRECIOUS: installsets
112installsets: check_DESTDIR
113.if !defined(INSTALLDIR)
114	@echo "setenv INSTALLDIR before doing that!"
115	@false
116.endif
117	${SETSENV} ${HOST_SH} ${.CURDIR}/maketars -d ${DESTDIR:S,^$,/,} \
118	    ${METALOG.unpriv} -N ${NETBSDSRCDIR}/etc \
119	    -i ${INSTALLDIR} ${INSTALLSETS}
120
121#
122# MAIN ENTRY POINTS
123#
124
125sets: maketars .WAIT makesums
126	@true
127
128sourcesets: makesrctars
129	@true
130
131.include <bsd.sys.mk>
132