From 5cf3425368ddf43bbe9bd77188ff8e236f02ce4d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Ignacio=20Alamos?= Date: Fri, 26 May 2017 18:10:42 -0400 Subject: [PATCH] improve pkg Makefile --- pkg/openthread/Makefile | 22 ++++++++++------------ 1 file changed, 10 insertions(+), 12 deletions(-) diff --git a/pkg/openthread/Makefile b/pkg/openthread/Makefile index 21c156aed402..8d59f1dec345 100644 --- a/pkg/openthread/Makefile +++ b/pkg/openthread/Makefile @@ -10,22 +10,20 @@ $(info $$OPENTHREAD_ARGS is [${OPENTHREAD_ARGS}]) .PHONY: all +OPENTHREAD_COMMON_FLAGS=-fdata-sections -ffunction-sections -Os all: git-download cd $(PKG_BUILDDIR) && PREFIX="/" ./bootstrap - cd $(PKG_BUILDDIR) && ./configure \ - CPP="$(CPP)" CC="$(CC)" CXX="$(CXX)" OBJC="" OBJCXX="" AR="$(AR)" RANLIB="$(RANLIB)" NM="$(NM)" \ + cd $(PKG_BUILDDIR) && CPP="$(CPP)" CC="$(CC)" CXX="$(CXX)"\ + OBJC="" OBJCXX="" AR="$(AR)" RANLIB="$(RANLIB)" NM="$(NM)" \ STRIP="$(STRIP)" \ - CPPFLAGS="-fdata-sections -ffunction-sections -Os -g $(CFLAGS_CPU) " \ - CFLAGS="-fdata-sections -ffunction-sections -Os -g $(CFLAGS_CPU) " \ - CXXFLAGS="-fdata-sections -ffunction-sections -Os -g $(CFLAGS_CPU) -fno-exceptions -fno-rtti " \ - LDFLAGS="-fdata-sections -ffunction-sections -Os -g $(CFLAGS_CPU) -nostartfiles -specs=nano.specs \ + CPPFLAGS="$(OPENTHREAD_COMMON_FLAGS) $(CFLAGS_CPU) " \ + CFLAGS="$(OPENTHREAD_COMMON_FLAGS) $(CFLAGS_CPU) " \ + CXXFLAGS="$(OPENTHREAD_COMMON_FLAGS) $(CFLAGS_CPU) -fno-exceptions -fno-rtti " \ + LDFLAGS="$(OPENTHREAD_COMMON_FLAGS) $(CFLAGS_CPU) -nostartfiles -specs=nano.specs \ -specs=nosys.specs -Wl,--gc-sections -Wl,-Map=map.map " \ - --host=$(TARGET_ARCH) \ - --target=$(TARGET_ARCH) \ - --prefix=/ \ - --enable-default-logging \ - ${OPENTHREAD_ARGS} - cd $(PKG_BUILDDIR) && make -j4 --no-print-directory DESTDIR=$(PKG_BUILDDIR)/output install PREFIX=/ + ./configure --disable-docs --host=$(TARGET_ARCH) --target=$(TARGET_ARCH) \ + --prefix=/ --enable-default-logging ${OPENTHREAD_ARGS} + cd $(PKG_BUILDDIR) && DESTDIR=$(PKG_BUILDDIR)/output PREFIX=/ make -j4 --no-print-directory install cp $(PKG_BUILDDIR)/output/lib/libmbedcrypto.a ${BINDIR}/libmbedcrypto.a cp $(PKG_BUILDDIR)/output/lib/libopenthread-ftd.a ${BINDIR}/libopenthread.a