Makefile 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  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
  7. clean-extra += clean-tmp
  8. .PHONY: default
  9. default: all
  10. level = ../
  11. include ../Makefile
  12. ifeq ($(SYS),x86_64-linux-gnu)
  13. $(c_executables): %: %.c
  14. @echo [ $@ ]
  15. @$(CC) $(CFLAGS) $(if $(findstring .libos,$@),$(CFLAGS-libos),) -o $@ $< \
  16. $(shell echo $@ | sed 's/^[^\.]*//g' | sed 's/\./ -l/g')
  17. $(cxx_executables): %: %.cpp
  18. @echo [ $@ ]
  19. @$(CC) $(CFLAGS) -o $@ $< \
  20. $(shell echo $@ | sed 's/^[^\.]*//g' | sed 's/\./ -l/g')
  21. bootstrap_static: %: %.c
  22. @echo [ $@ ]
  23. @$(CC) $(CFLAGS) -o $@ -static $< \
  24. $(shell echo $@ | sed 's/^[^\.]*//g' | sed 's/\./ -l/g')
  25. bootstrap_pie: %: %.c
  26. @echo [ $@ ]
  27. @$(CC) $(CFLAGS) -fPIC --pie -o $@ $< \
  28. $(shell echo $@ | sed 's/^[^\.]*//g' | sed 's/\./ -l/g')
  29. .PHONY: pack
  30. pack: $(special_executables) $(c_executables) $(cxx_executables)
  31. @../../../../Scripts/pack_binaries.sh test $^
  32. else
  33. $(special_executables) $(c_executables) $(cxx_executables): .packed/test.tar.gz
  34. tar -xmozf $< $@
  35. endif
  36. PYTHONENV="PYTHONPATH=../../../../Scripts"
  37. ifeq ($(SGX_RUN),1)
  38. PYTHONENV += "TIMEOUT=5000"
  39. endif
  40. .PHONY: regression
  41. regression: $(target)
  42. @echo "\n\nBasic Bootstrapping:"
  43. @for f in $(wildcard 00_*.py); do env $(PYTHONENV) python $$f $(RUNTIME)/pal-$(PAL_HOST); done
  44. @echo "\n\nFutex Support:"
  45. @for f in $(wildcard 30_*.py); do env $(PYTHONENV) python $$f $(RUNTIME)/pal-$(PAL_HOST); done
  46. @echo "\n\nLarge File Support:"
  47. @for f in $(wildcard 90_*.py); do env $(PYTHONENV) python $$f $(RUNTIME)/pal-$(PAL_HOST); done
  48. .PHONY: clean-tmp
  49. clean-tmp:
  50. rm -rf *.tmp ../apps/ltp/*.csv *.cached *.manifest.sgx *~ *.sig *.token