Makefile revision 7f3987404833631946334c8e08db701b39556e6f
1#
2#    realtime test suite Makefile.
3#
4#    Copyright (C) 2009, Cisco Systems Inc.
5#
6#    This program is free software; you can redistribute it and/or modify
7#    it under the terms of the GNU General Public License as published by
8#    the Free Software Foundation; either version 2 of the License, or
9#    (at your option) any later version.
10#
11#    This program is distributed in the hope that it will be useful,
12#    but WITHOUT ANY WARRANTY; without even the implied warranty of
13#    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14#    GNU General Public License for more details.
15#
16#    You should have received a copy of the GNU General Public License along
17#    with this program; if not, write to the Free Software Foundation, Inc.,
18#    51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
19#
20# Garrett Cooper, September 2009
21#
22
23top_srcdir		?= ../..
24
25# Override these variables to use non-system available tools.
26ACLOCAL			?= aclocal
27AUTOCONF		?= autoconf
28AUTOHEADER		?= autoheader
29AUTOMAKE		?= automake
30
31include $(top_srcdir)/include/mk/env_pre.mk
32include $(abs_srcdir)/config.mk
33
34LIBDIR			:= lib
35FILTER_OUT_DIRS		:= $(LIBDIR)
36LIB			:= $(LIBDIR)/librealtime.a
37
38# START autotools junk
39AUTOGENERATED_FILES	= \
40			m4/Makefile
41
42AUTOMAKE_FILES := config.guess config.sub install-sh missing stamp-h1
43
44.PHONY: autotools aclocal autoconf autoheader automake
45autotools: aclocal autoconf autoheader automake
46
47.PHONY: ac-clean ac-distclean ac-maintainer-clean
48ac-clean::
49	$(RM) -rf autom4te.cache
50	$(RM) -f aclocal.m4 config.log config.status
51	$(RM) -f include/realtime_config.h include/realtime_config.h.in include/stamp-h1
52
53ac-distclean:: ac-clean
54ac-maintainer-clean:: ac-distclean
55	$(RM) -f aclocal.m4 configure $(AUTOMAKE_FILES) m4/Makefile.in
56
57aclocal.m4:
58	$(ACLOCAL) -I $(abs_srcdir)/m4
59
60autoconf: configure
61
62include/realtime_config.h.in: configure.in $(wildcard m4/*.m4) aclocal.m4
63	$(AUTOHEADER)
64	touch $@
65
66configure: configure.in aclocal.m4
67	$(AUTOCONF)
68automake: $(AUTOMAKE_FILES)
69$(AUTOMAKE_FILES): m4/Makefile.in
70m4/Makefile.in: m4/Makefile.am aclocal.m4
71	$(AUTOMAKE) -c -a
72
73.PHONY: autoheader
74autoheader: include/realtime_config.h.in
75	$(AUTOHEADER)
76
77distclean:: %: clean ac-distclean
78	$(RM) -f $(AUTOGENERATED_FILES)
79
80maintainer-clean:: distclean ac-maintainer-clean
81
82$(AUTOGENERATED_FILES): $(top_builddir)/config.status
83	$(SHELL) $^
84
85# END autotools junk
86
87$(LIBDIR):
88	mkdir -p "$@"
89
90$(LIB): $(LIBDIR)
91	$(MAKE) -C $^ -f "$(abs_srcdir)/$(LIBDIR)/Makefile" all
92
93trunk-all: $(LIB)
94
95trunk-clean:: | lib-clean
96
97lib-clean:: $(LIBDIR)
98	$(MAKE) -C $^ -f "$(abs_srcdir)/$(LIBDIR)/Makefile" clean
99
100include $(top_srcdir)/include/mk/generic_trunk_target.mk
101