summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEuAndreh <eu@euandre.org>2025-03-30 09:38:37 -0300
committerEuAndreh <eu@euandre.org>2025-03-30 09:38:37 -0300
commita6b4998786132a4f3614a234b9eb48102bc85e17 (patch)
tree525227ebdb490cc7d5d0a861fbf9c73961d544ae
parentMakefile: Add compressed snippets files (diff)
downloadeuandre.org-a6b4998786132a4f3614a234b9eb48102bc85e17.tar.gz
euandre.org-a6b4998786132a4f3614a234b9eb48102bc85e17.tar.xz
Makefile: Use rsync(1) in "install" over cp(1) in loop
-rw-r--r--.gitignore2
-rw-r--r--Makefile26
2 files changed, 15 insertions, 13 deletions
diff --git a/.gitignore b/.gitignore
index 3ffcfb1..0325f3d 100644
--- a/.gitignore
+++ b/.gitignore
@@ -17,4 +17,6 @@ feed.xml
/email.txt
/baseurl.txt
/expiry.txt
+/install.html.txt
+/install.src.txt
/src/content/.well-known/
diff --git a/Makefile b/Makefile
index f1747f0..3a15506 100644
--- a/Makefile
+++ b/Makefile
@@ -134,6 +134,8 @@ derived-assets = \
baseurl.txt \
expiry.txt \
src/content/.well-known/security.txt \
+ install.html.txt \
+ install.src.txt \
side-assets = \
src/collections/*/*/*/*/*.html.*.txt \
@@ -194,6 +196,13 @@ src/content/.well-known/security.txt: email.txt baseurl.txt expiry.txt
printf 'Encryption: %s/public.asc\n' "`cat baseurl.txt`" >> $@
printf 'Preferred-Languages: en, pt, fr, eo, es\n' >> $@
+install.html.txt: $(all-contents) $(sources.snippets) $(sources.snippets.gz)
+ find $(all-contents) `cat $(sources.snippets) $(sources.snippets.gz)` \
+ | sed 's|^src/content/||' > $@
+
+install.src.txt: $(sources)
+ find $(sources) | sed 's|^src/content/||' > $@
+
check-unit:
@@ -224,19 +233,10 @@ clean:
## Installs into $(DESTDIR)$(PREFIX). Its dependency target
## ensures that all installable artifacts are crafted beforehand.
install: all
- mkdir -p \
- '$(DESTDIR)$(SRCDIR)' \
-
- for f in $(all-contents) `cat $(sources.snippets)`; do \
- dir='$(DESTDIR)$(HTMLDIR)'/"`dirname "$${f#src/content/}"`"; \
- mkdir -p "$$dir"; \
- cp -P "$$f" "$$dir"; \
- done
- for f in $(sources); do \
- dir='$(DESTDIR)$(SRCDIR)'/"`dirname "$${f#src/content/}"`"; \
- mkdir -p "$$dir"; \
- cp -P "$$f" "$$dir"; \
- done
+ rsync --mkpath -a --files-from=install.html.txt src/content/ \
+ '$(DESTDIR)$(HTMLDIR)'
+ rsync --mkpath -a --files-from=install.src.txt src/content/ \
+ '$(DESTDIR)$(SRCDIR)'
## Uninstalls from $(DESTDIR)$(PREFIX). This is a perfect mirror
## of the "install" target, and removes *all* that was installed.