Makefile 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  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 pal pal_sec
  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. regression: $(target)
  37. @echo "\n\nBasic Bootstrapping:"
  38. @for f in $(wildcard 00_*.py); do env $(PYTHONENV) python $$f; done
  39. @echo "\n\nLarge File Support:"
  40. @for f in $(wildcard 90_*.py); do env $(PYTHONENV) python $$f; done
  41. @echo "\n\nLTP tests for system calls:"
  42. ../apps/ltp/syscalls.sh
  43. clean-tmp:
  44. rm -rf *.tmp ../apps/ltp/*.csv