summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Makefile.am36
1 files changed, 15 insertions, 21 deletions
diff --git a/Makefile.am b/Makefile.am
index 2ee1be6a83b..4388c75e5b5 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -1269,42 +1269,36 @@ cuirass-jobs: $(GOBJECTS)
1269.PHONY: clean-go make-go as-derivation 1269.PHONY: clean-go make-go as-derivation
1270.PHONY: update-guix-package update-NEWS cuirass-jobs release 1270.PHONY: update-guix-package update-NEWS cuirass-jobs release
1271 1271
1272if in_git_p
1272# Git auto-configuration. 1273# Git auto-configuration.
1273.git/hooks/: 1274GIT_HOOKS_DIR := $(shell git rev-parse --git-path hooks)
1274 $(AM_V_at)if test -d .git; then \ 1275GIT_CONFIG_FILE := $(shell git rev-parse --git-path config)
1275 mkdir "$@"; \ 1276$(GIT_HOOKS_DIR):
1276 fi 1277 mkdir -p "$@"
1277 1278
1278.git/hooks/%: etc/git/% | .git/hooks/ 1279$(GIT_HOOKS_DIR)/%: etc/git/% | $(GIT_HOOKS_DIR)/
1279 $(AM_V_at)if test -d .git; then \ 1280 cp "$<" "$@"
1280 cp "$<" "$@"; \
1281 fi
1282 1281
1283.git/config: etc/git/gitconfig 1282$(GIT_CONFIG_FILE): etc/git/gitconfig
1284 $(AM_V_at)if command -v git >/dev/null && test -d .git; then \
1285 git config --fixed-value --replace-all include.path \ 1283 git config --fixed-value --replace-all include.path \
1286 ../etc/git/gitconfig ../etc/git/gitconfig; \ 1284 ../etc/git/gitconfig ../etc/git/gitconfig
1287 fi
1288 1285
1289COMMIT_MSG_MAGIC = VGhpcyBpcyB0aGUgY29tbWl0LW1zZyBob29rIG9mIEd1aXg= 1286COMMIT_MSG_MAGIC = VGhpcyBpcyB0aGUgY29tbWl0LW1zZyBob29rIG9mIEd1aXg=
1290.git/hooks/commit-msg: etc/git/commit-msg | .git/hooks/ 1287$(GIT_HOOKS_DIR)/commit-msg: etc/git/commit-msg | $(GIT_HOOKS_DIR)
1291 $(AM_V_at)if test -d .git; then \
1292 if test -f $@ && ! grep -qF $(COMMIT_MSG_MAGIC) $@; then \ 1288 if test -f $@ && ! grep -qF $(COMMIT_MSG_MAGIC) $@; then \
1293 mkdir -p $@.d && mv $@ $@.d && \ 1289 mkdir -p $@.d && mv $@ $@.d && \
1294 @ echo user commit-msg hook moved to $@.d/commit-msg; \ 1290 @ echo user commit-msg hook moved to $@.d/commit-msg; \
1295 fi; \ 1291 fi; \
1296 cp etc/git/commit-msg $@; \ 1292 cp etc/git/commit-msg $@
1297 fi
1298 1293
1299# The etc/git/ config files are not distributed and have no use when building 1294# The etc/git/ config files are not distributed and have no use when building
1300# from a tarball. Do not add dependencies on these to *_DATA when building 1295# from a tarball. Do not add dependencies on these to *_DATA when building
1301# from a tarball, as that breaks the build. 1296# from a tarball, as that breaks the build.
1302if in_git_p
1303nodist_noinst_DATA = \ 1297nodist_noinst_DATA = \
1304 .git/hooks/pre-push \ 1298 $(GIT_HOOKS_DIR)/pre-push \
1305 .git/hooks/post-merge \ 1299 $(GIT_HOOKS_DIR)/post-merge \
1306 .git/config \ 1300 $(GIT_CONFIG_FILE) \
1307 .git/hooks/commit-msg 1301 $(GIT_HOOKS_DIR)/commit-msg
1308endif 1302endif
1309 1303
1310# Downloading up-to-date PO files. 1304# Downloading up-to-date PO files.