build: allow passing relative paths
Allow using relative paths for GLUON_SITEDIR, GLUON_OUTPUTDIR, ... We also check for whitespace in paths now, as build will not work properly with whitespace anyways, and Make's abspath would require escaping otherwise. [Matthias Schiffer: minor changes, rewrite commit message]
This commit is contained in:
parent
70784cb3b2
commit
ab16cea161
21
Makefile
21
Makefile
@ -5,13 +5,28 @@ LANG:=C
|
|||||||
export LC_ALL LANG
|
export LC_ALL LANG
|
||||||
|
|
||||||
|
|
||||||
GLUON_SITEDIR ?= $(CURDIR)/site
|
# initialize (possibly already user set) directory variables
|
||||||
GLUON_TMPDIR ?= $(CURDIR)/tmp
|
GLUON_SITEDIR ?= site
|
||||||
|
GLUON_TMPDIR ?= tmp
|
||||||
|
GLUON_OUTPUTDIR ?= output
|
||||||
|
|
||||||
GLUON_OUTPUTDIR ?= $(CURDIR)/output
|
|
||||||
GLUON_IMAGEDIR ?= $(GLUON_OUTPUTDIR)/images
|
GLUON_IMAGEDIR ?= $(GLUON_OUTPUTDIR)/images
|
||||||
GLUON_PACKAGEDIR ?= $(GLUON_OUTPUTDIR)/packages
|
GLUON_PACKAGEDIR ?= $(GLUON_OUTPUTDIR)/packages
|
||||||
|
|
||||||
|
# check for spaces & resolve possibly relative paths
|
||||||
|
define mkabspath
|
||||||
|
ifneq (1,$(words [$($(1))]))
|
||||||
|
$$(error $(1) must not contain spaces)
|
||||||
|
endif
|
||||||
|
override $(1) := $(abspath $($(1)))
|
||||||
|
endef
|
||||||
|
|
||||||
|
$(eval $(call mkabspath,GLUON_SITEDIR))
|
||||||
|
$(eval $(call mkabspath,GLUON_TMPDIR))
|
||||||
|
$(eval $(call mkabspath,GLUON_OUTPUTDIR))
|
||||||
|
$(eval $(call mkabspath,GLUON_IMAGEDIR))
|
||||||
|
$(eval $(call mkabspath,GLUON_PACKAGEDIR))
|
||||||
|
|
||||||
export GLUON_TMPDIR GLUON_IMAGEDIR GLUON_PACKAGEDIR DEVICES
|
export GLUON_TMPDIR GLUON_IMAGEDIR GLUON_PACKAGEDIR DEVICES
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user