Makefile revision 99e715b7
199e715b7Sis# $NetBSD: Makefile,v 1.20 2000/11/08 06:35:41 is Exp $ 23cbc2fa9Smrg# 3b1c0e358Sfredb# Targets & Variables 4b1c0e358Sfredb# 5b1c0e358Sfredb# build: Clean out xsrc, and build and install everything that goes 6b1c0e358Sfredb# under /usr/X11R6. 7b1c0e358Sfredb# 8b1c0e358Sfredb# DESTDIR -- Set to an alternative directory to install under. 9b1c0e358Sfredb# UPDATE -- If set, don't make clean first, plus attempt to make 10b1c0e358Sfredb# only the targets that are out of date. 11b1c0e358Sfredb# 12b1c0e358Sfredb# release snapshot: Same as build, plus tar up the X sets and install 13b1c0e358Sfredb# them under the ${RELEASEDIR}/binary/sets directory. 14b1c0e358Sfredb# 15b1c0e358Sfredb# DESTDIR -- Same as for build. Mandatory for building a release. 16b1c0e358Sfredb# RELEASEDIR -- As explained above. 17b1c0e358Sfredb# BUILD_DONE -- If set, assume build is already done. 18b1c0e358Sfredb# INSTALL_DONE -- If set, assume binaries to tar up are to be found 19b1c0e358Sfredb# in ${DESTDIR} already. 20b1c0e358Sfredb# BSDSRCDIR -- Set to the full path to the main source tree, /usr/src 21b1c0e358Sfredb# by default. Needed to find ./distrib/sets. 22b1c0e358Sfredb# 23b1c0e358Sfredb# cleandir distclean: Remove all generated files from under xsrc. 24b1c0e358Sfredb# 25b1c0e358Sfredb# clean: Remove object files, but keep imake generated makefiles. 26b1c0e358Sfredb 2719cf06cfShubertf.include <bsd.own.mk> 2819cf06cfShubertf 29a63b1a70Sfredb.MAIN: all 30456141b6Sthorpejall: all-xc all-contrib all-local 31b583040eStv 32b583040eStvall-xc: 3334e496fbSfredb.if exists(xc/xmakefile) && defined(UPDATE) 3434e496fbSfredb @cd xc && ${MAKE} Everything 35b583040eStv.else 3634e496fbSfredb @-rm -f xc/xmakefile 37b583040eStv @cd xc && ${MAKE} World 38b583040eStv.endif 393cbc2fa9Smrg 403cbc2fa9Smrgall-contrib: 41f766d8bfSfredb @if [ ! -f contrib/Makefile ]; then \ 42f766d8bfSfredb cd contrib && PATH=../xc/config/imake:$$PATH \ 43f766d8bfSfredb sh ../xc/config/util/xmkmf -a ../xc ../contrib; \ 44f766d8bfSfredb fi 45b583040eStv @cd contrib && ${MAKE} 463cbc2fa9Smrg 47456141b6Sthorpejall-local: 48456141b6Sthorpej @if [ ! -f local/Makefile ]; then \ 49456141b6Sthorpej cd local && PATH=../xc/config/imake:$$PATH \ 50456141b6Sthorpej sh ../xc/config/util/xmkmf -a ../xc ../local; \ 51456141b6Sthorpej fi 52456141b6Sthorpej @cd local && ${MAKE} 53456141b6Sthorpej 54456141b6Sthorpejinstall: install-xc install-contrib install-local 553cbc2fa9Smrg 563cbc2fa9Smrginstall-xc: 57b583040eStv @cd xc && ${MAKE} install && ${MAKE} install.man 583cbc2fa9Smrg 593cbc2fa9Smrginstall-contrib: 60b583040eStv @cd contrib && ${MAKE} install && ${MAKE} install.man 615c5d6177Smrg 62456141b6Sthorpejinstall-local: 63456141b6Sthorpej @cd local && ${MAKE} install && ${MAKE} install.man 64456141b6Sthorpej 657e6ae19cStronclean: 6634e496fbSfredb @-cd xc && ${MAKE} clean 67b583040eStv @-cd contrib && ${MAKE} clean 6895c20adcStron @-cd local && ${MAKE} clean 6990360741Stv 7034e496fbSfredbcleandir distclean: clean 7195c20adcStron find xc contrib local -name .depend | xargs rm 7295c20adcStron find xc contrib local -name 'Makefile*' | \ 737c7a996aSsimonb xargs grep -l "Makefile generated by imake" | xargs rm 747e6ae19cStron -rmdir xc/exports 757e6ae19cStron rm -f xc/xmakefile 767e6ae19cStron 7790360741Stvbuild: 7834e496fbSfredb.if defined(UPDATE) 7990360741Stv @${MAKE} all install 8034e496fbSfredb.else 8134e496fbSfredb @${MAKE} cleandir all install 8234e496fbSfredb.endif 83b1c0e358Sfredb 84b1c0e358Sfredb# release goo 85b1c0e358Sfredb# 86b1c0e358Sfredb.if !defined(DESTDIR) 87b1c0e358Sfredbrelease snapshot: 88b1c0e358Sfredb @echo setenv DESTDIR before doing that! 89b1c0e358Sfredb @false 90b1c0e358Sfredb.elif !defined(RELEASEDIR) 91b1c0e358Sfredbrelease snapshot: 92b1c0e358Sfredb @echo setenv RELEASEDIR before doing that! 93b1c0e358Sfredb @false 94b1c0e358Sfredb# 95b1c0e358Sfredb.else 96b1c0e358Sfredb# 97b1c0e358Sfredb.if defined(INSTALL_DONE) 98b1c0e358Sfredbrelease snapshot: 99b1c0e358Sfredb.elif defined(BUILD_DONE) 100b1c0e358Sfredbrelease snapshot: install 101b1c0e358Sfredb.else 102b1c0e358Sfredbrelease snapshot: build 103b1c0e358Sfredb# 104b1c0e358Sfredb.endif # INSTALL_DONE or BUILD_DONE 105b1c0e358Sfredb# 106b1c0e358Sfredb ${INSTALL} -d -m 755 -o root -g wheel ${RELEASEDIR}/binary/sets 107761ef8e1Sis.if ${MACHINE} == "amiga" 108761ef8e1Sis cd xc/programs/Xserver/hw/netbsd/amiga && \ 10999e715b7Sis ${INSTALL} -c -m 644 INSTALL.X11 ${RELEASEDIR} 110761ef8e1Sis.endif 111231ff5f5Sfredb sh ${BSDSRCDIR}/distrib/sets/maketars -x -s ${BSDSRCDIR}/distrib/sets \ 112b1c0e358Sfredb -d ${DESTDIR} -t ${RELEASEDIR}/binary/sets 113b1c0e358Sfredb cd ${RELEASEDIR}/binary/sets && \ 114b1c0e358Sfredb cksum -o 1 *.tgz >BSDSUM && \ 115b1c0e358Sfredb cksum *.tgz >CKSUM && \ 116b1c0e358Sfredb cksum -m *.tgz >MD5 && \ 117b1c0e358Sfredb cksum -o 2 *.tgz >SYSVSUM 118b1c0e358Sfredb# 119e99d7581Sfredb.endif # DESTDIR and RELEASEDIR check 120b1c0e358Sfredb 121