Skip to content
Snippets Groups Projects
Commit 215c9aae authored by Leon George's avatar Leon George
Browse files

make: allow chosing ld-like over gcc-like options

make automatically adds '-Wl,' to linker-options. Supply `LINKFLAGPREFIX :=` to avoid that.
parent 4859a719
No related branches found
No related tags found
No related merge requests found
...@@ -95,14 +95,17 @@ export CPPMIX ?= $(if $(wildcard *.cpp),1,) ...@@ -95,14 +95,17 @@ export CPPMIX ?= $(if $(wildcard *.cpp),1,)
export CXXUWFLAGS export CXXUWFLAGS
export CXXEXFLAGS export CXXEXFLAGS
# We assume $(LINK) to be gcc-like. Use `LINKFLAGPREFIX :=` for ld-like linker options.
LINKFLAGPREFIX ?= -Wl,
## make script for your application. Build RIOT-base here! ## make script for your application. Build RIOT-base here!
all: ..build-message $(USEPKG:%=${BINDIR}%.a) $(APPDEPS) all: ..build-message $(USEPKG:%=${BINDIR}%.a) $(APPDEPS)
$(AD)DIRS="$(DIRS)" "$(MAKE)" -C $(CURDIR) -f $(RIOTBASE)/Makefile.application $(AD)DIRS="$(DIRS)" "$(MAKE)" -C $(CURDIR) -f $(RIOTBASE)/Makefile.application
ifeq (,$(RIOTNOLINK)) ifeq (,$(RIOTNOLINK))
ifeq ($(BUILDOSXNATIVE),1) ifeq ($(BUILDOSXNATIVE),1)
$(AD)$(if $(CPPMIX),$(CXX),$(LINK)) $(UNDEF) -o $(ELFFILE) $(BASELIBS) $(LINKFLAGS) -Wl,-no_pie $(AD)$(if $(CPPMIX),$(CXX),$(LINK)) $(UNDEF) -o $(ELFFILE) $(BASELIBS) $(LINKFLAGS) $(LINKFLAGPREFIX)-no_pie
else else
$(AD)$(if $(CPPMIX),$(CXX),$(LINK)) $(UNDEF) -o $(ELFFILE) -Wl,--start-group $(BASELIBS) -lm -Wl,--end-group -Wl,-Map=$(BINDIR)$(APPLICATION).map $(LINKFLAGS) $(AD)$(if $(CPPMIX),$(CXX),$(LINK)) $(UNDEF) -o $(ELFFILE) $(LINKFLAGPREFIX)--start-group $(BASELIBS) -lm $(LINKFLAGPREFIX)--end-group $(LINKFLAGPREFIX)-Map=$(BINDIR)$(APPLICATION).map $(LINKFLAGS)
endif endif
$(AD)$(SIZE) $(ELFFILE) $(AD)$(SIZE) $(ELFFILE)
$(AD)$(OBJCOPY) $(OFLAGS) $(ELFFILE) $(HEXFILE) $(AD)$(OBJCOPY) $(OFLAGS) $(ELFFILE) $(HEXFILE)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment