makefile now compiles from within Roaming/Arduino15 subfolder

This commit is contained in:
ladyada 2015-10-31 00:57:07 -04:00 committed by dean
parent f8481c1ae9
commit 64ea2e8521

View file

@ -1,11 +1,11 @@
IDE_PATH="../../../../.."
ARM_GCC_PATH=$(IDE_PATH)/hardware/tools/gcc-arm-none-eabi-4.8.3-2014q1/bin
IDE_PATH=../../../../..
ARM_GCC_PATH=$(IDE_PATH)/tools/arm-none-eabi-gcc/4.8.3-2014q1/bin
CC=$(ARM_GCC_PATH)/arm-none-eabi-gcc
CFLAGS=-mthumb -mcpu=cortex-m0plus -Wall -c -g -Os -w -std=gnu99 -ffunction-sections -fdata-sections -nostdlib --param max-inline-insns-single=500
LDFLAGS=-mthumb -mcpu=cortex-m0plus -Wall -Wl,--cref -Wl,--check-sections -Wl,--gc-sections -Wl,--unresolved-symbols=report-all -Wl,--warn-common -Wl,--warn-section-align -Wl,--warn-unresolved-symbols
BLD_EXTA_FLAGS=-D__SAMD21G18A__
BUILD_PATH=build
INCLUDES=-I$(IDE_PATH)/hardware/tools/CMSIS/CMSIS/Include/ -I$(IDE_PATH)/hardware/tools/CMSIS/Device/ATMEL/ -I./drivers/ -I./utils/ -I./utils/preprocessor/ -I./utils/interrupt
INCLUDES=-I$(IDE_PATH)/tools/CMSIS/CMSIS/Include/ -I$(IDE_PATH)/tools/CMSIS/4.0.0-atmel/Device/ATMEL/ -I$(IDE_PATH)/tools/CMSIS/4.0.0-atmel/CMSIS/Include/ -I./drivers/ -I./utils/ -I./utils/preprocessor/ -I./utils/interrupt
SOURCES=main.c sam_ba_monitor.c startup_samd21.c usart_sam_ba.c drivers/cdc_enumerate.c drivers/uart_driver.c utils/interrupt/interrupt_sam_nvic.c
OBJECTS=$(addprefix $(BUILD_PATH)/, $(SOURCES:.c=.o))
DEPS=$(addprefix $(BUILD_PATH)/, $(SOURCES:.c=.d))
@ -24,7 +24,7 @@ EXECUTABLE=$(NAME).bin
all: print_info $(SOURCES) $(BIN) $(HEX) $(AS_BUILD)
all: $(SOURCES) $(EXECUTABLE)
$(EXECUTABLE): $(OBJECTS)
$(CC) -L$(BUILD_PATH) $(LDFLAGS) -Os -Wl,--gc-sections -save-temps -Tsamd21j18a_flash.ld -Wl,-Map,$(BUILD_PATH)/$(NAME).map --specs=nano.specs --specs=nosys.specs -o $(BUILD_PATH)/$(NAME).elf $(OBJECTS) -Wl,--start-group -lm -Wl,--end-group
$(ARM_GCC_PATH)/arm-none-eabi-objcopy -O binary $(BUILD_PATH)/$(NAME).elf $@
@ -32,6 +32,6 @@ $(EXECUTABLE): $(OBJECTS)
$(BUILD_PATH)/%.o: %.c
-@mkdir -p $(@D)
$(CC) $(CFLAGS) $(BLD_EXTA_FLAGS) $(INCLUDES) $< -o $@
clean:
del $(EXECUTABLE) $(subst /,\,$(OBJECTS)) $(subst /,\,$(BUILD_PATH)/$(NAME).*)