[BACK]Return to Makefile CVS log [TXT][DIR] Up to [cvs.NetBSD.org] / xsrc

File: [cvs.NetBSD.org] / xsrc / Makefile (download)

Revision 1.27, Wed May 23 12:47:13 2001 UTC (19 years, 10 months ago) by fredb
Branch: MAIN
CVS Tags: netbsd-1-5-PATCH002, netbsd-1-5-PATCH001
Changes since 1.26: +10 -4 lines

Respect DESTDIR setting in ${MAKECONF}. Previously, it had to be set
in either the environment, or on the command line. Closes PR xsrc/13003.

#	$NetBSD: Makefile,v 1.27 2001/05/23 12:47:13 fredb Exp $
#
# Targets & Variables
#
# build: Clean out xsrc, and build and install everything that goes
#	under /usr/X11R6.
#
#  DESTDIR -- Set to an alternative directory to install under.
#  UPDATE --  If set, don't make clean first, plus attempt to make
#	only the targets that are out of date.
#
# release snapshot: Same as build, plus tar up the X sets and install
#	them under the ${RELEASEDIR}/binary/sets directory.
#
#  DESTDIR -- Same as for build. Mandatory for building a release.
#  RELEASEDIR -- As explained above.
#  BUILD_DONE -- If set, assume build is already done.
#  INSTALL_DONE -- If set, assume binaries to tar up are to be found
#	in ${DESTDIR} already.
#  BSDSRCDIR -- Set to the full path to the main source tree, /usr/src
#	by default. Needed to find ./distrib/sets.
#
# cleandir distclean: Remove all generated files from under xsrc.
#
# clean: Remove object files, but keep imake generated makefiles.

.include <bsd.own.mk>

.if defined(USE_XF86_4) && (${USE_XF86_4} != no)
XCDIR=	xfree/xc
.else
XCDIR=	xc
.endif

.MAIN: all
all: all-xc all-contrib all-local

all-xc:
.if exists(${XCDIR}/xmakefile) && defined(UPDATE)
	@cd ${XCDIR} && ${MAKE} Everything
.else
	@-rm -f ${XCDIR}/xmakefile
	@cd ${XCDIR} && ${MAKE} World
.endif

all-contrib:
	@if [ ! -f contrib/Makefile ]; then \
	  cd contrib && PATH=../${XCDIR}/config/imake:$$PATH \
	    sh ../${XCDIR}/config/util/xmkmf -a ../${XCDIR} \
	       ${.CURDIR}/contrib; \
	fi
	@cd contrib && ${MAKE}

all-local:
	@if [ ! -f local/Makefile ]; then \
	  cd local && PATH=../${XCDIR}/config/imake:$$PATH \
	    sh ../${XCDIR}/config/util/xmkmf -a ../${XCDIR} \
	      ${.CURDIR}/local; \
	fi
	@cd local && ${MAKE}

install: install-xc install-contrib install-local

install-xc:
	@cd ${XCDIR} && \
	  ${MAKE} DESTDIR="${DESTDIR}" install && \
	  ${MAKE} DESTDIR="${DESTDIR}" install.man

install-contrib:
	@cd contrib && \
	  ${MAKE} DESTDIR="${DESTDIR}" install && \
	  ${MAKE} DESTDIR="${DESTDIR}" install.man

install-local:
	@cd local && \
	  ${MAKE} DESTDIR="${DESTDIR}" install && \
	  ${MAKE} DESTDIR="${DESTDIR}" install.man

clean:
	@-cd ${XCDIR} && ${MAKE} clean
	@-cd contrib && ${MAKE} clean
	@-cd local && ${MAKE} clean

cleandir distclean: clean
	find ${XCDIR} contrib local -name .depend | xargs rm
	find ${XCDIR} contrib local -name 'Makefile*' | \
	    xargs grep -l "Makefile generated by imake" | xargs rm
	-rmdir ${XCDIR}/exports
	rm -f ${XCDIR}/xmakefile

build:
.if defined(UPDATE)
	@${MAKE} all install
.else
	@${MAKE} cleandir all install
.endif

# release goo
#
.if !defined(DESTDIR)
release snapshot:
	@echo setenv DESTDIR before doing that!
	@false
.elif !defined(RELEASEDIR)
release snapshot:
	@echo setenv RELEASEDIR before doing that!
	@false
#
.else
#
.if defined(INSTALL_DONE)
release snapshot:
.elif defined(BUILD_DONE)
release snapshot: install
.else
release snapshot: build
#
.endif # INSTALL_DONE or BUILD_DONE
#
	${INSTALL} -d -m 755 -o root -g wheel ${RELEASEDIR}/binary/sets
.if (${MACHINE} == "amiga") && !(defined(USE_XF86_4) && (${USE_XF86_4} != no))
	cd ${XCDIR}/programs/Xserver/hw/netbsd/amiga && \
		${INSTALL} -c -m 644 INSTALL.X11 ${RELEASEDIR}
.endif
	sh ${BSDSRCDIR}/distrib/sets/maketars -x -s ${BSDSRCDIR}/distrib/sets \
		-d ${DESTDIR} -t ${RELEASEDIR}/binary/sets
	cd ${RELEASEDIR}/binary/sets && \
		cksum -o 1 *.tgz >BSDSUM && \
		cksum *.tgz >CKSUM && \
		cksum -m *.tgz >MD5 && \
		cksum -o 2 *.tgz >SYSVSUM
#
.endif # DESTDIR and RELEASEDIR check