From a515dfb3b8f8e999362db7a6b52b3104c03b750a Mon Sep 17 00:00:00 2001 From: Ian Moffett Date: Fri, 1 Nov 2024 23:46:08 -0400 Subject: Import quark sources Signed-off-by: Ian Moffett --- Makefile | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 Makefile (limited to 'Makefile') 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) -- cgit v1.2.3