diff --git a/Makefile.in b/Makefile.in index 06afd531..ceb6ea1c 100644 --- a/Makefile.in +++ b/Makefile.in @@ -26,14 +26,11 @@ INSTALL_CAD_DIRS = windows doc ${TECHS} # the build tree), empty otherwise (the pre-built PostScript is installed as-is). DOCS_TARGET = @DOCS_TARGET@ -# $(call submake,,) -- recurse into a build subdirectory. -# Every module is a configure-generated Makefile, so config.status -# already created the build subdir with its Makefile: recurse natively. The one -# exception is readline/, which is intentionally never converted; it has no -# generated Makefile, so it takes the -f path against the source Makefile (and its -# build subdir is created on demand). +# $(call submake,,) -- recurse into a build subdirectory. Every module +# is a configure-generated Makefile, so config.status already created +# the build subdir with its Makefile; recurse into it natively. define submake -if test "x$(1)" = xreadline; then mkdir -p $(1) && $(MAKE) -C $(1) -f $(MAGICSRC)/$(1)/Makefile $(2); else $(MAKE) -C $(1) $(2); fi +$(MAKE) -C $(1) $(2) endef all: $(ALL_TARGET) techs $(DOCS_TARGET) @@ -57,8 +54,8 @@ config: # Declarative subdir recursion. # # Each (phase, dir) pair is a PHONY target "@" whose recipe recurses -# into with that phase's goal via $(submake) (so readline/ still takes the -# -f path). A phase aggregate (depend, modules, libs, ...) is then just a list +# into with that phase's goal via $(submake). A phase aggregate (modules, +# libs, ...) is then just a list # of its per-dir targets as prerequisites -- no shell `for` loops, no FORCE # pattern-rule hack. Ordering between phases is expressed as prerequisites on the # per-dir targets (e.g. every module@ waits for the generated header ${DATABASE_H}), @@ -135,7 +132,7 @@ libs: $(LIB_TARGETS) SUBDIRS = bplane cmwind commands database dbwind debug drc extflat extract graphics \ magic netmenu plow resis select sim textio tiles utils windows wiring -BUNDLED_MODULES = readline lisp +BUNDLED_MODULES = lisp # Unique, deduplicated subdir list (used by the clean fan-out below). SUBDIRS_FILTERED := $(shell echo ${MODULES} ${PROGRAMS} ${SUBDIRS} | tr ' ' '\n' | sort | uniq) @@ -207,14 +204,11 @@ $(INSTALLTCL_TARGETS): install-tcl@%: install-tcl-dirs install-tcl-real: $(INSTALLTCL_TARGETS) # clean@: clean one subdir if it exists. Must not create dirs (skip absent -# ones) and must not fail the build (|| true). readline/ uses the -f path -# (mirrors $(submake); it is the one unconverted module). +# ones) and must not fail the build (|| true). CLEAN_TARGETS := $(addprefix clean@,$(sort ${SUBDIRS_FILTERED} ${TECHS} ${BUNDLED_MODULES})) .PHONY: $(CLEAN_TARGETS) $(CLEAN_TARGETS): clean@%: - @test -d $* || exit 0; \ - if test "x$*" = xreadline; then ${MAKE} -C $* -f ${MAGICSRC}/$*/Makefile clean; \ - else ${MAKE} -C $* clean; fi || true + @test -d $* || exit 0; ${MAKE} -C $* clean || true .PHONY: clean clean: $(CLEAN_TARGETS) diff --git a/scripts/configure b/scripts/configure index f136d07e..caf93eaf 100755 --- a/scripts/configure +++ b/scripts/configure @@ -622,7 +622,6 @@ ac_includes_default="\ ac_subst_vars='LTLIBOBJS LIBOBJS -MAKE_READLINE MAKE_CAIRO MAKE_GLU MAKE_GL @@ -9502,8 +9501,6 @@ MAKE_GLU=$usingGLU MAKE_CAIRO=$usingCairo -MAKE_READLINE=0 - ac_config_files="$ac_config_files Makefile:Makefile.in" diff --git a/scripts/configure.in b/scripts/configure.in index e2e78c23..94ee0c8c 100644 --- a/scripts/configure.in +++ b/scripts/configure.in @@ -2058,7 +2058,6 @@ AC_SUBST(MAKE_X11, [$usingX11]) AC_SUBST(MAKE_GL, [$usingOGL]) AC_SUBST(MAKE_GLU, [$usingGLU]) AC_SUBST(MAKE_CAIRO, [$usingCairo]) -AC_SUBST(MAKE_READLINE, [0]) dnl Name the .in templates explicitly (relative to srcdir) so config.status can dnl find them when run from a separate build directory. Outputs land in the diff --git a/scripts/defs.mak.in b/scripts/defs.mak.in index aa738031..c111efd0 100755 --- a/scripts/defs.mak.in +++ b/scripts/defs.mak.in @@ -19,12 +19,11 @@ MAGICSRC = @abs_top_srcdir@ BUILD_TOP := $(abspath $(MAGICDIR)) # Minimal srcdir fallback. Every module converted to Makefile.in sets # `srcdir` (and VPATH) from @srcdir@ *before* including this file. The only -# Makefiles that do NOT are readline/ (intentionally never converted) and the -# top-level Makefile; neither compiles magic sources through the pattern rules, so -# neither needs VPATH. We only default `srcdir` -- derived from where make is -# running (CURDIR, a build dir) relative to BUILD_TOP -- so that CPPFLAGS, which -# lists -I${srcdir}, stays well-formed. The patsubst is an anchored prefix strip: -# "" at the build top, "/readline" in the readline subdir. +# Makefile that does NOT is the top-level Makefile, which does not compile magic +# sources through the pattern rules and so needs no VPATH. We only default +# `srcdir` -- derived from where make is running (CURDIR, a build dir) relative to +# BUILD_TOP -- so that CPPFLAGS, which lists -I${srcdir}, stays well-formed. The +# patsubst is an anchored prefix strip: "" at the build top. ifeq ($(origin srcdir),undefined) srcdir := $(MAGICSRC)$(patsubst $(BUILD_TOP)%,%,$(CURDIR)) endif @@ -186,12 +185,6 @@ CXX = @CXX@ # -I${srcdir}: this module's source dir, for same-directory headers CPPFLAGS = -I${GENINC} -I${MAGICSRC} -I${srcdir} @CPPFLAGS@ CXXFLAGS = @CXXFLAGS@ -# Bundled GNU readline: its headers use includes, so the readline -# source's parent directory must be on the include path. Only for the bundled -# build (@MAKE_READLINE@ = 1); a no-op with a system or disabled readline. -ifeq (@MAKE_READLINE@,1) -CPPFLAGS += -I${MAGICSRC}/readline -endif DFLAGS_MAGICVERSION = -DMAGIC_VERSION=\"${MAGIC_VERSION}\" -DMAGIC_REVISION=\"${MAGIC_REVISION}\" -DMAGIC_COMMIT=\"${MAGIC_COMMIT}\" ${MAGIC_BUILDDATE_DEFS} ifeq (${MAGIC_BUILDDATE_DEFS},) DFLAGS_MAGICVERSION += "-DMAGIC_BUILDDATE=\"${MAGIC_BUILDDATE}\"" @@ -244,4 +237,3 @@ MAKE_X11 = @MAKE_X11@ MAKE_GL = @MAKE_GL@ MAKE_GLU = @MAKE_GLU@ MAKE_CAIRO = @MAKE_CAIRO@ -MAKE_READLINE = @MAKE_READLINE@