Makefile 1.0 KB

123456789101112131415161718192021222324252627282930
  1. c_executables = $(patsubst %.c,%,$(wildcard *.c))
  2. cxx_executables = $(patsubst %.cpp,%,$(wildcard *.cpp))
  3. exec_target = $(c_executables) $(cxx_executables)
  4. target = $(c_executables) $(cxx_executables) manifest
  5. .PHONY: default
  6. default: all
  7. include ../Makefile.Test
  8. $(PALDIR)/user_start.o: $(PALDIR)/user_start.S
  9. $(MAKE) -C $(PALDIR) $(notdir $@)
  10. ifeq ($(findstring x86_64,$(SYS))$(findstring linux,$(SYS)),x86_64linux)
  11. LDLIBS-c_executables = $(libs) $(PALDIR)/user_start.o
  12. $(c_executables): CFLAGS += $(CFLAGS-libos-debug)
  13. $(c_executables): LDLIBS += $(LDLIBS-c_executables) $(LDFLAGS-libos-debug)
  14. $(c_executables): %: %.c $(LDLIBS-c_executables)
  15. $(call cmd,csingle)
  16. LDLIBS-cxx_executables = $(libs) ../../../../Pal/src/user_start.o
  17. $(cxx_executables): CXXFLAGS += $(CXXFLAGS-libos-debug)
  18. $(cxx_executables): LDLIBS += $(LDLIBS-cxx_executables) $(LDFLAGS-libos-debug)
  19. $(cxx_executables): %: %.cpp $(LDLIBS-cxx_executables)
  20. $(call cmd,cxxsingle)
  21. else
  22. .IGNORE: $(c_executables) $(cxx_executables)
  23. $(c_executables) $(cxx_executables):
  24. endif