mk: clean up application linker flags

Make some cleaning before fixing the link dependency ordering
in the next commit.

- Move flags for creating a map file in the variable MAPFLAGS.
- Make only one call to linkerprefix macro.
- Group linker flags on the same line.

Signed-off-by: Thomas Monjalon <thomas.monjalon@6wind.com>
This commit is contained in:
Thomas Monjalon 2016-07-12 14:25:35 +02:00
parent 990279774d
commit eac0efbd1c

View File

@ -176,6 +176,8 @@ ifeq ($(RTE_DEVEL_BUILD)$(CONFIG_RTE_BUILD_SHARED_LIB),yy)
LDFLAGS += -rpath=$(RTE_SDK_BIN)/lib LDFLAGS += -rpath=$(RTE_SDK_BIN)/lib
endif endif
MAPFLAGS = -Map=$@.map --cref
.PHONY: all .PHONY: all
all: install all: install
@ -190,13 +192,13 @@ build: _postbuild
exe2cmd = $(strip $(call dotfile,$(patsubst %,%.cmd,$(1)))) exe2cmd = $(strip $(call dotfile,$(patsubst %,%.cmd,$(1))))
ifeq ($(LINK_USING_CC),1) ifeq ($(LINK_USING_CC),1)
override EXTRA_LDFLAGS := $(call linkerprefix,$(EXTRA_LDFLAGS)) O_TO_EXE = $(CC) -o $@ $(CFLAGS) $(OBJS-y) $(call linkerprefix, \
O_TO_EXE = $(CC) $(CFLAGS) $(LDFLAGS_$(@)) \ $(LDFLAGS) $(LDFLAGS_$(@)) $(EXTRA_LDFLAGS) $(LDLIBS) \
-Wl,-Map=$(@).map,--cref -o $@ $(OBJS-y) $(call linkerprefix,$(LDFLAGS)) \ $(MAPFLAGS))
$(EXTRA_LDFLAGS) $(call linkerprefix,$(LDLIBS))
else else
O_TO_EXE = $(LD) $(LDFLAGS) $(LDFLAGS_$(@)) $(EXTRA_LDFLAGS) \ O_TO_EXE = $(LD) -o $@ $(OBJS-y) \
-Map=$(@).map --cref -o $@ $(OBJS-y) $(LDLIBS) $(LDFLAGS) $(LDFLAGS_$(@)) $(EXTRA_LDFLAGS) $(LDLIBS) \
$(MAPFLAGS)
endif endif
O_TO_EXE_STR = $(subst ','\'',$(O_TO_EXE)) #'# fix syntax highlight O_TO_EXE_STR = $(subst ','\'',$(O_TO_EXE)) #'# fix syntax highlight
O_TO_EXE_DISP = $(if $(V),"$(O_TO_EXE_STR)"," LD $(@)") O_TO_EXE_DISP = $(if $(V),"$(O_TO_EXE_STR)"," LD $(@)")