Home | History | Annotate | Line # | Download | only in xsrc
Makefile revision 1.17
      1 #	$NetBSD: Makefile,v 1.17 2000/10/02 05:57:00 simonb 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 all-local
     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 all-local:
     48 	@if [ ! -f local/Makefile ]; then \
     49 	  cd local && PATH=../xc/config/imake:$$PATH \
     50 	    sh ../xc/config/util/xmkmf -a ../xc ../local; \
     51 	fi
     52 	@cd local && ${MAKE}
     53 
     54 install: install-xc install-contrib install-local
     55 
     56 install-xc:
     57 	@cd xc && ${MAKE} install && ${MAKE} install.man
     58 
     59 install-contrib:
     60 	@cd contrib && ${MAKE} install && ${MAKE} install.man
     61 
     62 install-local:
     63 	@cd local && ${MAKE} install && ${MAKE} install.man
     64 
     65 clean:
     66 	@-cd xc && ${MAKE} clean
     67 	@-cd contrib && ${MAKE} clean
     68 	@-cd local && ${MAKE} clean
     69 
     70 cleandir distclean: clean
     71 	find xc contrib local -name .depend | xargs rm
     72 	find xc contrib local -name 'Makefile*' | \
     73 	    xargs grep -l "Makefile generated by imake" | xargs rm
     74 	-rmdir xc/exports
     75 	rm -f xc/xmakefile
     76 
     77 build:
     78 .if defined(UPDATE)
     79 	@${MAKE} all install
     80 .else
     81 	@${MAKE} cleandir all install
     82 .endif
     83 
     84 # release goo
     85 #
     86 .if !defined(DESTDIR)
     87 release snapshot:
     88 	@echo setenv DESTDIR before doing that!
     89 	@false
     90 .elif !defined(RELEASEDIR)
     91 release snapshot:
     92 	@echo setenv RELEASEDIR before doing that!
     93 	@false
     94 #
     95 .else
     96 #
     97 .if defined(INSTALL_DONE)
     98 release snapshot:
     99 .elif defined(BUILD_DONE)
    100 release snapshot: install
    101 .else
    102 release snapshot: build
    103 #
    104 .endif # INSTALL_DONE or BUILD_DONE
    105 #
    106 	${INSTALL} -d -m 755 -o root -g wheel ${RELEASEDIR}/binary/sets
    107 	sh ${BSDSRCDIR}/distrib/sets/maketars -x -s ${BSDSRCDIR}/distrib/sets \
    108 		-d ${DESTDIR} -t ${RELEASEDIR}/binary/sets
    109 	cd ${RELEASEDIR}/binary/sets && \
    110 		cksum -o 1 *.tgz >BSDSUM && \
    111 		cksum *.tgz >CKSUM && \
    112 		cksum -m *.tgz >MD5 && \
    113 		cksum -o 2 *.tgz >SYSVSUM
    114 #
    115 .endif # DESTDIR and RELEASEDIR check
    116 
    117