summaryrefslogtreecommitdiff
path: root/Makefile
blob: 936323904f69fd5a660d5466f2101d81700b0946 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
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/stmt.o parser/proc.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)