xref: /aosp_15_r20/external/ltp/include/mk/automake.mk (revision 49cdfc7efb34551c7342be41a7384b9c40d7cab7)
1*49cdfc7eSAndroid Build Coastguard Worker#
2*49cdfc7eSAndroid Build Coastguard Worker#    Autotools include Makefile.
3*49cdfc7eSAndroid Build Coastguard Worker#
4*49cdfc7eSAndroid Build Coastguard Worker#    Copyright (C) 2009, Cisco Systems Inc.
5*49cdfc7eSAndroid Build Coastguard Worker#
6*49cdfc7eSAndroid Build Coastguard Worker#    This program is free software; you can redistribute it and/or modify
7*49cdfc7eSAndroid Build Coastguard Worker#    it under the terms of the GNU General Public License as published by
8*49cdfc7eSAndroid Build Coastguard Worker#    the Free Software Foundation; either version 2 of the License, or
9*49cdfc7eSAndroid Build Coastguard Worker#    (at your option) any later version.
10*49cdfc7eSAndroid Build Coastguard Worker#
11*49cdfc7eSAndroid Build Coastguard Worker#    This program is distributed in the hope that it will be useful,
12*49cdfc7eSAndroid Build Coastguard Worker#    but WITHOUT ANY WARRANTY; without even the implied warranty of
13*49cdfc7eSAndroid Build Coastguard Worker#    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14*49cdfc7eSAndroid Build Coastguard Worker#    GNU General Public License for more details.
15*49cdfc7eSAndroid Build Coastguard Worker#
16*49cdfc7eSAndroid Build Coastguard Worker#    You should have received a copy of the GNU General Public License along
17*49cdfc7eSAndroid Build Coastguard Worker#    with this program; if not, write to the Free Software Foundation, Inc.,
18*49cdfc7eSAndroid Build Coastguard Worker#    51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
19*49cdfc7eSAndroid Build Coastguard Worker#
20*49cdfc7eSAndroid Build Coastguard Worker# Ngie Cooper, July 2009
21*49cdfc7eSAndroid Build Coastguard Worker#
22*49cdfc7eSAndroid Build Coastguard Worker
23*49cdfc7eSAndroid Build Coastguard Worker# Override these variables to use non-system available tools.
24*49cdfc7eSAndroid Build Coastguard WorkerACLOCAL		?= aclocal
25*49cdfc7eSAndroid Build Coastguard WorkerAUTOCONF	?= autoconf
26*49cdfc7eSAndroid Build Coastguard WorkerAUTOHEADER	?= autoheader
27*49cdfc7eSAndroid Build Coastguard WorkerAUTOMAKE	?= automake
28*49cdfc7eSAndroid Build Coastguard Worker
29*49cdfc7eSAndroid Build Coastguard WorkerAUTOCONFED_SUBDIRS	= \
30*49cdfc7eSAndroid Build Coastguard Worker			testcases/realtime \
31*49cdfc7eSAndroid Build Coastguard Worker			testcases/open_posix_testsuite
32*49cdfc7eSAndroid Build Coastguard Worker
33*49cdfc7eSAndroid Build Coastguard Worker# We want to run this every single time to ensure that all of the prereq files
34*49cdfc7eSAndroid Build Coastguard Worker# are there.
35*49cdfc7eSAndroid Build Coastguard Worker.PHONY: testcases/realtime/configure
36*49cdfc7eSAndroid Build Coastguard Workertestcases/realtime/configure:
37*49cdfc7eSAndroid Build Coastguard Worker	$(MAKE) -C $(@D) autotools
38*49cdfc7eSAndroid Build Coastguard Worker
39*49cdfc7eSAndroid Build Coastguard Worker.PHONY: testcases/open_posix_testsuite/configure
40*49cdfc7eSAndroid Build Coastguard Workertestcases/open_posix_testsuite/configure:
41*49cdfc7eSAndroid Build Coastguard Worker	$(MAKE) -C $(@D) autotools
42*49cdfc7eSAndroid Build Coastguard Worker
43*49cdfc7eSAndroid Build Coastguard Worker.PHONY: autotools
44*49cdfc7eSAndroid Build Coastguard Workerautotools: aclocal autoconf autoheader automake $(addsuffix /configure,$(AUTOCONFED_SUBDIRS))
45*49cdfc7eSAndroid Build Coastguard Worker
46*49cdfc7eSAndroid Build Coastguard Worker.PHONY: aclocal
47*49cdfc7eSAndroid Build Coastguard Workeraclocal: aclocal.m4
48*49cdfc7eSAndroid Build Coastguard Worker
49*49cdfc7eSAndroid Build Coastguard Workeraclocal.m4: $(wildcard m4/*.m4) m4/ltp-version.m4
50*49cdfc7eSAndroid Build Coastguard Worker	$(ACLOCAL) -I m4
51*49cdfc7eSAndroid Build Coastguard Worker
52*49cdfc7eSAndroid Build Coastguard Worker.PHONY: autoconf
53*49cdfc7eSAndroid Build Coastguard Workerautoconf: configure
54*49cdfc7eSAndroid Build Coastguard Worker
55*49cdfc7eSAndroid Build Coastguard Workerconfigure: configure.ac aclocal.m4
56*49cdfc7eSAndroid Build Coastguard Worker	$(AUTOCONF)
57*49cdfc7eSAndroid Build Coastguard Worker
58*49cdfc7eSAndroid Build Coastguard Worker.PHONY: autoheader
59*49cdfc7eSAndroid Build Coastguard Workerautoheader: configure.ac $(wildcard m4/*.m4) m4/ltp-version.m4 aclocal.m4
60*49cdfc7eSAndroid Build Coastguard Worker	$(AUTOHEADER)
61*49cdfc7eSAndroid Build Coastguard Worker
62*49cdfc7eSAndroid Build Coastguard Workerinclude:
63*49cdfc7eSAndroid Build Coastguard Worker	mkdir -p "$@"
64*49cdfc7eSAndroid Build Coastguard Worker
65*49cdfc7eSAndroid Build Coastguard Workerm4/ltp-version.m4: VERSION
66*49cdfc7eSAndroid Build Coastguard Worker	sed -n '1{s:LTP-:m4_define([LTP_VERSION],[:;s:$$:]):;p;q}' $< > $@
67*49cdfc7eSAndroid Build Coastguard Worker
68*49cdfc7eSAndroid Build Coastguard Worker.PHONY: automake
69*49cdfc7eSAndroid Build Coastguard WorkerAUTOMAKE_FILES := config.guess config.sub install-sh missing stamp-h1
70*49cdfc7eSAndroid Build Coastguard Workerautomake: aclocal $(AUTOMAKE_FILES)
71*49cdfc7eSAndroid Build Coastguard Worker$(AUTOMAKE_FILES): m4/Makefile.in
72*49cdfc7eSAndroid Build Coastguard Workerm4/Makefile.in: m4/Makefile.am aclocal.m4
73*49cdfc7eSAndroid Build Coastguard Worker	$(AUTOMAKE) -c -a
74*49cdfc7eSAndroid Build Coastguard Worker
75*49cdfc7eSAndroid Build Coastguard Worker.PHONY: ac-clean ac-distclean ac-maintainer-clean
76*49cdfc7eSAndroid Build Coastguard Workerac-clean::
77*49cdfc7eSAndroid Build Coastguard Worker	$(RM) -rf autom4te.cache
78*49cdfc7eSAndroid Build Coastguard Worker	$(RM) -f config.log config.status
79*49cdfc7eSAndroid Build Coastguard Worker	$(RM) -f include/config.h include/stamp-h1
80*49cdfc7eSAndroid Build Coastguard Worker	$(RM) -f m4/Makefile m4/ltp-version.m4
81*49cdfc7eSAndroid Build Coastguard Worker	for d in $(AUTOCONFED_SUBDIRS); do \
82*49cdfc7eSAndroid Build Coastguard Worker	    $(MAKE) -C "$(top_srcdir)/$$d" $@; \
83*49cdfc7eSAndroid Build Coastguard Worker	done
84*49cdfc7eSAndroid Build Coastguard Worker
85*49cdfc7eSAndroid Build Coastguard Workerac-distclean:: ac-clean
86*49cdfc7eSAndroid Build Coastguard Workerac-maintainer-clean:: ac-distclean
87*49cdfc7eSAndroid Build Coastguard Worker	for d in $(AUTOCONFED_SUBDIRS); do \
88*49cdfc7eSAndroid Build Coastguard Worker	    $(MAKE) -C "$(top_srcdir)/$$d" $@; \
89*49cdfc7eSAndroid Build Coastguard Worker	done
90*49cdfc7eSAndroid Build Coastguard Worker	$(RM) -f aclocal.m4 configure $(AUTOMAKE_FILES) m4/Makefile.in
91*49cdfc7eSAndroid Build Coastguard Worker	$(RM) -f include/*config.h.in
92*49cdfc7eSAndroid Build Coastguard Worker
93*49cdfc7eSAndroid Build Coastguard Worker# Don't include config.h, or make will (rightfully) whine about overriding
94*49cdfc7eSAndroid Build Coastguard Worker# rules.
95*49cdfc7eSAndroid Build Coastguard Worker#
96*49cdfc7eSAndroid Build Coastguard Worker# This list should match the files in configure.ac.
97*49cdfc7eSAndroid Build Coastguard Worker#
98*49cdfc7eSAndroid Build Coastguard WorkerAUTOGENERATED_FILES	= \
99*49cdfc7eSAndroid Build Coastguard Worker			include/mk/config.mk	\
100*49cdfc7eSAndroid Build Coastguard Worker			include/mk/features.mk	\
101*49cdfc7eSAndroid Build Coastguard Worker			lib/ltp.pc		\
102*49cdfc7eSAndroid Build Coastguard Worker			m4/Makefile
103*49cdfc7eSAndroid Build Coastguard Worker
104*49cdfc7eSAndroid Build Coastguard Workerdistclean:: %: clean ac-distclean
105*49cdfc7eSAndroid Build Coastguard Worker	for d in $(AUTOCONFED_SUBDIRS); do \
106*49cdfc7eSAndroid Build Coastguard Worker	    $(MAKE) -C "$(top_srcdir)/$$d" $@; \
107*49cdfc7eSAndroid Build Coastguard Worker	done
108*49cdfc7eSAndroid Build Coastguard Worker	$(RM) -f $(AUTOGENERATED_FILES)
109*49cdfc7eSAndroid Build Coastguard Worker
110*49cdfc7eSAndroid Build Coastguard Workermaintainer-clean:: distclean ac-maintainer-clean
111*49cdfc7eSAndroid Build Coastguard Worker
112*49cdfc7eSAndroid Build Coastguard Worker$(AUTOGENERATED_FILES): $(top_builddir)/config.status
113*49cdfc7eSAndroid Build Coastguard Worker	$(SHELL) $^
114*49cdfc7eSAndroid Build Coastguard Worker
115*49cdfc7eSAndroid Build Coastguard Worker# This variable is automatically changed from help to all once someone has
116*49cdfc7eSAndroid Build Coastguard Worker# run configure, or the equivalent steps manually, as described in INSTALL.
117*49cdfc7eSAndroid Build Coastguard Worker$(abs_top_builddir)/include/mk/config.mk \
118*49cdfc7eSAndroid Build Coastguard Worker$(abs_top_builddir)/include/mk/features.mk:
119*49cdfc7eSAndroid Build Coastguard Worker	$(MAKE) -C $(top_srcdir) help; false
120