aboutsummaryrefslogtreecommitdiffstats
path: root/Makefile
diff options
context:
space:
mode:
authoreunhhu <[email protected]>2026-09-27 13:14:46 +0100
committereunhhu <[email protected]>2026-09-27 13:14:46 +0100
commite650c341704e1b7f4c9d5a05bfa745c54002a599 (patch)
tree64125dab7281dbe0b82a65212e91359647adff18 /Makefile
parentba76d3810713bb67569114e9458416df0f78687a (diff)
downloadvega-e650c341704e1b7f4c9d5a05bfa745c54002a599.tar.gz
vega-e650c341704e1b7f4c9d5a05bfa745c54002a599.zip
Link Pure's libpure.a instead of compiling its sources
Pure builds the app model and the tree store as one library with headers in core/; Vega no longer lists Pure's files, so a new one there cannot break it.
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile17
1 files changed, 10 insertions, 7 deletions
diff --git a/Makefile b/Makefile
index d121123..9724e65 100644
--- a/Makefile
+++ b/Makefile
@@ -2,22 +2,25 @@ 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
+# Sibling checkouts: Pure runs the modules (libpure.a: the app model and the
+# tree store, headers in core/), aup builds them.
+PURE ?= ../pure
AUP ?= ../aup
+LIBPURE = $(PURE)/build/libpure.a
-PURE_SOURCES = $(PURE)/module.c $(PURE)/module-list.c $(PURE)/module-save.c $(PURE)/module-store.c \
- $(PURE)/module-text.c $(PURE)/store-tree.c
SOURCES = src/screen.c src/draw.c src/width.c src/web.c src/main.c
-.PHONY: all check
+.PHONY: all check FORCE
all: $(BUILD)/vega $(BUILD)/vega-symbols
$(BUILD):
mkdir -p $@
-$(BUILD)/vega: $(SOURCES) src/vega.h $(PURE_SOURCES) | $(BUILD)
- $(CC) $(CPPFLAGS) $(CFLAGS) -I$(PURE) $(SOURCES) $(PURE_SOURCES) $(LDFLAGS) -lm $(LDLIBS) -o $@
+$(LIBPURE): FORCE
+ $(MAKE) -C $(PURE) build/libpure.a
+
+$(BUILD)/vega: $(SOURCES) src/vega.h $(LIBPURE) | $(BUILD)
+ $(CC) $(CPPFLAGS) $(CFLAGS) -I$(PURE)/core $(SOURCES) $(LIBPURE) $(LDFLAGS) -lm $(LDLIBS) -o $@
# Building symbol files reads fonts through FreeType; reading them does not.
FREETYPE_CFLAGS ?= $(shell pkg-config --cflags freetype2)