Makefile 2.2 KB

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