Skip to content

Commit

Permalink
improve pkg Makefile
Browse files Browse the repository at this point in the history
  • Loading branch information
jia200x committed May 26, 2017
1 parent e8e912f commit 5cf3425
Showing 1 changed file with 10 additions and 12 deletions.
22 changes: 10 additions & 12 deletions pkg/openthread/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 5cf3425

Please sign in to comment.