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 23 top_srcdir ?= ../.. 24 25 # Override these variables to use non-system available tools. 26 ACLOCAL ?= aclocal 27 AUTOCONF ?= autoconf 28 AUTOHEADER ?= autoheader 29 AUTOMAKE ?= automake 30 31 include $(top_srcdir)/include/mk/env_pre.mk 32 # Ensure that this error / warning only applies for build targets. 33 # 34 # NOTE (garrcoop): this criterium should be in-sync with include/mk/env_pre.mk 35 # (minus help as that's only invoked in the top-level Makefile). 36 ifeq ($(filter autotools %clean .gitignore gitignore.%,$(MAKECMDGOALS)),) 37 include $(abs_srcdir)/config.mk 38 endif 39 include $(top_srcdir)/include/mk/gitignore.mk 40 41 LIBDIR := lib 42 FILTER_OUT_DIRS := $(LIBDIR) m4 43 LIB := $(LIBDIR)/librealtime.a 44 45 # START autotools junk 46 AUTOGENERATED_FILES = \ 47 m4/Makefile 48 49 AUTOMAKE_FILES := config.guess config.sub install-sh missing stamp-h1 50 51 .PHONY: autotools aclocal autoconf autoheader automake 52 autotools: aclocal autoconf autoheader automake 53 54 .PHONY: ac-clean ac-distclean ac-maintainer-clean 55 ac-clean:: 56 $(RM) -rf autom4te.cache 57 $(RM) -f aclocal.m4 config.log config.status 58 $(RM) -f include/realtime_config.h include/stamp-h1 59 60 ac-distclean:: ac-clean 61 ac-maintainer-clean:: ac-distclean 62 $(RM) -f aclocal.m4 configure $(AUTOMAKE_FILES) m4/Makefile.in 63 $(RM) -f include/realtime_config.h.in 64 65 aclocal.m4: 66 $(ACLOCAL) -I $(abs_srcdir)/m4 67 68 autoconf: configure 69 70 include/realtime_config.h.in: configure.ac $(wildcard m4/*.m4) aclocal.m4 71 $(AUTOHEADER) 72 73 configure: configure.ac aclocal.m4 74 $(AUTOCONF) 75 automake: $(AUTOMAKE_FILES) 76 $(AUTOMAKE_FILES): m4/Makefile.in 77 m4/Makefile.in: m4/Makefile.am aclocal.m4 78 $(AUTOMAKE) -c -a 79 80 .PHONY: autoheader 81 autoheader: include/realtime_config.h.in 82 $(AUTOHEADER) 83 84 distclean:: %: clean ac-distclean 85 $(RM) -f $(AUTOGENERATED_FILES) 86 87 maintainer-clean:: distclean ac-maintainer-clean 88 89 $(AUTOGENERATED_FILES): $(top_builddir)/config.status 90 $(SHELL) $^ 91 92 # END autotools junk 93 94 $(LIBDIR): 95 mkdir -p "$@" 96 97 $(LIB): $(LIBDIR) 98 $(MAKE) -C $^ -f "$(abs_srcdir)/$(LIBDIR)/Makefile" all 99 100 trunk-all: $(LIB) 101 102 trunk-clean:: | lib-clean 103 104 lib-clean:: $(LIBDIR) 105 $(MAKE) -C $^ -f "$(abs_srcdir)/$(LIBDIR)/Makefile" clean 106 107 # Stub reference for config.mk 108 $(abs_srcdir)/config.mk: 109 $(MAKE) -C $(top_srcdir) help; false 110 111 include $(top_srcdir)/include/mk/generic_trunk_target.mk 112