aboutsummaryrefslogtreecommitdiffstats
path: root/src/ortho/llvm4-nodebug/Makefile
diff options
context:
space:
mode:
Diffstat (limited to 'src/ortho/llvm4-nodebug/Makefile')
-rw-r--r--src/ortho/llvm4-nodebug/Makefile40
1 files changed, 40 insertions, 0 deletions
diff --git a/src/ortho/llvm4-nodebug/Makefile b/src/ortho/llvm4-nodebug/Makefile
new file mode 100644
index 000000000..3868566f4
--- /dev/null
+++ b/src/ortho/llvm4-nodebug/Makefile
@@ -0,0 +1,40 @@
+ortho_srcdir=..
+GNAT_FLAGS=-gnaty3befhkmr -gnata -gnatf -gnatwael -gnat05
+CXX=clang++
+LLVM_CONFIG=llvm-config
+GNATMAKE=gnatmake
+SED=sed
+BE=llvm4-nodebug
+
+all: $(ortho_exec)
+
+$(ortho_exec): $(ortho_srcdir)/llvm4-nodebug/ortho_llvm.ads force llvm-cbindings.o ortho_code_main.adb
+ $(GNATMAKE) -o $@ -aI$(ortho_srcdir)/llvm4-nodebug -aI$(ortho_srcdir) \
+ $(GNAT_FLAGS) ortho_code_main -bargs -E \
+ -largs llvm-cbindings.o --LINK=$(CXX) \
+ $(LDFLAGS) `$(LLVM_CONFIG) --ldflags --libs --system-libs`
+
+llvm-cbindings.o: $(ortho_srcdir)/llvm4-nodebug/llvm-cbindings.cpp
+ $(CXX) -c `$(LLVM_CONFIG) --cxxflags` -o $@ $<
+
+ortho_code_main.adb:
+ echo "with Ortho_Code_Main$(llvm_be_ver);" > ortho_code_main.tmp
+ echo "procedure Ortho_Code_Main is" >> ortho_code_main.tmp
+ echo "begin" >> ortho_code_main.tmp
+ echo " Ortho_Code_Main$(llvm_be_ver);" >> ortho_code_main.tmp
+ echo "end Ortho_Code_Main;" >> ortho_code_main.tmp
+ mv ortho_code_main.tmp $@
+
+clean:
+ $(RM) -f *.o *.ali ortho_code_main
+ $(RM) b~*.ad? *~
+
+distclean: clean
+
+
+force:
+
+.PHONY: force all clean
+
+ORTHO_BASENAME=ortho_llvm
+include $(ortho_srcdir)/Makefile.inc