Makefile 794 B

1234567891011121314151617181920212223242526272829
  1. c_executables = $(patsubst %.c,%,$(wildcard *.c))
  2. cxx_executables = $(patsubst %.cpp,%,$(wildcard *.cpp))
  3. target = $(c_executables) $(cxx_executables) \
  4. manifest
  5. level = ../
  6. include ../Makefile
  7. CFLAGS-libos = -L../../../glibc-build/libos -I../../include
  8. %.manifest: %.manifest.template
  9. rm -rf $@
  10. cp $@.template $@
  11. ifeq ($(findstring x86_64,$(SYS))$(findstring linux,$(SYS)),x86_64linux)
  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. else
  21. .IGNORE: $(c_executables) $(cxx_executables)
  22. $(c_executables) $(cxx_executables):
  23. endif