Makefile 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  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. 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. ifeq ($(SGX_RUN),1)
  37. PYTHONENV += "TIMEOUT=5000"
  38. endif
  39. regression: $(target)
  40. @echo "\n\nBasic Bootstrapping:"
  41. @for f in $(wildcard 00_*.py); do env $(PYTHONENV) python $$f $(RUNTIME)/pal-$(PAL_HOST); done
  42. @echo "\n\nFutex Support:"
  43. @for f in $(wildcard 30_*.py); do env $(PYTHONENV) python $$f $(RUNTIME)/pal-$(PAL_HOST); done
  44. @echo "\n\nLarge File Support:"
  45. @for f in $(wildcard 90_*.py); do env $(PYTHONENV) python $$f $(RUNTIME)/pal-$(PAL_HOST); done
  46. @echo "\n\nLTP tests for system calls:"
  47. ../apps/ltp/syscalls.sh
  48. clean-tmp:
  49. rm -rf *.tmp ../apps/ltp/*.csv *.cached *.manifest.sgx *~ *.sig *.token