Makefile 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. CFLAGS-libos = -L../../../build/libos -I../../include
  2. special_executables = bootstrap_static bootstrap_pie
  3. c_executables = $(filter-out $(special_executables),$(patsubst %.c,%,$(wildcard *.c)))
  4. cxx_executables = $(patsubst %.cpp,%,$(wildcard *.cpp))
  5. exec_target = $(special_executables) $(c_executables) $(cxx_executables)
  6. target = $(exec_target) manifest pal pal_sec
  7. clean-extra += clean-tmp
  8. default: all
  9. level = ../
  10. include ../Makefile
  11. ifeq ($(SYS),x86_64-linux-gnu)
  12. $(c_executables): %: %.c
  13. @echo [ $@ ]
  14. @$(CC) $(CFLAGS) $(if $(findstring .libos,$@),$(CFLAGS-libos),) -o $@ $< \
  15. $(shell echo $@ | sed 's/^[^\.]*//g' | sed 's/\./ -l/g')
  16. $(cxx_executables): %: %.cpp
  17. @echo [ $@ ]
  18. @$(CC) $(CFLAGS) -o $@ $< \
  19. $(shell echo $@ | sed 's/^[^\.]*//g' | sed 's/\./ -l/g')
  20. bootstrap_static: %: %.c
  21. @echo [ $@ ]
  22. @$(CC) $(CFLAGS) -o $@ -static $< \
  23. $(shell echo $@ | sed 's/^[^\.]*//g' | sed 's/\./ -l/g')
  24. bootstrap_pie: %: %.c
  25. @echo [ $@ ]
  26. @$(CC) $(CFLAGS) -fPIC --pie -o $@ $< \
  27. $(shell echo $@ | sed 's/^[^\.]*//g' | sed 's/\./ -l/g')
  28. .PHONY: pack
  29. pack: $(special_executables) $(c_executables) $(cxx_executables)
  30. @../../../../Scripts/pack_binaries.sh test $^
  31. else
  32. $(special_executables) $(c_executables) $(cxx_executables): .packed/test.tar.gz
  33. tar -xmozf $< $@
  34. endif
  35. PYTHONENV="PYTHONPATH=../../../../Scripts"
  36. regression: $(target)
  37. @echo "\n\nBasic Bootstrapping:"
  38. @for f in $(wildcard 00_*.py); do env $(PYTHONENV) python $$f; done
  39. @echo "\n\nLarge File Support:"
  40. @for f in $(wildcard 90_*.py); do env $(PYTHONENV) python $$f; done
  41. @echo "\n\n"
  42. clean-tmp:
  43. rm -rf *.tmp