Makefile 879 B

1234567891011121314151617181920212223242526
  1. c_executables = $(patsubst %.c,%,$(wildcard *.c))
  2. cxx_executables = $(patsubst %.cpp,%,$(wildcard *.cpp))
  3. manifests = $(patsubst %.template,%,$(wildcard *.manifest.template)) manifest
  4. exec_target = $(c_executables) $(cxx_executables) ls.manifest
  5. target = $(exec_target) $(manifests)
  6. level = ../
  7. include ../Makefile
  8. ifeq ($(findstring x86_64,$(SYS))$(findstring linux,$(SYS)),x86_64linux)
  9. $(c_executables): %: %.c
  10. @echo [ $@ ]
  11. @$(CC) -MD -MP $(CFLAGS) $(if $(findstring .libos,$@),$(CFLAGS-libos),) -o $@ $< \
  12. $(shell echo $@ | sed 's/^[^\.]*//g' | sed 's/\./ -l/g')
  13. $(cxx_executables): %: %.cpp
  14. @echo [ $@ ]
  15. @$(CXX) -MD -MP $(CXXFLAGS) $(if $(findstring .libos,$@),$(CFLAGS-libos),) -o $@ $< \
  16. $(shell echo $@ | sed 's/^[^\.]*//g' | sed 's/\./ -l/g')
  17. include $(wildcard *.d)
  18. else
  19. .IGNORE: $(c_executables) $(cxx_executables)
  20. $(c_executables) $(cxx_executables):
  21. endif