Makefile revision 1.33
1#	$NetBSD: Makefile,v 1.33 2003/12/19 22:25:53 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} 
15
16.if !defined(MAKETARSETS)
17MAKETARSETS!=	${SETSENV} ${HOST_SH} -c '. sets.defaults; echo $${lists}'
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.@${RELEASEDIR}/${MACHINE}/binary/sets/${.TARS.}.tgz@}
73	@true
74
75maketarsetup: .PHONY
76.if defined(DESTDIR) && ${DESTDIR} != ""
77	${MAKE} checkflist
78.endif
79	mkdir -p ${RELEASEDIR}/${MACHINE}/binary/sets
80
81.for tar in ${MAKETARSETS}
82${RELEASEDIR}/${MACHINE}/binary/sets/${tar}.tgz:
83	${SETSENV} ${HOST_SH} ${.CURDIR}/maketars -d ${DESTDIR:S,^$,/,} \
84	    ${METALOG.unpriv} -N ${NETBSDSRCDIR}/etc \
85	    -t ${RELEASEDIR}/${MACHINE}/binary/sets ${tar}
86.endfor
87
88.PRECIOUS: makesrctars
89makesrctars: check_RELEASEDIR
90	mkdir -p ${RELEASEDIR}/source/sets
91	${SETSENV} ${HOST_SH} ${.CURDIR}/makesrctars \
92	    ${NETBSDSRCDIR} ${RELEASEDIR}/source/sets
93
94.PRECIOUS: makesums
95makesums: check_RELEASEDIR .WAIT ${MAKETARSETS:@.TARS.@do-sum-${.TARS.}@}
96	@true
97
98.for tar in ${MAKETARSETS}
99do-sum-${tar}: .PHONY ${RELEASEDIR}/${MACHINE}/binary/sets/${tar}.tgz
100	${SETSENV} ${MAKESUMS} -t ${RELEASEDIR}/${MACHINE}/binary/sets ${tar}.tgz
101.endfor
102
103.PRECIOUS: installsets
104installsets: check_DESTDIR
105.if !defined(INSTALLDIR)
106	@echo "setenv INSTALLDIR before doing that!"
107	@false
108.endif
109	${SETSENV} ${HOST_SH} ${.CURDIR}/maketars -d ${DESTDIR:S,^$,/,} \
110	    ${METALOG.unpriv} -N ${NETBSDSRCDIR}/etc \
111	    -i ${INSTALLDIR} ${INSTALLSETS}
112
113#
114# MAIN ENTRY POINTS
115#
116
117sets: maketars .WAIT makesums
118	@true
119
120sourcesets: makesrctars
121	@true
122
123.include <bsd.sys.mk>
124