Skip to content
This repository has been archived by the owner on Jul 26, 2021. It is now read-only.

Commit

Permalink
* использованы merge, split
Browse files Browse the repository at this point in the history
* добавлен `reversedirpath` (IT-Service/ITG.MakeUtils#16)
  • Loading branch information
sergey-s-betke committed Jul 23, 2018
1 parent 9e350a7 commit d716b23
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 9 deletions.
2 changes: 1 addition & 1 deletion ITG.MakeUtils/chocolatey.mk
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ $$($(1)TARGETS): \
$$(call writeinformation,Generating chocolatey package file "$$@"...)
$$(MAKETARGETDIR)
cd $$(@D) && $$(CHOCO) \
pack $$(subst $$(__gmsl_space),/,$$(patsubst %,..,$$(subst /,$$(__gmsl_space),$$(@D))))/$$< \
pack $$(call reversedirpath,$$(@D))$$< \
--force \
--version $$($(1)VERSION) \
--verbose
Expand Down
13 changes: 6 additions & 7 deletions ITG.MakeUtils/common.mk
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,9 @@ $(OUTPUTDIR) $(AUXDIR) $(CONFIGDIR):
# $(call rwildcard,dir,filesfilter)
rwildcard = $(wildcard $1$2) $(foreach d,$(wildcard $1*),$(call rwildcard,$d/,$2))

# $(call reversedirpath,dirPath,pathToRootFromChild)
reversedirpath = $(if $(strip $1),$(foreach d,$(call split,/,$1),../),./)

# $(call setvariable, var, value)
define setvariable
$1:=$2
Expand Down Expand Up @@ -240,10 +243,6 @@ TargetWriter = $$(foreach path,$$($(1)),$$$$$$$$(ROOT_PROJECT_DIR)$(SUBPROJECT_D
pushArtifactTargets = $(call exportGlobalVariablesAux,$(1),TargetWriter)
pushArtifactTarget = $(pushArtifactTargets)

# $(call calcRootProjectDir, Project)
calcRootProjectAux = $(subst $(__gmsl_space),/,$(patsubst %,..,$(subst /,$(__gmsl_space),$(call getSubProjectDir,$1))))
calcRootProjectDir = $(if $(call calcRootProjectAux,$1),$(call calcRootProjectAux,$1)/,./)

# $(call getSubProjectDir, Project)
getSubProjectDir = $(call assert,$1,Expected project slug)$($(1)_DIR)

Expand All @@ -260,14 +259,14 @@ MAKE_SUBPROJECT = \
-C $(call getSubProjectDir,$1) \
SUBPROJECT=$1 \
SUBPROJECT_DIR=$(call getSubProjectDir,$1) \
ROOT_PROJECT_DIR=$(call calcRootProjectDir,$1) \
SUBPROJECT_EXPORTS_FILE=$(call calcRootProjectDir,$1)$(SUBPROJECTS_EXPORTS_DIR)$1.mk
ROOT_PROJECT_DIR=$(call reversedirpath,$1) \
SUBPROJECT_EXPORTS_FILE=$(call reversedirpath,$1)$(SUBPROJECTS_EXPORTS_DIR)$1.mk

# $(call MAKE_SUBPROJECT_TARGET, Target)
MAKE_SUBPROJECT_TARGET = \
$(MAKE) \
-C $(ROOT_PROJECT_DIR) \
ROOT_PROJECT_DIR=$(call calcRootProjectDir,$1) \
ROOT_PROJECT_DIR=$(call reversedirpath,$1) \
$1

# $(call declareProjectTargets, Project)
Expand Down
2 changes: 1 addition & 1 deletion ITG.MakeUtils/ghostscript.mk
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ endef

GSCMDLINE = $(GS) \
$(foreach incdir,$(GSINCDIR),-I'$(incdir)') \
$(if $(GSFONTDIR),-sFONTPATH='$(subst $(__gmsl_space),$(PATHSEP),$(strip $(GSFONTDIR)))')
$(if $(GSFONTDIR),-sFONTPATH='$(call merge,$(PATHSEP),$(GSFONTDIR))')

# $(if $(PSGENERICRESOURCEDIR),-sGenericResourceDir='$(PSGENERICRESOURCEDIR)') \
Expand Down

0 comments on commit d716b23

Please sign in to comment.