Makefile 854 B

123456789101112131415161718192021222324252627282930313233
  1. CFLAGS-libos = -L../../../build/libos -I../../include
  2. c_executables = $(patsubst %.c,%,$(wildcard *.c))
  3. cxx_executables = $(patsubst %.cpp,%,$(wildcard *.cpp))
  4. target = $(c_executables) $(cxx_executables) \
  5. manifest pal pal_sec
  6. level = ../
  7. include ../Makefile
  8. %.manifest: %.manifest.template
  9. rm -rf $@
  10. cp $@.template $@
  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. .PHONY: pack
  21. pack: $(c_executables) $(cxx_executables)
  22. @../../../../Scripts/pack_binaries.sh test $^
  23. else
  24. $(c_executables) $(cxx_executables): .packed/test.tar.gz
  25. tar -xmozf $< $@
  26. endif