From 57f98b1a88d588fc137c9e1002323916d24e670f Mon Sep 17 00:00:00 2001 From: Nathael Pajani Date: Wed, 28 Sep 2016 00:14:44 +0200 Subject: [PATCH] Updated Makefile: Use LDFLAGS instead of LINKOPTS Use $(DEBUG) var --- Makefile | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/Makefile b/Makefile index e7a33ed..bf83415 100644 --- a/Makefile +++ b/Makefile @@ -8,11 +8,13 @@ ARCH = armv6-m CROSS_COMPILE ?= arm-none-eabi- CC = $(CROSS_COMPILE)gcc +#DEBUG = -g +LD_DEBUG = $(DEBUG) FOPTS = -fno-builtin -ffunction-sections -fdata-sections -ffreestanding -CFLAGS = -Wall -g -O2 -mthumb -mcpu=$(CPU) $(FOPTS) -LINKOPTS = -static -g -nostartfiles -nostdlib \ +CFLAGS = -Wall -O2 $(DEBUG) -mthumb -mcpu=$(CPU) $(FOPTS) +LDFLAGS = -static $(LD_DEBUG) -nostartfiles -nostdlib -Tlpc_link_$(LPC).ld \ -Wl,--gc-sections -Wl,--build-id=none \ - -Wl,-Map=$(TARGET_DIR)/lpc_map_$(LPC).map -Tlpc_link_$(LPC).ld + -Wl,-Map=$(TARGET_DIR)/lpc_map_$(LPC).map APPS = $(subst apps/,,$(wildcard apps/*/*)) @@ -40,7 +42,7 @@ NAME_DEPS = ${NAME_OBJS:%.o=$(OBJDIR)/%.d} .PRECIOUS: %.elf %.elf: $(OBJS) $(NAME_OBJS) @echo "Linking $(MODULE)/$(NAME) ..." - @$(CC) $(LINKOPTS) $(OBJS) $(NAME_OBJS) -o $@ + @$(CC) $(LDFLAGS) $(OBJS) $(NAME_OBJS) -o $@ %.bin: %.elf @echo "Creating image : $@" -- 2.43.0