aboutsummaryrefslogtreecommitdiffstats
path: root/Makefile
blob: 9b15accea4b317fb612869928a42f79ba9b1a5fa (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
CC ?= cc
CFLAGS ?= -O2 -g
CFLAGS += -std=c17 -Wall -Wextra -Wpedantic -Werror
BUILD ?= build
# Sibling checkouts: Pure runs the modules, aup builds them.
PURE ?= ../pure/prototypes/connections
AUP ?= ../aup

PURE_SOURCES = $(PURE)/module.c $(PURE)/module-list.c $(PURE)/module-text.c $(PURE)/store-tree.c
SOURCES = src/screen.c src/draw.c src/width.c src/main.c

.PHONY: all check
all: $(BUILD)/vega

$(BUILD):
	mkdir -p $@

$(BUILD)/vega: $(SOURCES) src/vega.h $(PURE_SOURCES) | $(BUILD)
	$(CC) $(CPPFLAGS) $(CFLAGS) -I$(PURE) $(SOURCES) $(PURE_SOURCES) $(LDFLAGS) -lm $(LDLIBS) -o $@

check: $(BUILD)/vega
	$(MAKE) -C $(AUP) build/aup
	python3 tests/check.py --vega $(BUILD)/vega --aup $(AUP)/build/aup