1# Master Makefile for the GNU Concurrent Versions System. 2# Copyright (C) 1986, 1988-1992, 1994 Free Software Foundation, Inc. 3 4# This program is free software; you can redistribute it and/or modify 5# it under the terms of the GNU General Public License as published by 6# the Free Software Foundation; either version 2, or (at your option) 7# any later version. 8 9# This program is distributed in the hope that it will be useful, 10# but WITHOUT ANY WARRANTY; without even the implied warranty of 11# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12# GNU General Public License for more details. 13 14SHELL = /bin/sh 15 16#### Start of system configuration section. #### 17 18srcdir = @srcdir@ 19top_srcdir = @top_srcdir@ 20VPATH = @srcdir@ 21 22# If you use gcc, you should either run the fixincludes script that 23# comes with it or else use gcc with the -traditional option. Otherwise 24# ioctl calls will be compiled incorrectly on some systems. 25CC = @CC@ 26AR = ar 27 28@SET_MAKE@ 29 30# Set RANLIB = echo if your system doesn't have or need ranlib. 31RANLIB = @RANLIB@ 32# Set YACC = bison or yacc, depending on which you have on your system 33YACC = @YACC@ 34# Use cp if you don't have install. 35INSTALL = @INSTALL@ 36INSTALL_DATA = @INSTALL_DATA@ 37INSTALL_PROGRAM = @INSTALL_PROGRAM@ 38 39DEFS = @DEFS@ 40LIBS = @LIBS@ 41 42INCLUDES = -I. -I../lib @includeopt@ 43CFLAGS = @CFLAGS@ 44LDFLAGS = @LDFLAGS@ 45 46MAKEINFO = makeinfo 47TEXI2DVI = texi2dvi 48 49prefix = @prefix@ 50exec_prefix = @exec_prefix@ 51 52# Where to install the executables. 53bindir = $(exec_prefix)/bin 54 55# Where to put the system-wide .cvsrc file 56libdir = $(prefix)/lib 57 58# Where to put the Info files 59infodir = $(prefix)/info 60 61# Where to put the manual pages. 62mandir = $(prefix)/man 63 64#### End of system configuration section. #### 65 66FLAGS_TO_PASS = \ 67 AR='$(AR)' \ 68 CC='$(CC)' \ 69 CFLAGS='$(CFLAGS)' \ 70 LDFLAGS='$(LDFLAGS)' \ 71 LIBPROGS='$(LIBPROGS)' \ 72 LIBS='$(LIBS)' \ 73 MAKE='$(MAKE)' \ 74 MAKEINFO='$(MAKEINFO)' \ 75 RANLIB='$(RANLIB)' \ 76 TEXI2DVI='$(TEXI2DVI)' \ 77 YACC='$(YACC)' \ 78 bindir='$(bindir)' \ 79 infodir='$(infodir)' \ 80 libdir='$(libdir)' \ 81 mandir='$(mandir)' \ 82 prefix='$(prefix)' \ 83 exec_prefix='$(exec_prefix)' 84 85DISTFILES = \ 86 COPYING COPYING.LIB INSTALL README TODO PROJECTS \ 87 BUGS MINOR-BUGS FAQ HACKING DEVEL-CVS TESTS \ 88 README.VMS build.com \ 89 ChangeLog NEWS ChangeLog.zoo \ 90 configure configure.in stamp-h.in config.h.in Makefile.in acconfig.h \ 91 cvs-format.el mkinstalldirs install-sh \ 92 cvsnt.mak cvsnt.dsp \ 93 .cvsignore cvs.spec 94 95### Subdirectories to run make in for the primary targets. 96# Unix source subdirs, where we'll want to run lint and etags: 97USOURCE_SUBDIRS = lib zlib diff src 98# Documentation directories; special handling 99INSTALL_MAN=man 100# All other subdirs: 101SUBDIRS = ${USOURCE_SUBDIRS} ${INSTALL_MAN} doc contrib tools \ 102 windows-NT os2 emx macintosh vms 103# Only make TAGS/tags files in these directories. 104TSUBDIRS= src lib 105 106# Set default target. 107all: 108 109.PHONY: all install uninstall installdirs 110all install uninstall installdirs: config.h Makefile all-local 111 @for subdir in $(SUBDIRS); do \ 112 echo "making $@ in $$subdir"; \ 113 ( cd $$subdir && $(MAKE) $(FLAGS_TO_PASS) $@ ) || exit 1; \ 114 done 115 116installdirs: installdirs-local 117 118install: all install-local install-info 119 120.PHONY: all-local 121all-local: 122 123.PHONY: info dvi clean-info install-info 124info dvi clean-info install-info: 125 cd doc && $(MAKE) $(FLAGS_TO_PASS) $@ || exit 1 126 127.PHONY: install-local 128install-local: all-local 129 @: nothing to do locally 130 131.PHONY: installdirs-local 132installdirs-local: all-local 133 @: nothing to do locally 134 135.PHONY: tags 136tags: 137 @for dir in $(TSUBDIRS); do echo making $@ in $$dir; cd $$dir && $(MAKE) $(FLAGS_TO_PASS) $@ || exit 1; cd ..; done 138 @echo making $@ in . 139 @ctags `for i in \`$(MAKE) SUBDIRS="$(TSUBDIRS)" ls\` ; do echo $(srcdir)/$$i ; done` 140 141.PHONY: TAGS 142TAGS: 143 @for dir in $(TSUBDIRS); do echo making $@ in $$dir; cd $$dir && $(MAKE) $(FLAGS_TO_PASS) $@ || exit 1; cd ..; done 144 @echo making $@ in . 145 @etags `for i in \`$(MAKE) SUBDIRS="$(TSUBDIRS)" ls | grep -v 'make\[[0-9]\]'\` ; do echo $(srcdir)/$$i ; done` 146 147.PHONY: ls 148ls: 149 @echo $(DISTFILES) 150 @for dir in $(SUBDIRS); do \ 151 for i in `cd $$dir && $(MAKE) $(FLAGS_TO_PASS) $@ | grep -v 'make\[[0-9]\]'` ; do \ 152 echo $$dir/$$i ; \ 153 done ; \ 154 done 155 156.PHONY: clean 157clean: clean-local 158 @for dir in $(SUBDIRS); do echo making $@ in $$dir; cd $$dir && $(MAKE) $(FLAGS_TO_PASS) $@ || exit 1; cd ..; done 159 160.PHONY: distclean 161distclean: distclean-local 162 @for dir in $(SUBDIRS); do echo making $@ in $$dir; cd $$dir && $(MAKE) $(FLAGS_TO_PASS) $@ || exit 1; cd ..; done 163 rm -f config.status 164 165.PHONY: realclean 166realclean: realclean-local 167 @for dir in $(SUBDIRS); do echo making $@ in $$dir; cd $$dir && $(MAKE) $(FLAGS_TO_PASS) $@ || exit 1; cd ..; done 168 rm -f config.status 169 170.PHONY: mostlyclean-local 171mostlyclean-local: 172 rm -f *~ 173 174.PHONY: clean-local 175clean-local: mostlyclean-local 176 177.PHONY: distclean-local 178distclean-local: clean-local 179 rm -f Makefile config.cache config.h config.log stamp-h 180 rm -f tags TAGS 181 182.PHONY: realclean-local 183realclean-local: distclean-local 184 185.PHONY: saber 186saber: 187 @for dir in $(SUBDIRS); do cd $$dir && $(MAKE) $(FLAGS_TO_PASS) $@ || exit 1; cd ..; done 188 189.PHONY: check 190check: 191 cd lib ; $(MAKE) $(FLAGS_TO_PASS) 192 cd zlib ; $(MAKE) $(FLAGS_TO_PASS) 193 cd diff ; $(MAKE) $(FLAGS_TO_PASS) 194 cd src ; $(MAKE) $(FLAGS_TO_PASS) check 195 196.PHONY: remotecheck 197remotecheck: 198 cd lib ; $(MAKE) $(FLAGS_TO_PASS) 199 cd zlib ; $(MAKE) $(FLAGS_TO_PASS) 200 cd diff ; $(MAKE) $(FLAGS_TO_PASS) 201 cd src ; $(MAKE) $(FLAGS_TO_PASS) remotecheck 202 203.PHONY: installcheck 204installcheck: 205 cd lib ; $(MAKE) $(FLAGS_TO_PASS) 206 cd zlib ; $(MAKE) $(FLAGS_TO_PASS) 207 cd diff ; $(MAKE) $(FLAGS_TO_PASS) 208 cd src ; $(MAKE) $(FLAGS_TO_PASS) installcheck 209 210.PHONY: lint 211lint: 212 @for dir in $(USOURCE_SUBDIRS); do cd $$dir && $(MAKE) $(FLAGS_TO_PASS) xlint || exit 1; cd ..; done 213 214.PHONY: dist 215GZIP=gzip --best 216GZIP_EXT=.gz 217TAR_VERBOSE= 218dist: spec 219 rm -rf `cat .fname` 220 ${MAKE} dist-dir DISTDIR="`cat .fname`" 221 for dir in ${SUBDIRS}; do \ 222 ( DISTDIR="../`cat .fname`/$${dir}"; \ 223 cd $${dir} && \ 224 ${MAKE} dist-dir DISTDIR="$${DISTDIR}" \ 225 ); \ 226 done 227 tar chf${TAR_VERBOSE} - `cat .fname` | ${GZIP} > "`cat .fname`.tar${GZIP_EXT}" 228 rm -rf `cat .fname` .fname .version 229 230.PHONY: dist-dir 231dist-dir: 232 mkdir ${DISTDIR} 233 for i in ${DISTFILES}; do \ 234 ln $(srcdir)/$${i} ${DISTDIR}; \ 235 done 236 237.PHONY: spec 238spec: 239 rm -f .version .fname 240 sed < $(srcdir)/src/version.c \ 241 -e '/version_string/!d' \ 242 -e 's/[^0-9.]*\([0-9.]*\).*/\1/' \ 243 -e q > .version 244 echo > .fname cvs-`cat .version` 245 rm -f `cat .fname`.spec 246 sed < $(top_srcdir)/cvs.spec \ 247 -e 's/@VERSION@/'`cat .version`'/g' \ 248 > `cat .fname`.spec 249 250 251# For the justification of the following Makefile rules, see node 252# `Automatic Remaking' in GNU Autoconf documentation. 253Makefile: Makefile.in config.status 254 CONFIG_FILES=$@ CONFIG_HEADERS= ./config.status 255 256# Use @CFLAGS@ not $(CFLAGS) because it would be confusing for "make CFLAGS=" 257# to sometimes (i.e., if configure is modified) change the configured CFLAGS, 258# and sometimes not. 259config.status: configure 260 CFLAGS="@CFLAGS@" ./config.status --recheck 261 262# The rules to run autoconf and autoheader are commented out. This is because 263# when the user unpacks a tarfile, configure.in might end up newer than 264# configure, but the user might not have (and does not need to have) autoconf 265# installed. 266#configure: configure.in #aclocal.m4 267# cd $(srcdir); autoconf 268 269config.h: stamp-h 270 271# This used to do a ./config.status --recheck, to update config.status with 272# any new #defines from config.h.in. The problem was that the rule itself 273# depends on config.status, so that the --recheck would get run several 274# times, which is bad if the user was trying to specify CFLAGS manually. 275# It was a big pain in the neck. 276stamp-h: config.h.in config.status 277 CONFIG_FILES=$@ CONFIG_HEADERS=config.h ./config.status 278 279#config.h.in: stamp-h.in 280#stamp-h.in: configure.in #aclocal.m4 acconfig.h 281# cd $(srcdir); autoheader 282# date > $(srcdir)/stamp-h.in 283 284# Tell versions [3.59,3.63) of GNU make not to export all variables. 285# Otherwise a system limit (for SysV at least) may be exceeded. 286.NOEXPORT: 287