1#
2# THIS MAKEFILE IS FOR am-utils maintainers only!
3#
4# GNUmakefile for remaking configuration files.
5#
6# Erez Zadok <ezk@cs.columbia.edu>
7#
8
9AUTOCONF=autoconf --localdir=./m4 ./m4/configure.in
10AUTOHEADER=autoheader --localdir=./m4 ./m4/configure.in
11#AUTOMAKE=./m4/automake --include-deps --amdir=./m4/amdir
12#AUTOMAKE=automake --include-deps --no-intermediates --localdir=./m4
13#AUTOMAKE=automake --include-deps --localdir=./m4
14AUTOMAKE=automake --include-deps --altdir=./m4
15ACLOCAL=aclocal --altdir=./m4
16MK_ACLOCAL=./mk-aclocal
17
18CUTWARNMSG="warning: AC_TRY_RUN called without default to allow cross compilin"
19CUTWARNMSG2="AC_OUTPUT_COMMANDS|autoupdate"
20AMFILES=../Makefile.am $(wildcard ../*/Makefile.am)
21INAMFILES=$(AMFILES:.am=.in)
22ACFILES=$(wildcard macros/*.m4 macros/HEADER macros/TRAILER m4/aclocal.m4)
23
24LOG=/tmp/amu-${USER}.log
25
26TOPDIR=..
27VPATH=
28
29all: testdir ${TOPDIR}/configure config.h.in ${TOPDIR}/Makefile.in \
30	GNUmakefile stamp-h.in
31
32config: all $(TOPDIR)/buildall aux_conf.h.in
33	(cd ${TOPDIR} && ./buildall -c)
34
35dconfig: all $(TOPDIR)/buildall aux_conf.h.in
36	(cd ${TOPDIR} && ./buildall -C)
37
38qconfig: all $(TOPDIR)/buildall aux_conf.h.in
39	(cd ${TOPDIR} && ./buildall -q)
40
41build: all $(TOPDIR)/buildall aux_conf.h.in
42	(cd ${TOPDIR} && ./buildall -b)
43
44world: all $(TOPDIR)/buildall aux_conf.h.in
45	(cd ${TOPDIR} && ./buildall)
46
47testdir: ${TOPDIR}/amd/amd.c
48
49${TOPDIR}/configure: configure.in aclocal.m4
50	-(cd ${TOPDIR} && ${AUTOCONF} > configure.new 2> ${LOG})
51	-@egrep -v ${CUTWARNMSG} ${LOG} > ${LOG}.new ; mv ${LOG}.new ${LOG}
52	@echo '############################################################'
53	@echo 'Checking for "AC_OUTPUT_COMMANDS" warnings:'
54	@echo ' (If you see any output, fix this when autoconf/automake are'
55	@echo '  back in sync in their CVS trees. -ezk, 2/10/00)'
56	-@egrep ${CUTWARNMSG2} ${LOG}
57	-@egrep -v ${CUTWARNMSG2} ${LOG} > ${LOG}.new ; mv ${LOG}.new ${LOG}
58	@echo '############################################################'
59	@if test -s ${LOG}; then cat ${LOG}; exit 2; fi
60	-mv ../configure ../configure.old
61	mv ../configure.new ../configure
62	rm -f ../configure.old
63	chmod a+rx $@
64
65config.h.in: configure.in acconfig.h
66	-(cd ${TOPDIR} && ${AUTOHEADER} > ./m4/config.h.in 2> ${LOG})
67	-@egrep -v ${CUTWARNMSG} ${LOG} > ${LOG}.new ; mv ${LOG}.new ${LOG}
68	@echo '############################################################'
69	@echo 'Checking for "AC_OUTPUT_COMMANDS" warnings:'
70	@echo ' (If you see any output, fix this when autoconf/automake are'
71	@echo '  back in sync in their CVS trees. -ezk, 2/10/00)'
72	-@egrep ${CUTWARNMSG2} ${LOG}
73	-@egrep -v ${CUTWARNMSG2} ${LOG} > ${LOG}.new ; mv ${LOG}.new ${LOG}
74	@echo '############################################################'
75	@if test -s ${LOG}; then cat ${LOG}; exit 2; fi
76
77${TOPDIR}/Makefile.in: ${AMFILES} configure.in aclocal.m4
78	(cd ${TOPDIR} && ${AUTOMAKE})
79	@rm -f ${LOG}
80
81aclocal.m4: ${ACFILES} configure.in
82	rm -f $@
83	${MK_ACLOCAL} > acinclude.m4
84	(cd ${TOPDIR} && ${ACLOCAL})
85
86stamp-h.in: ${AMFILES} config.h.in aclocal.m4 aux_conf.h.in
87	echo timestamp > $@
88
89clean:
90	rm -f ${TOPDIR}/configure config.h.in $(INAMFILES) aclocal.m4 stamp.h.in
91
92##############################################################################
93# maintainer rules to update autoconf/automake/libtool files distributed with
94# am-utils. -Erez.
95
96P1s=/usr/share/automake
97P2s=/usr/share/libtool
98P1=/usr/local/gnu/lib/automake
99P2=/usr/local/gnu/lib/libtool
100P3=/misc/mirror/gnu/prep/config
101P4=/misc/mirror/gnu/prep/GNUinfo
102ICMD=./m4/copy-if-newbig
103CPCMD=cp -p
104
105update:		\
106	config.guess	\
107	config.sub	\
108	doc/texinfo.tex
109# 	depcomp		\
110# 	install-sh	\
111# 	ltconfig	\
112# 	ltmain.sh	\
113# 	mdate-sh	\
114# 	missing		\
115# 	mkinstalldirs	\
116
117config.guess:: $(P1s)*/config.guess
118	$(ICMD) $? $@
119config.guess:: $(P2s)/config.guess
120	$(ICMD) $? $@
121config.guess:: $(P3)/config.guess
122	$(ICMD) $? $@
123
124config.sub:: $(P1s)*/config.sub
125	$(ICMD) $? $@
126config.sub:: $(P2s)/config.sub
127	$(ICMD) $? $@
128config.sub:: $(P3)/config.sub
129	$(ICMD) $? $@
130
131depcomp:: $(P1)/depcomp
132	$(CPCMD) $? $@
133
134install-sh: $(P1)/install-sh
135	$(CPCMD) $? $@
136
137ltconfig: $(P2)/ltconfig
138	$(CPCMD) $? $@
139
140ltmain.sh: $(P2)/ltmain.sh
141	$(CPCMD) $? $@
142
143mdate-sh: $(P1)/mdate-sh
144	$(CPCMD) $? $@
145
146missing: $(P1)/missing
147	$(CPCMD) $? $@
148
149mkinstalldirs: $(P1)/mkinstalldirs
150	$(CPCMD) $? $@
151
152doc/texinfo.tex: $(P4)/texinfo.tex
153	$(CPCMD) $? $@
154
155##############################################################################
156