Makefile 2.0 KB

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