From: Nathael Pajani Date: Tue, 27 Sep 2016 22:14:44 +0000 (+0200) Subject: Updated Makefile: Use LDFLAGS instead of LINKOPTS Use $(DEBUG) var X-Git-Url: http://git.techno-innov.fr/?a=commitdiff_plain;h=57f98b1a88d588fc137c9e1002323916d24e670f;p=soft%2Flpc82x%2Fcore Updated Makefile: Use LDFLAGS instead of LINKOPTS Use $(DEBUG) var --- 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 : $@"