22 lines
499 B
Makefile
22 lines
499 B
Makefile
.DEFAULT_GOAL := check
|
|
|
|
ZIRAN ?= ziran
|
|
CC ?= cc
|
|
BUILD := build
|
|
|
|
.PHONY: check test clean
|
|
|
|
# Checks the package, then builds and runs the tests as C.
|
|
check: test
|
|
|
|
test:
|
|
$(ZIRAN) check --project --locked
|
|
$(ZIRAN) build --project --locked --target=c --entry git_test:main \
|
|
-o $(BUILD)/test-c tests/git_test.zi
|
|
$(CC) -std=c99 -pedantic-errors -I$$($(ZIRAN) pkg path ziran --locked)/include \
|
|
-I$(BUILD)/test-c $(BUILD)/test-c/*.c -o $(BUILD)/git-test
|
|
$(BUILD)/git-test
|
|
|
|
clean:
|
|
rm -rf $(BUILD)
|