Skip to content

Commit

Permalink
add Makefile
Browse files Browse the repository at this point in the history
  • Loading branch information
apoelstra committed Jun 3, 2024
1 parent 1331e9e commit ada141d
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@

.PHONY: clean check-nix check-git
.DEFAULT_GOAL = all

GIT_COMMIT = $(shell git rev-parse HEAD)
SOURCES = include/*.inc

all: check-nix check-git ${SOURCES}
@echo "Starting build with git commit ID: ${GIT_COMMIT}"
nix-build --argstr ref ${GIT_COMMIT}

clean:
rm result || true

check-git:
@command -v git > /dev/null 2>&1 || (echo "Must have git installed on your system." && exit 1)
@git rev-parse HEAD >/dev/null 2>&1 || (echo "Must be running inside of a git repository." && exit 1)

check-nix:
@command -v nix-build > /dev/null 2>&1 || (echo "Must have Nix installed on your system." && exit 1)

0 comments on commit ada141d

Please sign in to comment.