Home | History | Annotate | Line # | Download | only in sets
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.
      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.@do-${.TARS.}@}
     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 ${RELEASEDIR}/${MACHINE}/binary/sets/$$i.tmp; done
     82 	
     83 .for tar in ${MAKETARSETS}
     84 do-${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
     91 makesrctars: check_RELEASEDIR
     92 	mkdir -p ${RELEASEDIR}/source/sets
     93 	${SETSENV} ${HOST_SH} ${.CURDIR}/makesrctars \
     94 	    ${NETBSDSRCDIR} ${RELEASEDIR}/source/sets
     95 
     96 .PRECIOUS: makesums
     97 makesums: 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}
    103 do-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
    112 installsets: 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 
    125 sets: maketars .WAIT makesums
    126 	@true
    127 
    128 sourcesets: makesrctars
    129 	@true
    130 
    131 .include <bsd.sys.mk>
    132