Makefile 1.5 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. target = $(special_executables) $(c_executables) $(cxx_executables) \
  6. manifest pal pal_sec
  7. clean-extra += clean-tmp
  8. level = ../
  9. include ../Makefile
  10. %.manifest: %.manifest.template
  11. rm -rf $@
  12. cp $@.template $@
  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. .PHONY: pack
  31. pack: $(special_executables) $(c_executables) $(cxx_executables)
  32. tar -czf .packed/test.tar.gz $^
  33. else
  34. $(special_executables) $(c_executables) $(cxx_executables): .packed/test.tar.gz
  35. tar -xmozf $<
  36. endif
  37. PYTHONENV="PYTHONPATH=../../../../Scripts"
  38. regression: $(target)
  39. @echo "\n\nBasic Bootstrapping:"
  40. @for f in $(wildcard 00_*.py); do env $(PYTHONENV) python $$f; done
  41. @echo "\n\n"
  42. clean-tmp:
  43. rm -rf *.tmp