1 # $NetBSD: Makefile,v 1.14 2000/03/12 11:16:55 dbj Exp $ 2 # 3 # Targets & Variables 4 # 5 # build: Clean out xsrc, and build and install everything that goes 6 # under /usr/X11R6. 7 # 8 # DESTDIR -- Set to an alternative directory to install under. 9 # UPDATE -- If set, don't make clean first, plus attempt to make 10 # only the targets that are out of date. 11 # 12 # release snapshot: Same as build, plus tar up the X sets and install 13 # them under the ${RELEASEDIR}/binary/sets directory. 14 # 15 # DESTDIR -- Same as for build. Mandatory for building a release. 16 # RELEASEDIR -- As explained above. 17 # BUILD_DONE -- If set, assume build is already done. 18 # INSTALL_DONE -- If set, assume binaries to tar up are to be found 19 # in ${DESTDIR} already. 20 # BSDSRCDIR -- Set to the full path to the main source tree, /usr/src 21 # by default. Needed to find ./distrib/sets. 22 # 23 # cleandir distclean: Remove all generated files from under xsrc. 24 # 25 # clean: Remove object files, but keep imake generated makefiles. 26 27 .include <bsd.own.mk> 28 29 30 all: all-xc all-contrib 31 32 all-xc: 33 .if exists(xc/xmakefile) && defined(UPDATE) 34 @cd xc && ${MAKE} Everything 35 .else 36 @-rm -f xc/xmakefile 37 @cd xc && ${MAKE} World 38 .endif 39 40 all-contrib: 41 @if [ ! -f contrib/Makefile ]; then \ 42 cd contrib && PATH=../xc/config/imake:$$PATH \ 43 sh ../xc/config/util/xmkmf -a ../xc ../contrib; \ 44 fi 45 @cd contrib && ${MAKE} 46 47 install: install-xc install-contrib 48 49 install-xc: 50 @cd xc && ${MAKE} install && ${MAKE} install.man 51 52 install-contrib: 53 @cd contrib && ${MAKE} install && ${MAKE} install.man 54 55 clean: 56 @-cd xc && ${MAKE} clean 57 @-cd contrib && ${MAKE} clean 58 59 cleandir distclean: clean 60 find xc contrib -name .depend | xargs rm 61 find xc contrib -name 'Makefile*' | \ 62 xargs grep -l "Makefile generated by imake" | xargs rm 63 -rmdir xc/exports 64 rm -f xc/xmakefile 65 66 build: 67 .if defined(UPDATE) 68 @${MAKE} all install 69 .else 70 @${MAKE} cleandir all install 71 .endif 72 73 # release goo 74 # 75 .if !defined(DESTDIR) 76 release snapshot: 77 @echo setenv DESTDIR before doing that! 78 @false 79 .elif !defined(RELEASEDIR) 80 release snapshot: 81 @echo setenv RELEASEDIR before doing that! 82 @false 83 # 84 .else 85 # 86 .if defined(INSTALL_DONE) 87 release snapshot: 88 .elif defined(BUILD_DONE) 89 release snapshot: install 90 .else 91 release snapshot: build 92 # 93 .endif # INSTALL_DONE or BUILD_DONE 94 # 95 ${INSTALL} -d -m 755 -o root -g wheel ${RELEASEDIR}/binary/sets 96 sh ${BSDSRCDIR}/distrib/sets/maketars -x -s ${BSDSRCDIR}/distrib/sets \ 97 -d ${DESTDIR} -t ${RELEASEDIR}/binary/sets 98 cd ${RELEASEDIR}/binary/sets && \ 99 cksum -o 1 *.tgz >BSDSUM && \ 100 cksum *.tgz >CKSUM && \ 101 cksum -m *.tgz >MD5 && \ 102 cksum -o 2 *.tgz >SYSVSUM 103 # 104 .endif # DESTDIR and RELEASEDIR check 105 106