Home | History | Annotate | Line # | Download | only in xsrc
Makefile revision 1.42
      1  1.42     tron #	$NetBSD: Makefile,v 1.42 2004/06/14 16:04:28 tron 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.9    fredb #	under /usr/X11R6.
      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.40    lukem .if ${USE_XF86_4:Uno} != "no"
     35  1.21     tron XCDIR=	xfree/xc
     36  1.21     tron .else
     37  1.21     tron XCDIR=	xc
     38  1.21     tron .endif
     39  1.21     tron 
     40  1.40    lukem 
     41  1.19    fredb .MAIN: all
     42  1.40    lukem .if ${USE_XF86_4:Uno} != "no"
     43  1.29    jwise all: all-xc all-local
     44  1.29    jwise .else
     45  1.15  thorpej all: all-xc all-contrib all-local
     46  1.29    jwise .endif
     47   1.4       tv 
     48   1.4       tv all-xc:
     49  1.21     tron .if exists(${XCDIR}/xmakefile) && defined(UPDATE)
     50  1.21     tron 	@cd ${XCDIR} && ${MAKE} Everything
     51   1.4       tv .else
     52  1.21     tron 	@-rm -f ${XCDIR}/xmakefile
     53  1.21     tron 	@cd ${XCDIR} && ${MAKE} World
     54   1.4       tv .endif
     55   1.1      mrg 
     56   1.1      mrg all-contrib:
     57   1.8    fredb 	@if [ ! -f contrib/Makefile ]; then \
     58  1.21     tron 	  cd contrib && PATH=../${XCDIR}/config/imake:$$PATH \
     59  1.23     tron 	    sh ../${XCDIR}/config/util/xmkmf -a ../${XCDIR} \
     60  1.23     tron 	       ${.CURDIR}/contrib; \
     61   1.8    fredb 	fi
     62   1.4       tv 	@cd contrib && ${MAKE}
     63   1.1      mrg 
     64  1.15  thorpej all-local:
     65  1.15  thorpej 	@if [ ! -f local/Makefile ]; then \
     66  1.21     tron 	  cd local && PATH=../${XCDIR}/config/imake:$$PATH \
     67  1.23     tron 	    sh ../${XCDIR}/config/util/xmkmf -a ../${XCDIR} \
     68  1.23     tron 	      ${.CURDIR}/local; \
     69  1.15  thorpej 	fi
     70  1.15  thorpej 	@cd local && ${MAKE}
     71  1.15  thorpej 
     72  1.40    lukem .if ${USE_XF86_4:Uno} != "no"
     73  1.29    jwise install: install-xc install-local
     74  1.29    jwise .else
     75  1.15  thorpej install: install-xc install-contrib install-local
     76  1.29    jwise .endif
     77   1.1      mrg 
     78   1.1      mrg install-xc:
     79  1.27    fredb 	@cd ${XCDIR} && \
     80  1.27    fredb 	  ${MAKE} DESTDIR="${DESTDIR}" install && \
     81  1.27    fredb 	  ${MAKE} DESTDIR="${DESTDIR}" install.man
     82   1.1      mrg 
     83   1.1      mrg install-contrib:
     84  1.27    fredb 	@cd contrib && \
     85  1.27    fredb 	  ${MAKE} DESTDIR="${DESTDIR}" install && \
     86  1.27    fredb 	  ${MAKE} DESTDIR="${DESTDIR}" install.man
     87  1.15  thorpej 
     88  1.15  thorpej install-local:
     89  1.27    fredb 	@cd local && \
     90  1.27    fredb 	  ${MAKE} DESTDIR="${DESTDIR}" install && \
     91  1.27    fredb 	  ${MAKE} DESTDIR="${DESTDIR}" install.man
     92   1.3      mrg 
     93   1.6     tron clean:
     94  1.40    lukem .if ${USE_XF86_4:Uno} != "no"
     95  1.29    jwise 	@-cd ${XCDIR} && ${MAKE} clean
     96  1.29    jwise 	@-cd local && ${MAKE} clean
     97  1.29    jwise .else
     98  1.21     tron 	@-cd ${XCDIR} && ${MAKE} clean
     99   1.4       tv 	@-cd contrib && ${MAKE} clean
    100  1.16     tron 	@-cd local && ${MAKE} clean
    101  1.29    jwise .endif
    102   1.6     tron 
    103   1.7    fredb cleandir distclean: clean
    104  1.37    fredb 	find ${XCDIR} contrib local -name .depend | xargs -n5 rm
    105  1.21     tron 	find ${XCDIR} contrib local -name 'Makefile*' | \
    106  1.37    fredb 	    xargs -n5 grep -l "Makefile generated by imake" | xargs rm
    107  1.21     tron 	-rmdir ${XCDIR}/exports
    108  1.42     tron 	rm -f ${XCDIR}/xmakefile ${XCDIR}/config/cf/version.def \
    109  1.42     tron 	   ${XCDIR}/config/cf/date.def
    110   1.5       tv 
    111   1.5       tv build:
    112   1.7    fredb .if defined(UPDATE)
    113  1.28      mrg 	@${MAKE} all && ${MAKE} install
    114   1.7    fredb .else
    115  1.28      mrg 	@${MAKE} cleandir && ${MAKE} all && ${MAKE} install
    116   1.5       tv .endif
    117   1.9    fredb 
    118   1.9    fredb # release goo
    119   1.9    fredb #
    120   1.9    fredb .if !defined(DESTDIR)
    121   1.9    fredb release snapshot:
    122   1.9    fredb 	@echo setenv DESTDIR before doing that!
    123   1.9    fredb 	@false
    124   1.9    fredb .elif !defined(RELEASEDIR)
    125   1.9    fredb release snapshot:
    126   1.9    fredb 	@echo setenv RELEASEDIR before doing that!
    127   1.9    fredb 	@false
    128   1.9    fredb #
    129   1.9    fredb .else
    130   1.9    fredb #
    131   1.9    fredb .if defined(INSTALL_DONE)
    132   1.9    fredb release snapshot:
    133   1.9    fredb .elif defined(BUILD_DONE)
    134   1.9    fredb release snapshot: install
    135   1.9    fredb .else
    136   1.9    fredb release snapshot: build
    137   1.9    fredb #
    138   1.9    fredb .endif # INSTALL_DONE or BUILD_DONE
    139   1.9    fredb #
    140  1.36     matt 	${INSTALL} -d -m 755 -o root -g wheel ${RELEASEDIR}/${MACHINE}/binary/sets
    141  1.40    lukem .if (${MACHINE} == "amiga") && ${USE_XF86_4:Uno} == "no"
    142  1.21     tron 	cd ${XCDIR}/programs/Xserver/hw/netbsd/amiga && \
    143  1.36     matt 		${INSTALL} -c -m 644 INSTALL.X11 ${RELEASEDIR}/${MACHINE}
    144  1.18       is .endif
    145  1.41     tron 	${INSTALL} -d -m 755 -o root -g wheel ${DESTDIR}/etc/mtree
    146  1.39     tron .if defined(METALOG.add) && !exists(${DESTDIR}/etc/master.passwd)
    147  1.34     tron 	cd ${NETBSDSRCDIR}/distrib/sets && \
    148  1.36     matt 	    sh ./maketars -x -d ${DESTDIR:S,^$,/,} -N ${NETBSDSRCDIR}/etc -t ${RELEASEDIR}/${MACHINE}/binary/sets
    149  1.34     tron .else
    150  1.31    lukem 	cd ${NETBSDSRCDIR}/distrib/sets && \
    151  1.36     matt 	    sh ./maketars -x -d ${DESTDIR:S,^$,/,} -t ${RELEASEDIR}/${MACHINE}/binary/sets
    152  1.34     tron .endif
    153  1.36     matt 	cd ${RELEASEDIR}/${MACHINE}/binary/sets && \
    154   1.9    fredb 		cksum -o 1 *.tgz >BSDSUM && \
    155   1.9    fredb 		cksum *.tgz >CKSUM && \
    156   1.9    fredb 		cksum -m *.tgz >MD5 && \
    157   1.9    fredb 		cksum -o 2 *.tgz >SYSVSUM
    158   1.9    fredb #
    159  1.13    fredb .endif # DESTDIR and RELEASEDIR check
    160