blob: 41cc56b79663cd63309025b8854f182dc98551fc (
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
33
34
35
36
37
38
39
40
|
ortho_srcdir=..
GNAT_FLAGS=-gnaty3befhkmr -gnata -gnatf -gnatwael -gnat05
CLANGXX=clang++
LLVM_CONFIG=llvm-config
GNATMAKE=gnatmake
SED=sed
BE=llvm-nodebug
all: $(ortho_exec)
$(ortho_exec): $(ortho_srcdir)/llvm-nodebug/ortho_llvm.ads force llvm-cbindings.o ortho_code_main.adb
$(GNATMAKE) -o $@ -aI$(ortho_srcdir)/llvm-nodebug -aI$(ortho_srcdir) \
$(GNAT_FLAGS) ortho_code_main -bargs -E \
-largs llvm-cbindings.o --LINK=$(CLANGXX) \
`$(LLVM_CONFIG) --ldflags --libs --system-libs` $(LDFLAGS)
llvm-cbindings.o: $(ortho_srcdir)/llvm-nodebug/llvm-cbindings.cpp
$(CLANGXX) -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
|