aboutsummaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorDavid Moc <personal@cdatgoose.org>2026-05-30 21:53:05 +0200
committerDavid Moc <personal@cdatgoose.org>2026-05-30 21:53:05 +0200
commite930cc6bdc7f62befac063d7d9d016ffb0a64f1a (patch)
tree52118a1e990ae88f5f0410c8caea129609e22e19 /Makefile
Added the old repo, refactored it, added the C jit.
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile31
1 files changed, 31 insertions, 0 deletions
diff --git a/Makefile b/Makefile
new file mode 100644
index 0000000..1b15d60
--- /dev/null
+++ b/Makefile
@@ -0,0 +1,31 @@
+CC = clang
+
+STATIC_LIB = include/libccdjit.a
+SHARED_LIB = include/libccdjit.so
+
+SRC = src/main.c src/app.c src/render.c src/font.c src/util.c src/buffers.c src/ecex.c src/config.c src/eval.c
+BIN = bin/ecex
+
+PKG_CFLAGS = $(shell pkg-config --cflags glfw3)
+PKG_LIBS = $(shell pkg-config --libs glfw3)
+
+CFLAGS = -std=c11 -Wall -Wextra -pedantic -Iinclude $(PKG_CFLAGS)
+LDLIBS = $(PKG_LIBS) -lGL -lm
+
+.PHONY: all static shared clean run
+
+all: static
+
+static: $(SRC) $(STATIC_LIB)
+ @mkdir -p bin
+ $(CC) $(CFLAGS) $(SRC) $(STATIC_LIB) -o $(BIN) $(LDLIBS)
+
+shared: $(SRC) $(SHARED_LIB)
+ @mkdir -p bin
+ $(CC) $(CFLAGS) $(SRC) -Linclude -lccdjit -o $(BIN) $(LDLIBS)
+
+run: static
+ LD_LIBRARY_PATH=include ./$(BIN)
+
+clean:
+ rm -f $(BIN)