# -*- makefile-gmake -*- # $Id$ all: ptb_all ifeq "" "$(builddir)$(SKIP_PRELIMINARIES)" builddir ?= $(CURDIR) CREATE_TUNEUPS = $(top_srcdir)/scripts/common/impl/create_flat_tuneups.sh auto_flat_tuneups.mk: $(CREATE_TUNEUPS) Makefile.flat $< DO_MAKE := $(MAKE) expendable_dirs = spec_bearing_dirs = plain_dirs = -include auto_flat_tuneups.mk endif # Some projects cannot be built in parallel due to sharing object files. # The build system's locking mechanism keeps attempts to do so from # interfering with each other, but can introduce delays, so it would be # best to avoid intra-build contention altogether. However, make's # limitations make that easier said than done; the only way to keep it from # building a pair of targets in parallel is to claim that one depends on # the other, which is effective but can result in overbuilding and # potentially introduce bottlenecks in the case of suboptimal ordering. # (GNU Make's concept of order-only prerequisites is not as useful as it # sounds, as make still insists on updating those targets, just not on # updating whatever lists them as OOPs unless it otherwise has cause to.) # # To address these issues, the build system takes a two-pronged approach. # First, the script (scripts/common/impl/make_lock_map.sh) that produces # the relevant .hints files attempts to sort targets in decreasing order of # utility, as gauged by frequency as a prerequisite in Makefile.flat. In # addition, this makefile includes the hints only when building high-level # targets corresponding to multiple leaf targets and their prerequisites, # as a single application or library and its prerequisites should not # normally have any object files in common. Those heuristics are somewhat # crude, but should keep intra-build contention to a minimum while still # largely avoiding overbuilding and bottlenecks. ifneq "" "$(filter-out %.dll.real %.exe.real %.lib.real,$(MAKECMDGOALS))" -include $(builddir)/build-system/*.hints endif ifndef SKIP_PRELIMINARIES ORIG_MTARGET := $(MTARGET) QUICK_MTARGET = $(ORIG_MTARGET) sources= configurables=configurables.null %.dll.real %.exe.real %.lib.real: override MTARGET = $(QUICK_MTARGET) endif all_dirs ?= $(expendable_dirs) $(spec_bearing_dirs) $(plain_dirs) # Lists of directories in any branch which can benefit from the # aforementioned hints because some of their projects have files in common. ftds100_ut = ctlib dblib odbc tds ftds14_ut = ctlib dblib odbc main_hintees = algo/cobalt/demo app/grid/remote_app cgi connect \ connect/daemons connect/ext connect/test dbapi/driver/ctlib/samples \ dbapi/driver/ftds100/ctlib/samples \ $(ftds100_ut:%=dbapi/driver/ftds100/freetds/%/unittests) \ dbapi/driver/ftds14/ctlib/samples \ $(ftds14_ut:%=dbapi/driver/ftds14/freetds/%/unittests) \ dbapi/test dbapi/test/driver objmgr/test \ sample/app/cgi sample/app/cgi/cgires gpipe_hintees_ = app/action_nodes app/aligndb app/fscr app/gbench \ app/gencoll/altloci_load app/gencoll/ftp_reports app/gpinit app/kmer \ app/pathogen_pipeline app/remap app/repeats app/worker_nodes/blast \ common/jira gencoll/src/asmmetric gencoll/src/gcaccess/get_assembly \ gencoll/src/web gpexec/src/app gpinit/src/build_config \ gpinit/src/gui_build_output objects/genomecoll web/cgi/gpinit gpipe_hintees = $(gpipe_hintees_:%=gpipe/%) internal_hintees_ = ID/utils algo/align/prosplign asn_cache/lib \ blast/SplitDB/auxcomm blast/vdb/blastn eutils/eutilsapp geo/auth \ geo/gds/analyze geo/geocgi $(gpipe_hintees) portal/backend/HTB txserver internal_hintees = $(internal_hintees_:%=internal/%) potential_hintees = $(main_hintees) $(internal_hintees) hintees = $(filter $(potential_hintees:%=%/),$(all_dirs)) # all_files.real : $(all_dirs:%=%.files.real) ; all_files.real : $(hintees:%=%.files.real) ; ifndef SKIP_PRELIMINARIES $(all_dirs:%=%.files): %.files: $(MAKE) $(MFLAGS) -f $(MINPUT) $@.real ifneq "$(plain_dirs)" "" $(plain_dirs:%=%.files.real): %.files.real: +cd ./$*; $(MAKE) $(MFLAGS) sources endif ifneq "$(expendable_dirs)" "" $(expendable_dirs:%=%.files.real): %.files.real: +-cd ./$*; $(MAKE) $(MFLAGS) sources endif .PHONY: $(all_dirs:%=%.files) $(all_dirs:%=%.files.real) endif