Source

w3 / Makefile.in-wp

# where the w3 lisp files should go
srcdir  = @srcdir@
prefix  = @prefix@
datadir = @datadir@
lispdir = @lispdir@
infodir = @infodir@

DOTEMACS=@DOTEMACS@
SUBDIRS =lisp texi etc

INSTALL   = @INSTALL@
RM        = rm -f

.PHONY: $(SUBDIRS) dotemacs

all:	w3 info

w3 fast:
	cd lisp && $(MAKE) $@

html info dvi:
	cd texi && $(MAKE) $@

install: all
	for x in $(SUBDIRS); do ( cd $$x && $(MAKE) $@ ); done

distclean: clean
	for x in $(SUBDIRS); do ( cd $$x && $(MAKE) $@ ); done
	$(RM) config.* Makefile

clean:
	for x in $(SUBDIRS); do ( cd $$x && $(MAKE) $@ ); done

dotemacs:
	@if (grep ";;; Emacs/W3 Configuration" $(DOTEMACS) 2>&1) >/dev/null; then \
		echo Emacs/W3 setup already exists in $(DOTEMACS);	\
	else								\
		test -d `dirname $(DOTEMACS)` || mkdir -p `dirname $(DOTEMACS)`; \
		(echo >> $(DOTEMACS)); \
		(echo ";;; Emacs/W3 Configuration" >> $(DOTEMACS)); \
		(echo "(setq load-path (cons \"$(lispdir)\" load-path))" >> $(DOTEMACS)); \
		(echo "(require 'w3-auto \"w3-auto\")" >> $(DOTEMACS)); \
		echo "Added Emacs/W3 setup to $(DOTEMACS)"; \
	fi

Makefile: Makefile.in $(srcdir)/config.status
	( cd $(srcdir) ; CONFIG_FILES=Makefile ./config.status )

$(srcdir)/configure: configure.in aclocal.m4
	cd $(srcdir) && autoconf

$(srcdir)/config.status: configure
	cd $(srcdir) && ./config.status --recheck

###############################################################################
# Distribution building, the joy of my life
###############################################################################
SUPPORTFILES =  HOWTO TODO README INSTALL README.NT README.VMS
DISTFILES    =  configure.in aclocal.m4 Makefile.in install-sh	\
		configure descrip.mms ChangeLog	$(SUPPORTFILES)
MAJOR = 4
MINOR = 0pre
VERSION = $(MAJOR).$(MINOR).$(shell cat .version)
DIRNAME = w3-$(VERSION)

newversion:
	if [ ! -f .version ]; then \
		echo 1 > .version; \
	else \
		expr 0`cat .version` + 1 > .version; \
	fi
	cvs commit -m "" .version

version: newversion clean $(DISTFILES)
	echo "Building version $(VERSION)"
	./build-dist --version=$(VERSION)

realversion: $(DISTFILES)
	mkdir /tmp/$(DIRNAME)
	cp $(DISTFILES) /tmp/$(DIRNAME)
	for x in $(SUBDIRS); do ( cd $$x && $(MAKE) version VERSION=$(VERSION) DIRNAME=/tmp/$(DIRNAME) ); done
	tar cf - contrib | ( cd /tmp/$(DIRNAME) ; tar xf - )
	( cd /tmp ; tar cf - $(DIRNAME) | gzip -c -9 > /tmp/$(DIRNAME).tar.gz )
	rm -fr /tmp/$(DIRNAME)