aboutsummaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
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)