From: Thomas Monjalon Date: Tue, 12 Jul 2016 12:25:35 +0000 (+0200) Subject: mk: clean up application linker flags X-Git-Tag: spdx-start~6174 X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=eac0efbd1cecd2a45c22b3cc2df8fc07fd7b9539;p=dpdk.git 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 --- diff --git a/mk/rte.app.mk b/mk/rte.app.mk index ea229618a2..f9acb748c2 100644 --- a/mk/rte.app.mk +++ b/mk/rte.app.mk @@ -176,6 +176,8 @@ ifeq ($(RTE_DEVEL_BUILD)$(CONFIG_RTE_BUILD_SHARED_LIB),yy) LDFLAGS += -rpath=$(RTE_SDK_BIN)/lib endif +MAPFLAGS = -Map=$@.map --cref + .PHONY: all all: install @@ -190,13 +192,13 @@ build: _postbuild exe2cmd = $(strip $(call dotfile,$(patsubst %,%.cmd,$(1)))) ifeq ($(LINK_USING_CC),1) -override EXTRA_LDFLAGS := $(call linkerprefix,$(EXTRA_LDFLAGS)) -O_TO_EXE = $(CC) $(CFLAGS) $(LDFLAGS_$(@)) \ - -Wl,-Map=$(@).map,--cref -o $@ $(OBJS-y) $(call linkerprefix,$(LDFLAGS)) \ - $(EXTRA_LDFLAGS) $(call linkerprefix,$(LDLIBS)) +O_TO_EXE = $(CC) -o $@ $(CFLAGS) $(OBJS-y) $(call linkerprefix, \ + $(LDFLAGS) $(LDFLAGS_$(@)) $(EXTRA_LDFLAGS) $(LDLIBS) \ + $(MAPFLAGS)) else -O_TO_EXE = $(LD) $(LDFLAGS) $(LDFLAGS_$(@)) $(EXTRA_LDFLAGS) \ - -Map=$(@).map --cref -o $@ $(OBJS-y) $(LDLIBS) +O_TO_EXE = $(LD) -o $@ $(OBJS-y) \ + $(LDFLAGS) $(LDFLAGS_$(@)) $(EXTRA_LDFLAGS) $(LDLIBS) \ + $(MAPFLAGS) endif O_TO_EXE_STR = $(subst ','\'',$(O_TO_EXE)) #'# fix syntax highlight O_TO_EXE_DISP = $(if $(V),"$(O_TO_EXE_STR)"," LD $(@)")