Loading main.cpp +23 −0 Changes for main.cpp: 23 added lines, 0 removed lines. Original line number Diff line number Diff line Loading @@ -98,6 +98,29 @@ static void setup_defaults(makeplus::Makefile& mf, const char* argv0) { // later 'CFLAGS ?= -O3' in the makefile, which must still be free to set // the value -- exactly the pattern zstd's libzstd.mk relies on. set_default("ARFLAGS", "rv"); // GNU make's built-in "compile"/"link" recipe variables. Real makefiles // (zstd's lib/Makefile among them: "$(COMPILE.c) $(DEPFLAGS) // $(OUTPUT_OPTION) $<", "$(COMPILE.S) $(OUTPUT_OPTION) $<") reference // these directly rather than spelling out $(CC)/$(CFLAGS)/... themselves. // Without a definition here they silently expand to "", which is worse // than just a missing flag: the leading '-' of the next token on the // recipe line (e.g. DEPFLAGS = "-MMD -MP") then becomes the FIRST // character of the expanded command and is misparsed as the recipe's // "ignore errors" prefix -- matching real GNU make's own (surprising, but // verified against it) behavior of checking that prefix only after full // macro expansion. set_default_recursive("COMPILE.c", "$(CC) $(CFLAGS) $(CPPFLAGS) $(TARGET_ARCH) -c"); set_default_recursive("COMPILE.cc", "$(CXX) $(CXXFLAGS) $(CPPFLAGS) $(TARGET_ARCH) -c"); set_default_recursive("COMPILE.cpp", "$(COMPILE.cc)"); set_default_recursive("COMPILE.C", "$(COMPILE.cc)"); set_default_recursive("COMPILE.S", "$(CC) $(ASFLAGS) $(CPPFLAGS) $(TARGET_MACH) -c"); set_default_recursive("COMPILE.s", "$(AS) $(ASFLAGS) $(TARGET_MACH)"); set_default_recursive("LINK.o", "$(CC) $(LDFLAGS) $(TARGET_ARCH)"); set_default_recursive("LINK.c", "$(CC) $(CFLAGS) $(CPPFLAGS) $(LDFLAGS) $(TARGET_ARCH)"); set_default_recursive("LINK.cc", "$(CXX) $(CXXFLAGS) $(CPPFLAGS) $(LDFLAGS) $(TARGET_ARCH)"); set_default_recursive("LINK.cpp", "$(LINK.cc)"); set_default_recursive("LINK.C", "$(LINK.cc)"); set_default_recursive("OUTPUT_OPTION", "-o $@"); force_set("MAKE", argv0); force_set("SHELL", "/bin/sh"); force_set(".SHELLFLAGS", "-c"); Loading Loading
main.cpp +23 −0 Changes for main.cpp: 23 added lines, 0 removed lines. Original line number Diff line number Diff line Loading @@ -98,6 +98,29 @@ static void setup_defaults(makeplus::Makefile& mf, const char* argv0) { // later 'CFLAGS ?= -O3' in the makefile, which must still be free to set // the value -- exactly the pattern zstd's libzstd.mk relies on. set_default("ARFLAGS", "rv"); // GNU make's built-in "compile"/"link" recipe variables. Real makefiles // (zstd's lib/Makefile among them: "$(COMPILE.c) $(DEPFLAGS) // $(OUTPUT_OPTION) $<", "$(COMPILE.S) $(OUTPUT_OPTION) $<") reference // these directly rather than spelling out $(CC)/$(CFLAGS)/... themselves. // Without a definition here they silently expand to "", which is worse // than just a missing flag: the leading '-' of the next token on the // recipe line (e.g. DEPFLAGS = "-MMD -MP") then becomes the FIRST // character of the expanded command and is misparsed as the recipe's // "ignore errors" prefix -- matching real GNU make's own (surprising, but // verified against it) behavior of checking that prefix only after full // macro expansion. set_default_recursive("COMPILE.c", "$(CC) $(CFLAGS) $(CPPFLAGS) $(TARGET_ARCH) -c"); set_default_recursive("COMPILE.cc", "$(CXX) $(CXXFLAGS) $(CPPFLAGS) $(TARGET_ARCH) -c"); set_default_recursive("COMPILE.cpp", "$(COMPILE.cc)"); set_default_recursive("COMPILE.C", "$(COMPILE.cc)"); set_default_recursive("COMPILE.S", "$(CC) $(ASFLAGS) $(CPPFLAGS) $(TARGET_MACH) -c"); set_default_recursive("COMPILE.s", "$(AS) $(ASFLAGS) $(TARGET_MACH)"); set_default_recursive("LINK.o", "$(CC) $(LDFLAGS) $(TARGET_ARCH)"); set_default_recursive("LINK.c", "$(CC) $(CFLAGS) $(CPPFLAGS) $(LDFLAGS) $(TARGET_ARCH)"); set_default_recursive("LINK.cc", "$(CXX) $(CXXFLAGS) $(CPPFLAGS) $(LDFLAGS) $(TARGET_ARCH)"); set_default_recursive("LINK.cpp", "$(LINK.cc)"); set_default_recursive("LINK.C", "$(LINK.cc)"); set_default_recursive("OUTPUT_OPTION", "-o $@"); force_set("MAKE", argv0); force_set("SHELL", "/bin/sh"); force_set(".SHELLFLAGS", "-c"); Loading