Skip to content

Commit ada141d

Browse files
committed
add Makefile
1 parent 1331e9e commit ada141d

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

Makefile

+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
2+
.PHONY: clean check-nix check-git
3+
.DEFAULT_GOAL = all
4+
5+
GIT_COMMIT = $(shell git rev-parse HEAD)
6+
SOURCES = include/*.inc
7+
8+
all: check-nix check-git ${SOURCES}
9+
@echo "Starting build with git commit ID: ${GIT_COMMIT}"
10+
nix-build --argstr ref ${GIT_COMMIT}
11+
12+
clean:
13+
rm result || true
14+
15+
check-git:
16+
@command -v git > /dev/null 2>&1 || (echo "Must have git installed on your system." && exit 1)
17+
@git rev-parse HEAD >/dev/null 2>&1 || (echo "Must be running inside of a git repository." && exit 1)
18+
19+
check-nix:
20+
@command -v nix-build > /dev/null 2>&1 || (echo "Must have Nix installed on your system." && exit 1)

0 commit comments

Comments
 (0)