aboutsummaryrefslogtreecommitdiffstats
path: root/m4/GNUmakefile
blob: de2457ae373dd1d9794a628f68c73d09fc92e01e (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
#
# THIS MAKEFILE IS FOR am-utils maintainers only!
#
# GNUmakefile for remaking configuration files.
#
# Erez Zadok <ezk@cs.columbia.edu>
#

AUTOCONF=autoconf --localdir=./m4 ./m4/configure.in
AUTOHEADER=autoheader --localdir=./m4 ./m4/configure.in
#AUTOMAKE=./m4/automake --include-deps --amdir=./m4/amdir
#AUTOMAKE=automake --include-deps --no-intermediates --localdir=./m4
#AUTOMAKE=automake --include-deps --localdir=./m4
AUTOMAKE=automake --include-deps --altdir=./m4
ACLOCAL=aclocal --altdir=./m4
MK_ACLOCAL=./mk-aclocal

CUTWARNMSG="warning: AC_TRY_RUN called without default to allow cross compilin"
CUTWARNMSG2="AC_OUTPUT_COMMANDS|autoupdate"
AMFILES=../Makefile.am $(wildcard ../*/Makefile.am)
INAMFILES=$(AMFILES:.am=.in)
ACFILES=$(wildcard macros/*.m4 macros/HEADER macros/TRAILER m4/aclocal.m4)

LOG=/tmp/amu-${USER}.log

TOPDIR=..
VPATH=

all: testdir ${TOPDIR}/configure config.h.in ${TOPDIR}/Makefile.in \
	GNUmakefile stamp-h.in

config: all $(TOPDIR)/buildall aux_conf.h.in
	(cd ${TOPDIR} && ./buildall -c)

dconfig: all $(TOPDIR)/buildall aux_conf.h.in
	(cd ${TOPDIR} && ./buildall -C)

qconfig: all $(TOPDIR)/buildall aux_conf.h.in
	(cd ${TOPDIR} && ./buildall -q)

build: all $(TOPDIR)/buildall aux_conf.h.in
	(cd ${TOPDIR} && ./buildall -b)

world: all $(TOPDIR)/buildall aux_conf.h.in
	(cd ${TOPDIR} && ./buildall)

testdir: ${TOPDIR}/amd/amd.c

${TOPDIR}/configure: configure.in aclocal.m4
	-(cd ${TOPDIR} && ${AUTOCONF} > configure.new 2> ${LOG})
	-@egrep -v ${CUTWARNMSG} ${LOG} > ${LOG}.new ; mv ${LOG}.new ${LOG}
	@echo '############################################################'
	@echo 'Checking for "AC_OUTPUT_COMMANDS" warnings:'
	@echo ' (If you see any output, fix this when autoconf/automake are'
	@echo '  back in sync in their CVS trees. -ezk, 2/10/00)'
	-@egrep ${CUTWARNMSG2} ${LOG}
	-@egrep -v ${CUTWARNMSG2} ${LOG} > ${LOG}.new ; mv ${LOG}.new ${LOG}
	@echo '############################################################'
	@if test -s ${LOG}; then cat ${LOG}; exit 2; fi
	-mv ../configure ../configure.old
	mv ../configure.new ../configure
	rm -f ../configure.old
	chmod a+rx $@

config.h.in: configure.in acconfig.h
	-(cd ${TOPDIR} && ${AUTOHEADER} > ./m4/config.h.in 2> ${LOG})
	-@egrep -v ${CUTWARNMSG} ${LOG} > ${LOG}.new ; mv ${LOG}.new ${LOG}
	@echo '############################################################'
	@echo 'Checking for "AC_OUTPUT_COMMANDS" warnings:'
	@echo ' (If you see any output, fix this when autoconf/automake are'
	@echo '  back in sync in their CVS trees. -ezk, 2/10/00)'
	-@egrep ${CUTWARNMSG2} ${LOG}
	-@egrep -v ${CUTWARNMSG2} ${LOG} > ${LOG}.new ; mv ${LOG}.new ${LOG}
	@echo '############################################################'
	@if test -s ${LOG}; then cat ${LOG}; exit 2; fi

${TOPDIR}/Makefile.in: ${AMFILES} configure.in aclocal.m4
	(cd ${TOPDIR} && ${AUTOMAKE})
	@rm -f ${LOG}

aclocal.m4: ${ACFILES} configure.in
	rm -f $@
	${MK_ACLOCAL} > acinclude.m4
	(cd ${TOPDIR} && ${ACLOCAL})

stamp-h.in: ${AMFILES} config.h.in aclocal.m4 aux_conf.h.in
	echo timestamp > $@

clean:
	rm -f ${TOPDIR}/configure config.h.in $(INAMFILES) aclocal.m4 stamp.h.in

##############################################################################
# maintainer rules to update autoconf/automake/libtool files distributed with
# am-utils. -Erez.

P1s=/usr/share/automake
P2s=/usr/share/libtool
P1=/usr/local/gnu/lib/automake
P2=/usr/local/gnu/lib/libtool
P3=/misc/mirror/gnu/prep/config
P4=/misc/mirror/gnu/prep/GNUinfo
ICMD=./m4/copy-if-newbig
CPCMD=cp -p

update:		\
	config.guess	\
	config.sub	\
	doc/texinfo.tex
# 	depcomp		\
# 	install-sh	\
# 	ltconfig	\
# 	ltmain.sh	\
# 	mdate-sh	\
# 	missing		\
# 	mkinstalldirs	\

config.guess:: $(P1s)*/config.guess
	$(ICMD) $? $@
config.guess:: $(P2s)/config.guess
	$(ICMD) $? $@
config.guess:: $(P3)/config.guess
	$(ICMD) $? $@

config.sub:: $(P1s)*/config.sub
	$(ICMD) $? $@
config.sub:: $(P2s)/config.sub
	$(ICMD) $? $@
config.sub:: $(P3)/config.sub
	$(ICMD) $? $@

depcomp:: $(P1)/depcomp
	$(CPCMD) $? $@

install-sh: $(P1)/install-sh
	$(CPCMD) $? $@

ltconfig: $(P2)/ltconfig
	$(CPCMD) $? $@

ltmain.sh: $(P2)/ltmain.sh
	$(CPCMD) $? $@

mdate-sh: $(P1)/mdate-sh
	$(CPCMD) $? $@

missing: $(P1)/missing
	$(CPCMD) $? $@

mkinstalldirs: $(P1)/mkinstalldirs
	$(CPCMD) $? $@

doc/texinfo.tex: $(P4)/texinfo.tex
	$(CPCMD) $? $@

##############################################################################