PageRenderTime 4ms CodeModel.GetById 1ms app.highlight 2ms RepoModel.GetById 1ms app.codeStats 0ms

/src/wrappers/llvm/examples/plain/Makefile

http://github.com/tybor/Liberty
Makefile | 28 lines | 19 code | 8 blank | 1 comment | 0 complexity | 3ab9441ae6d7e1ea432c09c864f201dd MD5 | raw file
 1## A crude Makefile to compile Smart/Liberty Eiffel programs using LLVM , because it requires C++ linkage even if Eiffel is usually lowered/compiled to C.
 2
 3
 4example: example.s
 5	@echo "Assembling to executable; 'as example.s -o example' produces a relocatable; when this example were written llvm tools - even experimantal - do not provide an assembler that produces executables."
 6	gcc -o example example.s
 7	@echo Running the generated executable.
 8	./example
 9
10example.s: example.bc
11	@echo Compiling bytecode into assembly
12	llc example.bc
13
14example.bc: llvm_example
15	@echo Running Liberty application, outputting bytecode
16	./llvm_example >example.bc
17
18llvm_example: llvm_example.e
19	@echo "Building the Liberty application \nNote: the warning suppression flag '-w' is used because generated low level code does not interact well with C const"
20	compile_to_c -no-split -all-check llvm_example 
21	gcc -w `llvm-config --cflags` -c llvm_example.c
22	g++ -Xlinker --no-as-needed llvm_example.o -o llvm_example `llvm-config --libs --ldflags core bitwriter` 
23
24clean:
25	clean llvm_example
26	rm *.c *.o llvm_example example example.bc example.s
27	
28