Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions deps/lgw/makefile
Original file line number Diff line number Diff line change
Expand Up @@ -49,10 +49,10 @@ ${LGWLIB}: ${PLT}/libloragw/libloragw.a
@cp $< $@

${PLT}/libloragw/libloragw.a: ${SRCS} ${HFILES}
${MAKE} -C ${PLT}/libloragw libloragw.a CC=${CC} AR=${AR} LD=${LD} TDfull=${TDfull}
${MAKE} -C ${PLT}/libloragw libloragw.a CC="${CC}" AR="${AR}" LD="${LD}" TDfull=${TDfull}

${PLT}/libloragw/inc/config.h: ${PLT}/libloragw/library.cfg
${MAKE} -C ${PLT}/libloragw inc/config.h CC=${CC} AR=${AR} LD=${LD} TDfull=${TDfull}
${MAKE} -C ${PLT}/libloragw inc/config.h CC="${CC}" AR="${AR}" LD="${LD}" TDfull=${TDfull}

${LGWINC}/%.h: ${PLT}/libloragw/inc/%.h | ${LGWINC}
@echo " CP ${<F} -> $@"
Expand Down
4 changes: 2 additions & 2 deletions deps/lgw1302/makefile
Original file line number Diff line number Diff line change
Expand Up @@ -49,10 +49,10 @@ ${LGWLIB}: ${PLT}/libloragw/libloragw.a
@cp $< $@

${PLT}/libloragw/libloragw.a: ${SRCS} ${HFILES}
${MAKE} -C ${PLT}/libloragw libloragw.a CC=${CC} AR=${AR} LD=${LD} TDfull=${TDfull}
${MAKE} -C ${PLT}/libloragw libloragw.a CC="${CC}" AR="${AR}" LD="${LD}" TDfull=${TDfull}

${PLT}/libloragw/inc/config.h: ${PLT}/libloragw/library.cfg
${MAKE} -C ${PLT}/libloragw inc/config.h CC=${CC} AR=${AR} LD=${LD} TDfull=${TDfull}
${MAKE} -C ${PLT}/libloragw inc/config.h CC="${CC}" AR="${AR}" LD="${LD}" TDfull=${TDfull}

${LGWINC}/%.h: ${PLT}/libloragw/inc/%.h | ${LGWINC}
@echo " CP ${<F} -> $@"
Expand Down
12 changes: 6 additions & 6 deletions setup.gmk
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ ARCH.kerlink = arm-klk-linux-gnueabi
ARCH=${ARCH.${platform}}

export TDfull := $(shell cd ${TD} && pwd)
TOOLCHAIN=${HOME}/toolchain-${platform}
TOOLCHAIN ?= ${HOME}/toolchain-${platform}


ifeq (,$(wildcard ${TOOLCHAIN}))
Expand All @@ -65,11 +65,11 @@ else
TOOLPREFIX=${TOOLCHAIN}/bin/${ARCH}-
endif

CC=${TOOLPREFIX}gcc
LD=${TOOLPREFIX}ld
AR=${TOOLPREFIX}ar
OD=${TOOLPREFIX}objdump
OC=${TOOLPREFIX}objcopy
CC ?= ${TOOLPREFIX}gcc
LD ?= ${TOOLPREFIX}ld
AR ?= ${TOOLPREFIX}ar
OD ?= ${TOOLPREFIX}objdump
OC ?= ${TOOLPREFIX}objcopy
Comment on lines +68 to +72

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you please describe what the intended outcome of this change is?

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The current makefile gives some constraints:

  1. The toolchain must be in a /toolchain-${platform} folder
  2. Toolchain binaries must reside in a bin folder
  3. All toolchain binaries must reside in the same folder

Constraints 2-3 are generally met by most environments. Constraint 1 is problematic. E.g. in yocto, 1 is not met, 2.3 are.

  • The proposed change: TOOLCHAIN?=${HOME}/toolchain-${platform} removes constraint 1.
  • The one you linked removes constraint 2-3.

In my case (yocto), removing constraint 1 is mandatory.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I just noticed that yocto does not produce a tree compatible with constraint 2. So both changes are necessary.

Also, note that yocto will by default set CC, LD, ... vars in the build setup process.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This change is a problem because GNU make populates CC and AR with default values. Hence ?= has no effect for those variables unless make is called with -R flag. That's why we cannot simply accept with change.
Thanks for the description of your use case. We will take this into account for future releases.


ifeq (kerlink,${platform})
# Needed for loader to find libmpfr.so.4
Expand Down