summaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile32
1 files changed, 32 insertions, 0 deletions
diff --git a/Makefile b/Makefile
new file mode 100644
index 0000000..b758a0a
--- /dev/null
+++ b/Makefile
@@ -0,0 +1,32 @@
+# Build configuration.
+# Copyright (c) 2023-2024, Quinn Stephens and the OSMORA team.
+# Provided under the BSD 3-Clause license.
+
+ENABLE_DEBUG = 1
+CC = clang
+LD = ld.ldd
+
+EXENAME = quarkc
+OFILES = $(addprefix compiler/,debug.o hash.o hashmap.o lexer/char_info.o lexer/keywords.o lexer/lexer.o parser/type.o parser/parser.o main.o)
+CFLAGS = -Wall -Wextra -Iinclude
+LDFLAGS =
+
+ifeq ($(ENABLE_DEBUG),1)
+CFLAGS += -DENABLE_DEBUG
+endif
+
+.PHONY: all
+all: $(EXENAME)
+
+$(EXENAME): $(OFILES)
+ @echo Linking $@...
+ @$(CC) $^ $(LDFLAGS) -o $@
+
+%.o: %.c
+ @echo Compiling $<...
+ @$(CC) -c $< $(CFLAGS) -o $@
+
+.PHONY: clean
+clean:
+ @echo Cleaning...
+ @rm -f $(OFILES)