Makefile: Fix `squote' to have the right number of `\'s.
[distorted-chroot] / Makefile
index 72299a7..7479ae6 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -40,7 +40,7 @@ NOTIFY_FATAL           = 1
 
 ## Volume group from which to allocate chroot volumes and snapshots.
 CONFIG_VARS            += VG LVPREFIX
-VG                      = vg-$(shell hostname)
+VG                     := vg-$(shell hostname)
 LVPREFIX                =
 
 ## Logical volume size, as an LVM option.
@@ -64,7 +64,7 @@ APTCONF                        = $(notdir $(wildcard etc/apt-conf.d/[0-9]*[!~]))
 
 ## Proxy setting.
 CONFIG_VARS            += PROXY
-PROXY                  := $(shell \
+PROXY                   = $(shell \
        eval $$(apt-config $(foreach a,$(APTCONF),-cetc/apt-conf.d/$a) \
                shell proxy Acquire::http::proxy); \
        case $${proxy+t} in (t) echo "$$proxy" ;; (*) echo nil ;; esac)
@@ -76,8 +76,8 @@ DISTS                  = $(PRIMARY_DIST) buster bullseye sid
 
 ## Host's native architecture(s).
 CONFIG_VARS            += MYARCH NATIVE_ARCHS
-MYARCH                  = $(shell dpkg --print-architecture)
-OTHERARCHS              = $(shell dpkg --print-foreign-architectures)
+MYARCH                 := $(shell dpkg --print-architecture)
+OTHERARCHS             := $(shell dpkg --print-foreign-architectures)
 NATIVE_ARCHS            = $(MYARCH) $(OTHERARCHS)
 
 ## Foreign (emulated) architectures to support.
@@ -274,7 +274,8 @@ throwrc                      = { $1; echo $$? >&4; }
 ##     $(call squote,TXT)
 ##
 ## Single-quote TXT.
-squote                  = '$(subst ','\\'',$1)'
+squote                  = '$(subst ','\'',$1)'
+#'
 
 ##     $(call chroot-dist,D-A) -> D
 ##     $(call chroot-arch,D-A) -> A
@@ -583,6 +584,17 @@ $(CHECK_SCHROOT_SCRIPTS): check-script/%:
 .PHONY: $(addprefix check-script/,$(SCHROOT_SCRIPTS))
 
 ###--------------------------------------------------------------------------
+### Ccache setup.
+
+CCACHE_CONFIGS          = $(foreach r,$(ALL_CHROOTS), \
+       /var/lib/sbuild/build/.ccache/$(LVPREFIX)$r/ccache.conf)
+all:: $(CCACHE_CONFIGS)
+$(CCACHE_CONFIGS): /var/lib/sbuild/build/.ccache/$(LVPREFIX)%/ccache.conf: \
+               etc/ccache.conf
+       $(V_AT)mkdir -p $(dir $@)
+       $(call v_tag,COPY)cp $< $@.new && mv $@.new $@
+
+###--------------------------------------------------------------------------
 ### `/usr/local/' structure.
 
 LOCAL_COMMON_DIRS       = share/ src/
@@ -622,7 +634,7 @@ $(foreach a,$(ALL_ARCHS),\
 ### Main chroot maintenance.
 
 OPTS                    =
-FRESH                   = create
+FRESH                   = 1w
 JOBS                    = chroot cross-tools pkg-build
 
 MAINTQ_                         = -q