From 6ed25f26baf57115f8907966b0e170cef55f2a81 Mon Sep 17 00:00:00 2001 From: Kyle Meyer Date: Sun, 27 Oct 2024 14:10:34 -0400 Subject: Add initial setup --- Makefile | 43 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) create mode 100644 Makefile (limited to 'Makefile') diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..e50bbe6 --- /dev/null +++ b/Makefile @@ -0,0 +1,43 @@ +-include config.mk + +GHC_VERSION ?= 9.8.3 +img = quay.io/benz0li/ghc-musl:$(GHC_VERSION) + +annex_version := $(shell git -C git-annex describe) + +cabal_root = git-annex/dist-newstyle/build/x86_64-linux +# NB: For a non-tagged commit, annex_version will be {tag}-N-g{hash} +# while cabal will build under .../git-annex-{tag}/. That discrepancy +# doesn't matter because bin/build aborts if git-annex repo is on a +# non-tagged commit. +binary = $(cabal_root)/ghc-$(GHC_VERSION)/git-annex-$(annex_version)/build/git-annex/git-annex + +build_dir = builds/git-annex-$(annex_version) +meta_dir = meta/git-annex-$(annex_version) + +tgz = $(build_dir)-linux-amd64.tar.gz + +.PHONY: help +help: + $(info build - build $(tgz)) + $(info sign - sign $(tgz)) + @: + +.PHONY: build +build: $(tgz) + +.PHONY: sign +sign: $(tgz).asc + +$(tgz): $(binary) + ./bin/package '$(GHC_VERSION)' '$(annex_version)' + mkdir -p '$(meta_dir)' + mv git-annex/cabal.project.freeze '$(meta_dir)'/cabal.project.freeze + ./bin/check '$(annex_version)' + +$(tgz).asc: $(tgz) + gpg --armor --detach-sign '$<' + +$(binary): + $(info Building git-annex $(annex_version)) + ./bin/build '$(img)' -- cgit v1.2.3