-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathmakefile
More file actions
43 lines (32 loc) · 1.23 KB
/
makefile
File metadata and controls
43 lines (32 loc) · 1.23 KB
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
33
34
35
36
37
38
39
40
41
42
43
# Define the compiler
CXX = clang++
# Define the source files
SOURCES = quail.cpp ./src/lexer.cpp ./src/externs.cpp ./src/parser.cpp ./src/logging.cpp ./src/BinopsData.cpp ./src/datatype.cpp ./src/output.cpp ./src/codegen.cpp ./src/codegen/optimizations.cpp ./src/codegen/constants.cpp ./src/codegen/other.cpp ./src/codegen/inblock.cpp ./src/codegen/BinOps.cpp ./src/codegen/functions.cpp ./src/codegen/core.cpp
# Define the object files
OBJECTS = $(SOURCES:.cpp=.o)
# Define the flags
CXXFLAGS = -O0
FINALFLAGS = -fexceptions
LDFLAGS = -Xlinker --export-dynamic
# Get flags and libraries from llvm-config
LLVM_FLAGS = `llvm-config --cxxflags`
LLVM_LDFLAGS = `llvm-config --ldflags`
LLVM_SYSTEM_LIBS = `llvm-config --system-libs`
LLVM_LIBS = `llvm-config --libs core orcjit native`
# Combine all flags and libraries
FLAGS = $(CXXFLAGS) $(LLVM_FLAGS) $(FINALFLAGS)
LIBS = $(LLVM_LDFLAGS) $(LLVM_SYSTEM_LIBS) $(LLVM_LIBS)
# Define the target executable
TARGET = Quailpiler
# Default rule
all: $(TARGET)
# Rule to build the target
$(TARGET): $(OBJECTS)
$(CXX) $(LDFLAGS) $(OBJECTS) $(LIBS) -o $(TARGET)
# Pattern rule for building object files
%.o: %.cpp
$(CXX) $(FLAGS) -c $< -o $@
# Clean rule
clean:
rm -f $(TARGET) $(OBJECTS)
.PHONY: all clean run