summaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorIan Moffett <ian@osmora.org>2024-11-01 23:46:08 -0400
committerIan Moffett <ian@osmora.org>2024-11-01 23:46:08 -0400
commita515dfb3b8f8e999362db7a6b52b3104c03b750a (patch)
treed0180f0cbc39d9c3e367af30791ad774e4d419ff /Makefile
Import quark sources
Signed-off-by: Ian Moffett <ian@osmora.org>
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)