/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. example: example.s
  3. @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."
  4. gcc -o example example.s
  5. @echo Running the generated executable.
  6. ./example
  7. example.s: example.bc
  8. @echo Compiling bytecode into assembly
  9. llc example.bc
  10. example.bc: llvm_example
  11. @echo Running Liberty application, outputting bytecode
  12. ./llvm_example >example.bc
  13. llvm_example: llvm_example.e
  14. @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"
  15. compile_to_c -no-split -all-check llvm_example
  16. gcc -w `llvm-config --cflags` -c llvm_example.c
  17. g++ -Xlinker --no-as-needed llvm_example.o -o llvm_example `llvm-config --libs --ldflags core bitwriter`
  18. clean:
  19. clean llvm_example
  20. rm *.c *.o llvm_example example example.bc example.s