Makefile 733 B

123456789101112131415161718192021222324252627
  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. %.manifest: %.manifest.template
  8. rm -rf $@
  9. cp $@.template $@
  10. ifeq ($(findstring x86_64,$(SYS))$(findstring linux,$(SYS)),x86_64linux)
  11. $(c_executables): %: %.c
  12. @echo [ $@ ]
  13. @$(CC) $(CFLAGS) $(if $(findstring .libos,$@),$(CFLAGS-libos),) -o $@ $< \
  14. $(shell echo $@ | sed 's/^[^\.]*//g' | sed 's/\./ -l/g')
  15. $(cxx_executables): %: %.cpp
  16. @echo [ $@ ]
  17. @$(CC) $(CFLAGS) -o $@ $< \
  18. $(shell echo $@ | sed 's/^[^\.]*//g' | sed 's/\./ -l/g')
  19. else
  20. .IGNORE: $(c_executables) $(cxx_executables)
  21. $(c_executables) $(cxx_executables):
  22. endif