aboutsummaryrefslogtreecommitdiffstats
path: root/Makefile
blob: caa1558868f9546dddc41565b3d42056ffa29783 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
CXXFILES := main.cpp parser.cpp llvm.cpp ast.cpp var.cpp
CXXFLAGS := `llvm-config --cxxflags` -std=c++20 -ggdb -O0 -g3
LDFLAGS := `llvm-config --ldflags --system-libs --libs core`

all: main

main: $(subst .cpp,.o,$(CXXFILES))
	$(CXX) -o $@ $^ $(CXXFLAGS) $(LDFLAGS)

prog: main test.fp
	./main < test.fp > forsp.ir
	llc -march=x86 -filetype=obj --relocation-model=pic forsp.ir -O1
	clang -c support.c -m32 -Os
	clang support.o forsp.ir.o -m32 -Os

clean:
	rm -f a.out main *.ir *.o