2023-03-07 01:51:40 +01:00
|
|
|
V=20230307
|
2021-11-29 20:43:22 +01:00
|
|
|
BUILDTOOLVER ?= $(V)
|
2010-05-02 15:46:51 +02:00
|
|
|
|
2011-08-12 16:44:36 +02:00
|
|
|
PREFIX = /usr/local
|
2018-09-09 21:02:43 +02:00
|
|
|
MANDIR = $(PREFIX)/share/man
|
2022-05-18 00:35:08 +02:00
|
|
|
BUILDDIR = build
|
2011-08-12 16:44:36 +02:00
|
|
|
|
2022-05-18 02:31:26 +02:00
|
|
|
BINPROGS = $(addprefix $(BUILDDIR)/,$(patsubst src/%,bin/%,$(patsubst %.in,%,$(wildcard src/*.in))))
|
2022-08-31 23:48:29 +02:00
|
|
|
LIBUTILS = $(wildcard lib/*)
|
2022-05-18 02:24:58 +02:00
|
|
|
MAKEPKG_CONFIGS=$(wildcard config/makepkg/*)
|
|
|
|
PACMAN_CONFIGS=$(wildcard config/pacman/*)
|
|
|
|
SETARCH_ALIASES = $(wildcard config/setarch-aliases.d/*)
|
2022-06-20 01:15:34 +02:00
|
|
|
MANS = $(addprefix $(BUILDDIR)/,$(patsubst %.asciidoc,%,$(wildcard doc/man/*.asciidoc)))
|
2020-04-09 21:27:11 +02:00
|
|
|
|
2011-03-12 22:25:09 +01:00
|
|
|
COMMITPKG_LINKS = \
|
|
|
|
extrapkg \
|
|
|
|
testingpkg \
|
|
|
|
stagingpkg \
|
|
|
|
communitypkg \
|
|
|
|
community-testingpkg \
|
|
|
|
community-stagingpkg \
|
|
|
|
multilibpkg \
|
2011-12-04 17:48:46 +01:00
|
|
|
multilib-testingpkg \
|
2012-01-14 20:22:26 +01:00
|
|
|
multilib-stagingpkg \
|
2011-12-04 17:48:46 +01:00
|
|
|
kde-unstablepkg \
|
|
|
|
gnome-unstablepkg
|
2011-03-12 22:25:09 +01:00
|
|
|
|
|
|
|
ARCHBUILD_LINKS = \
|
|
|
|
extra-x86_64-build \
|
2022-01-29 01:30:35 +01:00
|
|
|
extra-x86_64_v3-build \
|
2011-03-12 22:25:09 +01:00
|
|
|
testing-x86_64-build \
|
2022-01-29 01:30:35 +01:00
|
|
|
testing-x86_64_v3-build \
|
2011-03-12 22:25:09 +01:00
|
|
|
staging-x86_64-build \
|
2022-01-29 01:30:35 +01:00
|
|
|
staging-x86_64_v3-build \
|
2011-03-12 22:25:09 +01:00
|
|
|
multilib-build \
|
2011-12-04 17:48:46 +01:00
|
|
|
multilib-testing-build \
|
2012-01-14 20:22:26 +01:00
|
|
|
multilib-staging-build \
|
2011-12-04 17:48:46 +01:00
|
|
|
kde-unstable-x86_64-build \
|
|
|
|
gnome-unstable-x86_64-build
|
2011-03-12 22:25:09 +01:00
|
|
|
|
2012-03-05 01:48:27 +01:00
|
|
|
CROSSREPOMOVE_LINKS = \
|
|
|
|
extra2community \
|
|
|
|
community2extra
|
|
|
|
|
2022-05-18 02:07:01 +02:00
|
|
|
COMPLETIONS = $(addprefix $(BUILDDIR)/,$(patsubst %.in,%,$(wildcard contrib/completion/*/*)))
|
2012-06-24 23:50:22 +02:00
|
|
|
BASHCOMPLETION_LINKS = \
|
|
|
|
archco \
|
|
|
|
communityco
|
|
|
|
|
2022-05-18 00:35:08 +02:00
|
|
|
|
|
|
|
all: binprogs completion man
|
|
|
|
binprogs: $(BINPROGS)
|
|
|
|
completion: $(COMPLETIONS)
|
2018-09-09 21:02:43 +02:00
|
|
|
man: $(MANS)
|
2011-08-29 10:53:50 +02:00
|
|
|
|
2022-05-18 02:24:58 +02:00
|
|
|
|
2022-05-18 02:31:26 +02:00
|
|
|
ifneq ($(wildcard *.in),)
|
|
|
|
$(error Legacy in prog file found: $(wildcard *.in) - please migrate to src/*)
|
|
|
|
endif
|
2022-05-18 02:24:58 +02:00
|
|
|
ifneq ($(wildcard pacman-*.conf),)
|
|
|
|
$(error Legacy pacman config file found: $(wildcard pacman-*.conf) - please migrate to config/pacman/*)
|
|
|
|
endif
|
|
|
|
ifneq ($(wildcard makepkg-*.conf),)
|
|
|
|
$(error Legacy makepkg config files found: $(wildcard makepkg-*.conf) - please migrate to config/makepkg/*)
|
|
|
|
endif
|
|
|
|
ifneq ($(wildcard setarch-aliases.d/*),)
|
|
|
|
$(error Legacy setarch aliase found: $(wildcard setarch-aliases.d/*) - please migrate to config/setarch-aliases.d/*)
|
|
|
|
endif
|
|
|
|
|
|
|
|
|
2018-10-16 00:32:03 +02:00
|
|
|
edit = sed -e "s|@pkgdatadir[@]|$(PREFIX)/share/devtools|g"
|
2022-05-21 16:46:47 +02:00
|
|
|
GEN_MSG = @echo "GEN $(patsubst $(BUILDDIR)/%,%,$@)"
|
2011-11-01 15:33:08 +01:00
|
|
|
|
2022-05-18 02:07:01 +02:00
|
|
|
define buildInScript
|
2022-08-31 23:48:29 +02:00
|
|
|
$(1)/%: $(2)%.in $(LIBUTILS)
|
2022-05-21 16:46:47 +02:00
|
|
|
$$(GEN_MSG)
|
2022-05-18 02:07:01 +02:00
|
|
|
@mkdir -p $$(dir $$@)
|
|
|
|
@$(RM) "$$@"
|
|
|
|
@{ echo -n 'm4_changequote([[[,]]])'; cat $$<; } | m4 -P --define=m4_devtools_version=$$(BUILDTOOLVER) | $(edit) >$$@
|
|
|
|
@chmod $(3) "$$@"
|
2023-01-31 09:43:15 +01:00
|
|
|
@bash -O extglob -n "$$@"
|
2022-05-18 02:07:01 +02:00
|
|
|
endef
|
|
|
|
|
2022-05-18 02:31:26 +02:00
|
|
|
$(eval $(call buildInScript,build/bin,src/,555))
|
2022-05-18 02:07:01 +02:00
|
|
|
$(foreach completion,$(wildcard contrib/completion/*),$(eval $(call buildInScript,build/$(completion),$(completion)/,444)))
|
2004-07-19 07:26:30 +02:00
|
|
|
|
2022-06-20 01:15:34 +02:00
|
|
|
$(BUILDDIR)/doc/man/%: doc/man/%.asciidoc doc/asciidoc.conf doc/man/include/footer.asciidoc
|
2022-05-21 16:46:47 +02:00
|
|
|
$(GEN_MSG)
|
2022-06-20 01:15:34 +02:00
|
|
|
@mkdir -p $(BUILDDIR)/doc/man
|
|
|
|
@a2x --no-xmllint --asciidoc-opts="-f doc/asciidoc.conf" -d manpage -f manpage --destination-dir=$(BUILDDIR)/doc/man -a pkgdatadir=$(PREFIX)/share/devtools $<
|
2018-09-09 21:02:43 +02:00
|
|
|
|
2011-08-29 10:53:51 +02:00
|
|
|
clean:
|
2022-05-18 00:35:08 +02:00
|
|
|
rm -rf $(BUILDDIR)
|
2011-08-29 10:53:51 +02:00
|
|
|
|
2022-05-18 00:45:00 +02:00
|
|
|
install: all
|
2011-08-12 16:44:36 +02:00
|
|
|
install -dm0755 $(DESTDIR)$(PREFIX)/bin
|
2020-04-09 21:27:11 +02:00
|
|
|
install -dm0755 $(DESTDIR)$(PREFIX)/share/devtools/setarch-aliases.d
|
2011-08-12 16:44:36 +02:00
|
|
|
install -m0755 ${BINPROGS} $(DESTDIR)$(PREFIX)/bin
|
2022-05-18 02:24:58 +02:00
|
|
|
for conf in ${MAKEPKG_CONFIGS}; do install -Dm0644 $$conf $(DESTDIR)$(PREFIX)/share/devtools/makepkg-$${conf##*/}; done
|
|
|
|
for conf in ${PACMAN_CONFIGS}; do install -Dm0644 $$conf $(DESTDIR)$(PREFIX)/share/devtools/pacman-$${conf##*/}; done
|
|
|
|
for a in ${SETARCH_ALIASES}; do install -m0644 $$a -t $(DESTDIR)$(PREFIX)/share/devtools/setarch-aliases.d; done
|
2011-08-12 16:44:36 +02:00
|
|
|
for l in ${COMMITPKG_LINKS}; do ln -sf commitpkg $(DESTDIR)$(PREFIX)/bin/$$l; done
|
|
|
|
for l in ${ARCHBUILD_LINKS}; do ln -sf archbuild $(DESTDIR)$(PREFIX)/bin/$$l; done
|
2012-03-05 01:48:27 +01:00
|
|
|
for l in ${CROSSREPOMOVE_LINKS}; do ln -sf crossrepomove $(DESTDIR)$(PREFIX)/bin/$$l; done
|
2011-08-08 17:58:12 +02:00
|
|
|
ln -sf find-libdeps $(DESTDIR)$(PREFIX)/bin/find-libprovides
|
2022-05-18 02:07:01 +02:00
|
|
|
install -Dm0644 $(BUILDDIR)/contrib/completion/bash/devtools $(DESTDIR)$(PREFIX)/share/bash-completion/completions/devtools
|
2022-05-17 21:02:10 +02:00
|
|
|
for l in ${BASHCOMPLETION_LINKS}; do ln -sf devtools $(DESTDIR)$(PREFIX)/share/bash-completion/completions/$$l; done
|
2022-05-18 02:07:01 +02:00
|
|
|
install -Dm0644 $(BUILDDIR)/contrib/completion/zsh/_devtools $(DESTDIR)$(PREFIX)/share/zsh/site-functions/_devtools
|
2011-08-12 16:44:36 +02:00
|
|
|
ln -sf archco $(DESTDIR)$(PREFIX)/bin/communityco
|
2018-09-09 21:02:43 +02:00
|
|
|
for manfile in $(MANS); do \
|
|
|
|
install -Dm644 $$manfile -t $(DESTDIR)$(MANDIR)/man$${manfile##*.}; \
|
|
|
|
done;
|
2007-11-28 00:54:57 +01:00
|
|
|
|
|
|
|
uninstall:
|
2022-05-18 00:35:08 +02:00
|
|
|
for f in $(notdir $(BINPROGS)); do rm -f $(DESTDIR)$(PREFIX)/bin/$$f; done
|
2022-05-18 02:24:58 +02:00
|
|
|
for conf in ${MAKEPKG_CONFIGS}; do rm -f $(DESTDIR)$(PREFIX)/share/devtools/makepkg-$${conf##*/}; done
|
|
|
|
for conf in ${PACMAN_CONFIGS}; do rm -f $(DESTDIR)$(PREFIX)/share/devtools/pacman-$${conf##*/}; done
|
|
|
|
for f in $(notdir $(SETARCH_ALIASES)); do rm -f $(DESTDIR)$(PREFIX)/share/devtools/setarch-aliases.d/$$f; done
|
2011-08-12 16:44:36 +02:00
|
|
|
for l in ${COMMITPKG_LINKS}; do rm -f $(DESTDIR)$(PREFIX)/bin/$$l; done
|
|
|
|
for l in ${ARCHBUILD_LINKS}; do rm -f $(DESTDIR)$(PREFIX)/bin/$$l; done
|
2012-03-05 01:48:27 +01:00
|
|
|
for l in ${CROSSREPOMOVE_LINKS}; do rm -f $(DESTDIR)$(PREFIX)/bin/$$l; done
|
2022-05-17 20:57:32 +02:00
|
|
|
for l in ${BASHCOMPLETION_LINKS}; do rm -f $(DESTDIR)$(PREFIX)/share/bash-completion/completions/$$l; done
|
2022-05-17 21:02:10 +02:00
|
|
|
rm $(DESTDIR)$(PREFIX)/share/bash-completion/completions/devtools
|
2011-08-25 12:50:30 +02:00
|
|
|
rm $(DESTDIR)$(PREFIX)/share/zsh/site-functions/_devtools
|
2011-08-12 16:44:36 +02:00
|
|
|
rm -f $(DESTDIR)$(PREFIX)/bin/communityco
|
2011-08-08 17:58:12 +02:00
|
|
|
rm -f $(DESTDIR)$(PREFIX)/bin/find-libprovides
|
2022-05-18 00:35:08 +02:00
|
|
|
for manfile in $(notdir $(MANS)); do rm -f $(DESTDIR)$(MANDIR)/man$${manfile##*.}/$${manfile}; done;
|
2022-05-18 02:07:01 +02:00
|
|
|
rmdir --ignore-fail-on-non-empty $(DESTDIR)$(PREFIX)/share/devtools/setarch-aliases.d $(DESTDIR)$(PREFIX)/share/devtools
|
2010-02-13 20:57:34 +01:00
|
|
|
|
2019-09-13 02:13:27 +02:00
|
|
|
TODAY=$(shell date +"%Y%m%d")
|
|
|
|
tag:
|
|
|
|
@sed -E "s|^V=[0-9]{8}|V=$(TODAY)|" -i Makefile
|
|
|
|
@git commit --gpg-sign --message "Version $(TODAY)" Makefile
|
|
|
|
@git tag --sign --message "Version $(TODAY)" $(TODAY)
|
|
|
|
|
2010-02-13 20:57:34 +01:00
|
|
|
dist:
|
2022-01-26 22:44:09 +01:00
|
|
|
git archive --format=tar --prefix=devtools-$(V)/ $(V) | gzip > devtools-$(V).tar.gz
|
2011-10-31 14:04:35 +01:00
|
|
|
gpg --detach-sign --use-agent devtools-$(V).tar.gz
|
2011-03-12 21:53:52 +01:00
|
|
|
|
2011-04-09 23:04:59 +02:00
|
|
|
upload:
|
2016-05-27 21:02:46 +02:00
|
|
|
scp devtools-$(V).tar.gz devtools-$(V).tar.gz.sig repos.archlinux.org:/srv/ftp/other/devtools/
|
2011-04-09 23:04:59 +02:00
|
|
|
|
2022-05-19 23:49:02 +02:00
|
|
|
check: $(BINPROGS) $(BUILDDIR)/contrib/completion/bash/devtools config/makepkg/x86_64.conf contrib/makepkg/PKGBUILD.proto
|
2017-05-06 00:41:06 +02:00
|
|
|
shellcheck $^
|
|
|
|
|
2022-05-18 00:35:08 +02:00
|
|
|
.PHONY: all completion man clean install uninstall dist upload check tag
|
2017-05-06 00:41:03 +02:00
|
|
|
.DELETE_ON_ERROR:
|