diff options
author | EuAndreh <eu@euandre.org> | 2025-03-30 09:38:37 -0300 |
---|---|---|
committer | EuAndreh <eu@euandre.org> | 2025-03-30 09:38:37 -0300 |
commit | a6b4998786132a4f3614a234b9eb48102bc85e17 (patch) | |
tree | 525227ebdb490cc7d5d0a861fbf9c73961d544ae | |
parent | Makefile: Add compressed snippets files (diff) | |
download | euandre.org-a6b4998786132a4f3614a234b9eb48102bc85e17.tar.gz euandre.org-a6b4998786132a4f3614a234b9eb48102bc85e17.tar.xz |
Makefile: Use rsync(1) in "install" over cp(1) in loop
-rw-r--r-- | .gitignore | 2 | ||||
-rw-r--r-- | Makefile | 26 |
2 files changed, 15 insertions, 13 deletions
@@ -17,4 +17,6 @@ feed.xml /email.txt /baseurl.txt /expiry.txt +/install.html.txt +/install.src.txt /src/content/.well-known/ @@ -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. |