patch-src_Makefile 2.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  1. $Id: update-patches 24 2008-08-31 14:56:13Z wbx $
  2. --- mrd6-0.9.6.orig/src/Makefile 2007-06-25 01:58:28.000000000 +0200
  3. +++ mrd6-0.9.6/src/Makefile 2009-06-13 13:39:39.000000000 +0200
  4. @@ -26,7 +26,7 @@ ifeq ($(SUPPORT_MODULES),yes)
  5. MODULES ?= BGP
  6. LDCMD = -rdynamic
  7. else
  8. - MODULE_OPTIONS += -DMRD_NO_DYNAMIC_MODULE_LOADING
  9. + MODULE_OPTIONS += MRD_NO_DYNAMIC_MODULE_LOADING
  10. endif
  11. INCLUDES = -I../include
  12. @@ -92,7 +92,7 @@ TESTS = tests/address_unittest tests/ptr
  13. DEST_PREFIX = $(DESTDIR)$(PREFIX)
  14. CXXFLAGS = $(INCLUDES) -ansi -Wall -Wno-multichar -fno-exceptions -fPIC \
  15. - -D$(PLATFORM) $(addprefix -D,$(MODULE_OPTIONS))
  16. + -D$(PLATFORM) $(addprefix -D,$(MODULE_OPTIONS)) $(EXTRA_FLAGS)
  17. ifeq ($(OPTIMIZE),yes)
  18. ifeq ($(SPACE_OPTIMIZE),yes)
  19. @@ -101,22 +101,13 @@ ifeq ($(OPTIMIZE),yes)
  20. CXXFLAGS += -O3
  21. endif
  22. else
  23. - CXXFLAGS += -g
  24. ifeq ($(NO_INLINE),yes)
  25. CXXFLAGS += -O0 -fno-inline
  26. - else
  27. - CXXFLAGS += -O2
  28. endif
  29. endif
  30. LDFLAGS += -lm
  31. -ifeq ($(STATIC_STDCXX),no)
  32. - LDFLAGS += -lstdc++
  33. -else
  34. - LDFLAGS += `$(CXX) -print-file-name=libstdc++.a`
  35. -endif
  36. -
  37. TEST_OBJECTS = $(addprefix $(OBJ_DIR)/,$(TEST_SOURCES:.cpp=.o))
  38. MRD_OBJECTS = $(addprefix $(OBJ_DIR)/,$(MRD_SOURCES:.cpp=.o))
  39. @@ -151,23 +142,25 @@ $(foreach test,$(TESTS),$(eval $(call un
  40. $(TARGET): $(MRD_OBJECTS)
  41. @echo "Linking $(TARGET)"
  42. - @$(CXX) $(LDCMD) $(CXXFLAGS) -o $@ $(MRD_OBJECTS) $(LDFLAGS)
  43. + $(CXX) $(LDCMD) $(CXXFLAGS) -o $@ $(MRD_OBJECTS) $(LDFLAGS)
  44. install: $(TARGET) $(EXTERNAL_MODULES)
  45. - install -D $(TARGET) $(DEST_PREFIX)/sbin/$(TARGET)
  46. - install -D ../tools/mrd6sh $(DEST_PREFIX)/bin/mrd6sh
  47. + install -d $(DEST_PREFIX)/sbin
  48. + install -d $(DEST_PREFIX)/bin
  49. + install $(TARGET) $(DEST_PREFIX)/sbin/$(TARGET)
  50. + install ../tools/mrd6sh $(DEST_PREFIX)/bin/mrd6sh
  51. ifneq (,$(EXTERNAL_MODULES))
  52. mkdir -p $(DEST_PREFIX)/lib/mrd6/
  53. - install -D $(EXTERNAL_MODULES) $(DEST_PREFIX)/lib/mrd6/
  54. + install $(EXTERNAL_MODULES) $(DEST_PREFIX)/lib/mrd6/
  55. endif
  56. $(MRD_VERSION_CPP): $(SOURCES) Makefile Makefile.options
  57. - @set -e; mkdir -p $(dir $@); \
  58. + mkdir -p $(dir $@); \
  59. echo '/* This file is automatically generated */' > $(MRD_VERSION_CPP); \
  60. echo 'const char *BuildDate = "$(NOW)";' >> $(MRD_VERSION_CPP)
  61. $(MODULES_CPP): Makefile Makefile.options
  62. - @set -e; mkdir -p $(dir $@); \
  63. + mkdir -p $(dir $@); \
  64. echo "Generating modules.cpp"; \
  65. scripts/generate-modules-cpp.pl $(STATIC_MODULES) > $(MODULES_CPP)
  66. @@ -181,7 +174,7 @@ $(OPTIONS):
  67. $(DEPS_DIR)/%.d: %.cpp $(OPTIONS)
  68. @echo "Deps $<"
  69. - @set -e; mkdir -p $(dir $@); \
  70. + mkdir -p $(dir $@); \
  71. $(CXX) -MM -MT $@ -MT $(addprefix $(OBJ_DIR)/,$(<:.cpp=.o)) \
  72. $(CXXFLAGS) $< > $@
  73. @@ -195,7 +188,7 @@ endif
  74. $(OBJ_DIR)/%.o: %.cpp $(OPTIONS)
  75. @echo "C++ $<"
  76. - @set -e; mkdir -p $(dir $@); \
  77. + mkdir -p $(dir $@); \
  78. $(CXX) -c $(CXXFLAGS) $< -o $@
  79. clean: