diff options
author | Gabriel Scherer <gabriel.scherer@gmail.com> | 2020-05-03 10:42:13 +0200 |
---|---|---|
committer | Gabriel Scherer <gabriel.scherer@gmail.com> | 2020-05-06 12:10:02 +0200 |
commit | fab58a938a61c62bb66ed70ce2563e1657d9f53b (patch) | |
tree | 266de53c35c3f0c62b4d8bf722c881fb354d6ee8 | |
parent | f2587c1fb1a10548a7c35e931986af0ebecbaef7 (diff) | |
download | ocaml-fab58a938a61c62bb66ed70ce2563e1657d9f53b.tar.gz |
makefiles: move the inclusion of Makefile.build_config in Makefile.common
-rw-r--r-- | Makefile | 16 | ||||
-rw-r--r-- | Makefile.common | 17 | ||||
-rw-r--r-- | debugger/Makefile | 1 | ||||
-rw-r--r-- | lex/Makefile | 1 | ||||
-rw-r--r-- | ocamldoc/Makefile | 1 | ||||
-rw-r--r-- | ocamltest/Makefile | 1 | ||||
-rw-r--r-- | otherlibs/Makefile | 1 | ||||
-rw-r--r-- | otherlibs/Makefile.otherlibs.common | 1 | ||||
-rw-r--r-- | otherlibs/dynlink/Makefile | 1 | ||||
-rw-r--r-- | otherlibs/systhreads/Makefile | 1 | ||||
-rw-r--r-- | runtime/Makefile | 1 | ||||
-rw-r--r-- | stdlib/Makefile | 1 | ||||
-rw-r--r-- | tools/Makefile | 1 | ||||
-rw-r--r-- | yacc/Makefile | 1 |
14 files changed, 17 insertions, 28 deletions
@@ -16,20 +16,6 @@ # The main Makefile ROOTDIR = . - -# The configure and *clean targets can all be run without running ./configure -# first. -# If no goals were specified (i.e. `make`), add defaultentry (since it requires -# ./configure to be run) -CAN_BE_UNCONFIGURED := $(strip \ - $(filter-out partialclean clean distclean configure, \ - $(if $(MAKECMDGOALS),$(MAKECMDGOALS),defaultentry))) - -ifeq "$(CAN_BE_UNCONFIGURED)" "" --include Makefile.build_config -else -include Makefile.build_config -endif include Makefile.common .PHONY: defaultentry @@ -1083,7 +1069,7 @@ distclean: clean include .depend -ifneq "$(strip $(CAN_BE_UNCONFIGURED))" "" +ifneq "$(CAN_BE_UNCONFIGURED)" "" Makefile.config Makefile.build_config: config.status config.status: diff --git a/Makefile.common b/Makefile.common index 55d44fdfe8..91644949f5 100644 --- a/Makefile.common +++ b/Makefile.common @@ -15,7 +15,22 @@ # This makefile contains common definitions and rules shared by # other Makefiles -# We assume that Makefile.config has already been included + +# Some special targets ('*clean' and 'configure') do not require configuration. +# CAN_BE_UNCONFIGURED is empty if only those targets are requested, +# and non-empty if configuration is required. +CAN_BE_UNCONFIGURED := $(strip \ + $(filter-out partialclean clean distclean configure, \ + $(if $(MAKECMDGOALS),$(MAKECMDGOALS),defaultentry))) +# If no goals were specified (i.e. `make`), we add defaultentry +# (since it requires ./configure to be run) so that +# CAN_BE_UNCONFIGURED is non-empty. + +ifeq "$(CAN_BE_UNCONFIGURED)" "" +-include $(ROOTDIR)/Makefile.build_config +else +include $(ROOTDIR)/Makefile.build_config +endif # %(DEPDIR) must be kept in sync with entries in .gitignore DEPDIR=.dep diff --git a/debugger/Makefile b/debugger/Makefile index a6c18c3b3b..73d050e7ee 100644 --- a/debugger/Makefile +++ b/debugger/Makefile @@ -15,7 +15,6 @@ ROOTDIR = .. --include $(ROOTDIR)/Makefile.build_config include $(ROOTDIR)/Makefile.common include $(ROOTDIR)/Makefile.best_binaries diff --git a/lex/Makefile b/lex/Makefile index 5d3f04592c..5601d4f7ad 100644 --- a/lex/Makefile +++ b/lex/Makefile @@ -17,7 +17,6 @@ ROOTDIR = .. --include $(ROOTDIR)/Makefile.build_config include $(ROOTDIR)/Makefile.common CAMLYACC ?= $(ROOTDIR)/yacc/ocamlyacc diff --git a/ocamldoc/Makefile b/ocamldoc/Makefile index e2e911c2c1..8addaadb24 100644 --- a/ocamldoc/Makefile +++ b/ocamldoc/Makefile @@ -15,7 +15,6 @@ ROOTDIR = .. --include $(ROOTDIR)/Makefile.build_config include $(ROOTDIR)/Makefile.common include $(ROOTDIR)/Makefile.best_binaries diff --git a/ocamltest/Makefile b/ocamltest/Makefile index a12c713ee9..5ea5643799 100644 --- a/ocamltest/Makefile +++ b/ocamltest/Makefile @@ -17,7 +17,6 @@ ROOTDIR = .. --include $(ROOTDIR)/Makefile.build_config include $(ROOTDIR)/Makefile.common include $(ROOTDIR)/Makefile.best_binaries diff --git a/otherlibs/Makefile b/otherlibs/Makefile index a855475382..e5df383198 100644 --- a/otherlibs/Makefile +++ b/otherlibs/Makefile @@ -14,7 +14,6 @@ #************************************************************************** ROOTDIR=.. --include $(ROOTDIR)/Makefile.build_config include $(ROOTDIR)/Makefile.common OTHERLIBRARIES ?= bigarray dynlink raw_spacetime_lib str systhreads \ diff --git a/otherlibs/Makefile.otherlibs.common b/otherlibs/Makefile.otherlibs.common index 81d2563096..9fb7109da8 100644 --- a/otherlibs/Makefile.otherlibs.common +++ b/otherlibs/Makefile.otherlibs.common @@ -16,7 +16,6 @@ # Common Makefile for otherlibs ROOTDIR=../.. --include $(ROOTDIR)/Makefile.build_config include $(ROOTDIR)/Makefile.common include $(ROOTDIR)/Makefile.best_binaries diff --git a/otherlibs/dynlink/Makefile b/otherlibs/dynlink/Makefile index 2072867e91..7875ec0848 100644 --- a/otherlibs/dynlink/Makefile +++ b/otherlibs/dynlink/Makefile @@ -21,7 +21,6 @@ ROOTDIR = ../.. --include $(ROOTDIR)/Makefile.build_config include $(ROOTDIR)/Makefile.common include $(ROOTDIR)/Makefile.best_binaries diff --git a/otherlibs/systhreads/Makefile b/otherlibs/systhreads/Makefile index e848c9fcdb..7909e3cc52 100644 --- a/otherlibs/systhreads/Makefile +++ b/otherlibs/systhreads/Makefile @@ -15,7 +15,6 @@ ROOTDIR=../.. --include $(ROOTDIR)/Makefile.build_config include $(ROOTDIR)/Makefile.common include $(ROOTDIR)/Makefile.best_binaries diff --git a/runtime/Makefile b/runtime/Makefile index c62c1e0fe3..a992dc6852 100644 --- a/runtime/Makefile +++ b/runtime/Makefile @@ -15,7 +15,6 @@ ROOTDIR = .. --include $(ROOTDIR)/Makefile.build_config include $(ROOTDIR)/Makefile.common # Lists of source files diff --git a/stdlib/Makefile b/stdlib/Makefile index 965da1203e..72566001bd 100644 --- a/stdlib/Makefile +++ b/stdlib/Makefile @@ -15,7 +15,6 @@ ROOTDIR = .. --include $(ROOTDIR)/Makefile.build_config include $(ROOTDIR)/Makefile.common TARGET_BINDIR ?= $(BINDIR) diff --git a/tools/Makefile b/tools/Makefile index 39ec0e7a6b..0a2ef191ed 100644 --- a/tools/Makefile +++ b/tools/Makefile @@ -16,7 +16,6 @@ MAKEFLAGS := -r -R ROOTDIR = .. --include $(ROOTDIR)/Makefile.build_config include $(ROOTDIR)/Makefile.common ifeq ($(SYSTEM),unix) diff --git a/yacc/Makefile b/yacc/Makefile index 257ee420c6..3c4425a866 100644 --- a/yacc/Makefile +++ b/yacc/Makefile @@ -17,7 +17,6 @@ ROOTDIR = .. --include $(ROOTDIR)/Makefile.build_config include $(ROOTDIR)/Makefile.common OC_CPPFLAGS += -I$(ROOTDIR)/runtime |