Makefile revision a63b1a70
1#	$NetBSD: Makefile,v 1.19 2000/11/05 15:55:34 fredb 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.MAIN: all
30all: all-xc all-contrib all-local
31
32all-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
40all-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
47all-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
54install: install-xc install-contrib install-local
55
56install-xc:
57	@cd xc && ${MAKE} install && ${MAKE} install.man
58
59install-contrib:
60	@cd contrib && ${MAKE} install && ${MAKE} install.man
61
62install-local:
63	@cd local && ${MAKE} install && ${MAKE} install.man
64
65clean:
66	@-cd xc && ${MAKE} clean
67	@-cd contrib && ${MAKE} clean
68	@-cd local && ${MAKE} clean
69
70cleandir 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
77build:
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)
87release snapshot:
88	@echo setenv DESTDIR before doing that!
89	@false
90.elif !defined(RELEASEDIR)
91release snapshot:
92	@echo setenv RELEASEDIR before doing that!
93	@false
94#
95.else
96#
97.if defined(INSTALL_DONE)
98release snapshot:
99.elif defined(BUILD_DONE)
100release snapshot: install
101.else
102release snapshot: build
103#
104.endif # INSTALL_DONE or BUILD_DONE
105#
106	${INSTALL} -d -m 755 -o root -g wheel ${RELEASEDIR}/binary/sets
107.if ${MACHINE} == "amiga"
108	cd xc/programs/Xserver/hw/netbsd/amiga && \
109		${INSTALL} -m 644 INSTALL.X11 ${RELEASEDIR}
110.endif
111	sh ${BSDSRCDIR}/distrib/sets/maketars -x -s ${BSDSRCDIR}/distrib/sets \
112		-d ${DESTDIR} -t ${RELEASEDIR}/binary/sets
113	cd ${RELEASEDIR}/binary/sets && \
114		cksum -o 1 *.tgz >BSDSUM && \
115		cksum *.tgz >CKSUM && \
116		cksum -m *.tgz >MD5 && \
117		cksum -o 2 *.tgz >SYSVSUM
118#
119.endif # DESTDIR and RELEASEDIR check
120
121