aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Makefile14
-rwxr-xr-xbuild.sh5
2 files changed, 14 insertions, 5 deletions
diff --git a/Makefile b/Makefile
new file mode 100644
index 0000000..85bf1ac
--- /dev/null
+++ b/Makefile
@@ -0,0 +1,14 @@
+LLVM_CXXFLAGS=`llvm-config --cppflags core jit native`
+LLVM_LDFLAGS=`llvm-config --ldflags --libs core jit native`
+
+CXXFLAGS=-O0 -g -Wall -Wextra -Wno-unused-parameter $(LLVM_CXXFLAGS)
+LDFLAGS=$(LLVM_LDFLAGS) -lm
+
+tuplr: tuplr.o typing.o tuplr_llvm.o
+ g++ -o $@ $^ $(LDFLAGS)
+
+%.o: %.cpp
+ g++ $(CXXFLAGS) -o $@ -c $<
+
+clean:
+ rm -f tuplr *.o
diff --git a/build.sh b/build.sh
deleted file mode 100755
index 66fc830..0000000
--- a/build.sh
+++ /dev/null
@@ -1,5 +0,0 @@
-#!/bin/sh
-CXXFLAGS="-O0 -g -Wall -Wextra -Wno-unused-parameter"
-
-g++ $CXXFLAGS tuplr.cpp typing.cpp tuplr_llvm.cpp `llvm-config --cppflags --ldflags --libs core jit native` -lm -o tuplr
-