Makefile 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. c_executables = $(patsubst %.c,%,$(wildcard *.c))
  2. cxx_executables = $(patsubst %.cpp,%,$(wildcard *.cpp))
  3. manifests = $(patsubst %.manifest.template,%.manifest,$(wildcard *.manifest.template)) manifest
  4. exec_target = $(c_executables) $(cxx_executables) file_check_policy_strict.manifest file_check_policy_allow_all_but_log.manifest
  5. target = $(exec_target) $(manifests)
  6. clean-extra += clean-tmp
  7. .PHONY: default
  8. default: all
  9. include ../../../../Scripts/Makefile.configs
  10. include ../../../../Scripts/Makefile.manifest
  11. include ../../../../Scripts/Makefile.Test
  12. ifeq ($(findstring x86_64,$(SYS))$(findstring linux,$(SYS)),x86_64linux)
  13. CFLAGS-bootstrap_static = -static
  14. CFLAGS-bootstrap_pie = -fPIC -pie
  15. CFLAGS-shared_object = -fPIC -pie
  16. CFLAGS-syscall += -I$(PALDIR)/../include -I$(PALDIR)/host/$(PAL_HOST)
  17. CFLAGS-openmp = -fopenmp
  18. CFLAGS-multi_pthread = -pthread
  19. CFLAGS-exit_group = -pthread
  20. CFLAGS-abort_multithread = -pthread
  21. CFLAGS-eventfd = -pthread
  22. CFLAGS-futex_bitset = -pthread
  23. CFLAGS-futex_requeue = -pthread
  24. CFLAGS-futex_wake_op = -pthread
  25. CFLAGS-spinlock += -I$(PALDIR)/../lib -pthread
  26. CFLAGS-sigprocmask += -pthread
  27. %: %.c
  28. $(call cmd,csingle)
  29. %: %.cpp
  30. $(call cmd,cxxsingle)
  31. else
  32. .IGNORE: $(c_executables) $(cxx_executables)
  33. $(c_executables) $(cxx_executables):
  34. endif
  35. export PAL_LOADER = $(RUNTIME)/pal-$(PAL_HOST)
  36. export PYTHONPATH=../../../../Scripts
  37. .PHONY: regression
  38. regression: $(target)
  39. $(RM) libos-regression.xml
  40. $(MAKE) libos-regression.xml
  41. libos-regression.xml: test_libos.py $(call expand_target_to_token,$(target))
  42. python3 -m pytest --junit-xml $@ -v $<
  43. .PHONY: clean-tmp
  44. clean-tmp:
  45. rm -rf *.tmp *.cached *.manifest.sgx *~ *.sig *.token .cache __pycache__ libos-regression.xml testfile tmp/*