1 1.45 abs # $NetBSD: Makefile,v 1.45 2021/11/02 22:09:17 abs Exp $ 2 1.1 mrg # 3 1.9 fredb # Targets & Variables 4 1.9 fredb # 5 1.9 fredb # build: Clean out xsrc, and build and install everything that goes 6 1.45 abs # under /usr/X11R7. 7 1.9 fredb # 8 1.9 fredb # DESTDIR -- Set to an alternative directory to install under. 9 1.9 fredb # UPDATE -- If set, don't make clean first, plus attempt to make 10 1.9 fredb # only the targets that are out of date. 11 1.9 fredb # 12 1.9 fredb # release snapshot: Same as build, plus tar up the X sets and install 13 1.38 tron # them under the ${RELEASEDIR}/binary/sets directory (NetBSD <=1.6) 14 1.38 tron # or the ${RELEASEDIR}/${MACHINE}/binary/sets directory (NetBSD >1.6). 15 1.9 fredb # 16 1.9 fredb # DESTDIR -- Same as for build. Mandatory for building a release. 17 1.9 fredb # RELEASEDIR -- As explained above. 18 1.9 fredb # BUILD_DONE -- If set, assume build is already done. 19 1.9 fredb # INSTALL_DONE -- If set, assume binaries to tar up are to be found 20 1.9 fredb # in ${DESTDIR} already. 21 1.31 lukem # NETBSDSRCDIR -- Set to the full path to the main source tree, /usr/src 22 1.9 fredb # by default. Needed to find ./distrib/sets. 23 1.9 fredb # 24 1.9 fredb # cleandir distclean: Remove all generated files from under xsrc. 25 1.9 fredb # 26 1.9 fredb # clean: Remove object files, but keep imake generated makefiles. 27 1.9 fredb 28 1.12 hubertf .include <bsd.own.mk> 29 1.32 tron 30 1.32 tron # Backwards compatibility with NetBSD 1.5 and 1.5.x where NETBSDSRCDIR 31 1.32 tron # doesn't get defined by "bsd.own.mk". 32 1.32 tron NETBSDSRCDIR?= ${BSDSRCDIR} 33 1.12 hubertf 34 1.21 tron XCDIR= xfree/xc 35 1.40 lukem 36 1.19 fredb .MAIN: all 37 1.29 jwise all: all-xc all-local 38 1.4 tv 39 1.4 tv all-xc: 40 1.21 tron .if exists(${XCDIR}/xmakefile) && defined(UPDATE) 41 1.21 tron @cd ${XCDIR} && ${MAKE} Everything 42 1.4 tv .else 43 1.21 tron @-rm -f ${XCDIR}/xmakefile 44 1.21 tron @cd ${XCDIR} && ${MAKE} World 45 1.4 tv .endif 46 1.1 mrg 47 1.15 thorpej all-local: 48 1.15 thorpej @if [ ! -f local/Makefile ]; then \ 49 1.21 tron cd local && PATH=../${XCDIR}/config/imake:$$PATH \ 50 1.23 tron sh ../${XCDIR}/config/util/xmkmf -a ../${XCDIR} \ 51 1.23 tron ${.CURDIR}/local; \ 52 1.15 thorpej fi 53 1.15 thorpej @cd local && ${MAKE} 54 1.15 thorpej 55 1.29 jwise install: install-xc install-local 56 1.1 mrg 57 1.1 mrg install-xc: 58 1.27 fredb @cd ${XCDIR} && \ 59 1.27 fredb ${MAKE} DESTDIR="${DESTDIR}" install && \ 60 1.27 fredb ${MAKE} DESTDIR="${DESTDIR}" install.man 61 1.1 mrg 62 1.15 thorpej install-local: 63 1.27 fredb @cd local && \ 64 1.27 fredb ${MAKE} DESTDIR="${DESTDIR}" install && \ 65 1.27 fredb ${MAKE} DESTDIR="${DESTDIR}" install.man 66 1.3 mrg 67 1.6 tron clean: 68 1.21 tron @-cd ${XCDIR} && ${MAKE} clean 69 1.16 tron @-cd local && ${MAKE} clean 70 1.6 tron 71 1.7 fredb cleandir distclean: clean 72 1.44 tron find ${XCDIR} local -name .depend | xargs -n5 rm 73 1.44 tron find ${XCDIR} local -name 'Makefile*' | \ 74 1.37 fredb xargs -n5 grep -l "Makefile generated by imake" | xargs rm 75 1.21 tron -rmdir ${XCDIR}/exports 76 1.42 tron rm -f ${XCDIR}/xmakefile ${XCDIR}/config/cf/version.def \ 77 1.42 tron ${XCDIR}/config/cf/date.def 78 1.5 tv 79 1.5 tv build: 80 1.7 fredb .if defined(UPDATE) 81 1.28 mrg @${MAKE} all && ${MAKE} install 82 1.7 fredb .else 83 1.28 mrg @${MAKE} cleandir && ${MAKE} all && ${MAKE} install 84 1.5 tv .endif 85 1.9 fredb 86 1.9 fredb # release goo 87 1.9 fredb # 88 1.9 fredb .if !defined(DESTDIR) 89 1.9 fredb release snapshot: 90 1.9 fredb @echo setenv DESTDIR before doing that! 91 1.9 fredb @false 92 1.9 fredb .elif !defined(RELEASEDIR) 93 1.9 fredb release snapshot: 94 1.9 fredb @echo setenv RELEASEDIR before doing that! 95 1.9 fredb @false 96 1.9 fredb # 97 1.9 fredb .else 98 1.9 fredb # 99 1.9 fredb .if defined(INSTALL_DONE) 100 1.9 fredb release snapshot: 101 1.9 fredb .elif defined(BUILD_DONE) 102 1.9 fredb release snapshot: install 103 1.9 fredb .else 104 1.9 fredb release snapshot: build 105 1.9 fredb # 106 1.9 fredb .endif # INSTALL_DONE or BUILD_DONE 107 1.9 fredb # 108 1.36 matt ${INSTALL} -d -m 755 -o root -g wheel ${RELEASEDIR}/${MACHINE}/binary/sets 109 1.41 tron ${INSTALL} -d -m 755 -o root -g wheel ${DESTDIR}/etc/mtree 110 1.39 tron .if defined(METALOG.add) && !exists(${DESTDIR}/etc/master.passwd) 111 1.34 tron cd ${NETBSDSRCDIR}/distrib/sets && \ 112 1.36 matt sh ./maketars -x -d ${DESTDIR:S,^$,/,} -N ${NETBSDSRCDIR}/etc -t ${RELEASEDIR}/${MACHINE}/binary/sets 113 1.34 tron .else 114 1.31 lukem cd ${NETBSDSRCDIR}/distrib/sets && \ 115 1.36 matt sh ./maketars -x -d ${DESTDIR:S,^$,/,} -t ${RELEASEDIR}/${MACHINE}/binary/sets 116 1.34 tron .endif 117 1.36 matt cd ${RELEASEDIR}/${MACHINE}/binary/sets && \ 118 1.9 fredb cksum -o 1 *.tgz >BSDSUM && \ 119 1.9 fredb cksum *.tgz >CKSUM && \ 120 1.9 fredb cksum -m *.tgz >MD5 && \ 121 1.9 fredb cksum -o 2 *.tgz >SYSVSUM 122 1.9 fredb # 123 1.13 fredb .endif # DESTDIR and RELEASEDIR check 124