aboutsummaryrefslogtreecommitdiffstats
path: root/src/ortho/llvm6/Makefile
blob: 31f25c9faa4b37e013d9fc9c85fd99afcefb8f91 (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
ortho_srcdir=..
GNATFLAGS=-gnaty3befhkmr -gnata -gnatf -gnatwael
CXX=clang++
LLVM_CONFIG=llvm-config
GNATMAKE=gnatmake
SED=sed
BE=llvm6

LLVM_LDFLAGS=$(LLVM_CONFIG) --ldflags --libs --system-libs

all: $(ortho_exec)

$(ortho_exec): $(ortho_srcdir)/llvm6/ortho_llvm.ads force llvm-cbindings.o
	$(GNATMAKE) -o $@ -aI$(ortho_srcdir)/llvm6 -aI$(ortho_srcdir) \
	$(GNATFLAGS) ortho_code_main -bargs -E \
	-largs llvm-cbindings.o --LINK=$(CXX) \
	$(LDFLAGS) `$(LLVM_LDFLAGS)`

llvm-cbindings.o: $(ortho_srcdir)/llvm6/llvm-cbindings.cpp
	$(CXX) -c `$(LLVM_CONFIG) --cxxflags` $(CFLAGS) -o $@ $<

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