From d1470e3d20a2fe6edc0b90521f5b922681110827 Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Wed, 1 Jul 2015 23:22:00 -0600 Subject: (rvs) A whole bunch of stuff --- common.top.mk | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) (limited to 'common.top.mk') diff --git a/common.top.mk b/common.top.mk index a83abb6..9a2fa0a 100644 --- a/common.top.mk +++ b/common.top.mk @@ -14,32 +14,32 @@ # along with this program. If not, see . # Both of these have the argument order "parent,child" -_noslash = $(patsubst %/,%,$1) -_relto = $(call _noslash,$(patsubst $(abspath $1)/%,%,$(abspath $2)/)) -_is_subdir = $(filter $(abspath $1)/%,$(abspath $2)/) +_am_noslash = $(patsubst %/,%,$1) +_am_relto = $(call _am_noslash,$(patsubst $(abspath $1)/%,%,$(abspath $2)/)) +_am_is_subdir = $(filter $(abspath $1)/%,$(abspath $2)/) ## Declare the standard targets all: build .PHONY: all -## Set topobjdir, objdir, and srcdir (assumes that topsrcdir is already set) -ifeq ($(topobjdir),) -topobjdir := $(call _noslash,$(dir $(lastword $(filter %/config.mk config.mk,$(MAKEFILE_LIST))))) +## Set topoutdir, outdir, and srcdir (assumes that topsrcdir is already set) +ifeq ($(topoutdir),) +topoutdir := $(call _am_noslash,$(dir $(lastword $(filter %/config.mk config.mk,$(MAKEFILE_LIST))))) endif - objdir := $(call _noslash,$(dir $(lastword $(filter-out %.mk,$(MAKEFILE_LIST))))) - srcdir := $(firstword $(call _relto,., $(topsrcdir)/$(call _relto,$(topobjdir),$(objdir)) ) .) + outdir := $(call _am_noslash,$(dir $(lastword $(filter-out %.mk,$(MAKEFILE_LIST))))) + srcdir := $(firstword $(call _am_relto,., $(topsrcdir)/$(call _am_relto,$(topoutdir),$(outdir)) ) .) -included_makefiles := $(included_makefiles) $(abspath $(objdir)/Makefile) +included_makefiles := $(included_makefiles) $(abspath $(outdir)/Makefile) ## Set module name -module := $(subst /,_,$(if $(call _is_subdir,.,$(objdir)),$(firstword $(call _relto,.,$(objdir)) all),dep-$(firstword $(call _relto,$(topobjdir),$(objdir)) top))) +module := $(subst /,_,$(if $(call _am_is_subdir,.,$(outdir)),$(firstword $(call _am_relto,.,$(outdir)) all),dep-$(firstword $(call _am_relto,$(topoutdir),$(outdir)) top))) ## Empty variables for use by the module subdirs = depdirs = src_files = -obj_files = +out_files = sys_files = clean_files = -- cgit v1.2.3