3 **A make·file for syncing.**
5 👥📤 Yseme is an implementation of the sync process described in my
6 blogpost [<cite>C·I pipelines have you down? Why not ‹ touch
7 .grass ›?!</cite>][touch_grass].
8 It is intended to be included in projects as a Git submodule, and
9 recursively called from within another make·file.
12 👥📤 Yseme requires functionality present in G·N·U Make 3.81 (or
13 later) and will not work in previous versions, or other
14 implementations of Make.
15 Compatibility with later versions of G·N·U Make is assumed, but not
20 <i>Yseme</i> combines two archaic English terms: <i>y‐</i> (indicating
21 togetherness or wholeness) and <i>seme</i> (< Old Norse <i>sǿmr</i>,
22 meaning “seemly”, “appropriate”, or “beautiful”).
26 `make dry-sync` will ensure that the current repository is clean,
27 built, and up‐to‐date, and then perform a dry run (`--dry-run`) of
29 `make sync` will perform the same checks, then push any new commits and
30 perform an actual run of R·Sync.
32 👥📤 Yseme is intended to be called recursively from with·in another
34 The following is a sample make·file which makes use of 👥📤 Yseme :—
39 # © 2024 Lady [@ Lady’s Computer].
41 # This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
42 # If a copy of the M·P·L was not distributed with this file, You can obtain one at <https://mozilla.org/MPL/2.0/>.
44 # Assume 👥📤 Yseme is a git submodule located at <.yseme> in the
47 YSEMEVARS := DESTDIR='public'
49 # Build script (substitute with your own).
51 if [ ! -d public ]; then mkdir public; fi
52 echo 'Hello, world!' > public/index
55 # Set up the 👥📤 Yseme submodule.
57 git submodule update --init $(YSEME)
59 # Reload this make·file if the 👥📤 Yseme make·file has changed.
60 # (Replace `GNUmakefile´ with whatever your make·file is called.)
62 # This is required to ensure the correct value of the `YSEME_TARGETS´ variable.
64 # See <https://www.gnu.org/software/make/manual/html_node/Remaking-Makefiles.html>.
65 GNUmakefile: $(YSEME)/GNUmakefile
68 # Ensure the 👥📤 Yseme make·file exists before running the following commands.
69 ifneq ($(wildcard $(YSEME)/GNUmakefile),)
70 # Programmatically get the list of phony targets defined by 👥📤 Yseme.
71 # You can also list these manually (e·g `sync´, `dry-sync´).
72 YSEME_TARGETS := $(shell sed '/^\.PHONY[ :]/!d;/^\.PHONY[ :]/s/ *;.*//;/^\.PHONY[ :]/s/\.PHONY.*: *//' < $(YSEME)/GNUmakefile)
74 # For each target defined by 👥📤 Yseme, forward it appropriately.
76 $(MAKE) -f $(YSEME)/GNUmakefile $@ $(YSEMEVARS)
80 👥📤 Yseme was designed and tested with G·N·U Make 3.81.
81 It likely works with newer versions of Make, but may break in older
84 ## Setup and Configuration
86 👥📤 Yseme depends on the following programs to run.
87 In every case, you may supply your own implementation by overriding the
88 corresponding (allcaps) variable (e·g, set `RSYNC` to supply your own
89 `rsync` implementation).
94 - `rsync` (version 3.0 or later)
98 The following varibales provide general configuration :—
101 A file whose timestamp is guaranteed to be updated on every build
103 👥📤 Yseme will compare the modified time of this file to the commit
104 time of the latest commit to determine if the build is out·of·date.
107 The directory which contains the result of the build.
108 `rsync` will be called from this directory.
110 The following variables configure Git :—
113 If this variable has a value, the current branch does not need to be
114 up·to·date with its remote counterpart and a force‐push will be
115 used (default: empty).
118 Options to pass to Git (default: empty).
120 The following variables configuer R·Sync :—
122 - **`CLIENTCHARSET`:**
123 The character set of the local machine (default: `utf-8-mac`).
124 If both this and `SERVERCHARSET` are set and not equal, an appropriate
125 `--iconv` option will be added to the R·Sync call.
128 The location (relative to the working directory) of an R·Sync filter
129 file (default: `.rsync-filter` if such a file exists; otherwise,
133 Option to use when calling R·Sync.
134 The following flags are set by default :—
135 `--checksum`, `--compress`, `--del`, `--links`, `--omit-dir-times`,
136 `--prune-empty-dirs`, `--recursive`, `--times`, `--verbose`.
137 Additional flags may be set depending on the values of variables and
138 which target is being built (e·g `dry-sync` 🆚 `sync`).
141 The remote machine to sync to (default: `computer`).
143 - **`SERVERCHARSET`:**
144 The character set of the remote machine (default: `utf-8`).
145 If both this and `CLIENTCHARSET` are set and not equal, an appropriate
146 `--iconv` option will be added to the R·Sync call.
149 The path on the remote machine to sync to (default: the name of the
152 If you use a method of syncing your website other than `rsync`, you can
154 Just define your own `sync` and `dry-sync` targets which depend on
155 👥📤 Yseme’s `ensure-clean`, `ensure-branch-up-to-date`, and
158 [touch_grass]: <https://blog.ladys.computer/2023-05-06/touch_grass/> "C·I pipelines have you down? Why not ‹ touch .grass ›?!"