1# -*- makefile-gmake -*- 2# $Id: Makefile.meta_f 327756 2011-07-28 18:28:10Z ucko $ 3 4### Flat-makefile-based recursive builds 5 6ifneq "" "$(filter-out $(CURDIR),$(builddir))" 7 CREATE_FSMF = $(top_srcdir)/scripts/common/impl/create_flat_submakefile.sh 8 CREATE_FSMF_AWK = $(CREATE_FSMF:.sh=.awk) 9 10 Makefile.flat: $(CREATE_FSMF) $(CREATE_FSMF_AWK) $(builddir)/Makefile.flat 11 +$< $(builddir) $(subdir) 12endif 13MAKE_FLAT = $(MAKE) $(MFLAGS_NR) -f Makefile.flat 14 15# *_f targets build from local flat makefiles (produced on demand) 16# that disregard dependencies beyond the current subtree. 17 18all_f: Makefile.flat 19 +$(MAKE_FLAT) 20clean_f: Makefile.flat 21 +$(MAKE_FLAT) MTARGET=clean 22purge_f: Makefile.flat 23 +$(MAKE_FLAT) MTARGET=purge 24libs_f: Makefile.flat 25 +$(MAKE_FLAT) all_libs 26sources_f: Makefile.flat 27 +$(MAKE_FLAT) all_files 28 29# *_fd targets build the local subtree in parallel according to the 30# top-level flat makefile, which may entail visiting dependencies 31# beyond the current subtree. 32 33all_fd: 34 +cd $(builddir) && $(MAKE_FLAT) $(subdir)/ 35clean_fd: 36 +cd $(builddir) && $(MAKE_FLAT) $(subdir)/ MTARGET=clean 37purge_fd: 38 +cd $(builddir) && $(MAKE_FLAT) $(subdir)/ MTARGET=purge 39 40.PHONY: all_f clean_f purge_f libs_f sources_f all_fd clean_fd purge_fd 41