Skip to content

Commit

Permalink
Añade Makefile para compilar
Browse files Browse the repository at this point in the history
  • Loading branch information
JJ committed Dec 22, 2015
1 parent cbcb892 commit 5204515
Showing 1 changed file with 91 additions and 0 deletions.
91 changes: 91 additions & 0 deletions arbol/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
# This file was automagically generated by mbed.org. For more information,
# see http://mbed.org/handbook/Exporting-to-GCC-ARM-Embedded

GCC_BIN = /usr/bin/
PROJECT = arbol
OBJECTS = ./main.o ./USBDevice/USBHID/USBMouse.o ./USBDevice/USBHID/USBHID.o ./USBDevice/USBHID/USBMouseKeyboard.o ./USBDevice/USBHID/USBKeyboard.o ./USBDevice/USBDevice/USBHAL_KL25Z.o ./USBDevice/USBDevice/USBDevice.o ./USBDevice/USBDevice/USBHAL_LPC17.o ./USBDevice/USBDevice/USBHAL_LPC40.o ./USBDevice/USBDevice/USBHAL_LPC11U.o ./USBDevice/USBDevice/USBHAL_STM32F4.o ./USBDevice/USBDevice/USBHAL_Maxim.o ./USBDevice/USBDevice/USBHAL_EFM32.o ./USBDevice/USBDevice/USBHAL_RZ_A1H.o ./USBDevice/USBAudio/USBAudio.o ./USBDevice/USBSerial/USBSerial.o ./USBDevice/USBSerial/USBCDC.o ./USBDevice/USBMSD/USBMSD.o ./USBDevice/USBMIDI/USBMIDI.o ./PixelArray/neopixel.o ./PixelArray/BurstSPI/BurstSPI_LPC1768.o ./PixelArray/BurstSPI/BurstSPI_KL25Z.o ./PixelArray/BurstSPI/BurstSPI_NUCLEO_L152RE.o ./PixelArray/BurstSPI/BurstSPI_KL46Z.o
SYS_OBJECTS = ./mbed/TARGET_LPC11U24/TOOLCHAIN_GCC_ARM/board.o ./mbed/TARGET_LPC11U24/TOOLCHAIN_GCC_ARM/cmsis_nvic.o ./mbed/TARGET_LPC11U24/TOOLCHAIN_GCC_ARM/retarget.o ./mbed/TARGET_LPC11U24/TOOLCHAIN_GCC_ARM/startup_LPC11xx.o ./mbed/TARGET_LPC11U24/TOOLCHAIN_GCC_ARM/system_LPC11Uxx.o
INCLUDE_PATHS = -I. -I./USBDevice -I./USBDevice/USBHID -I./USBDevice/USBDevice -I./USBDevice/USBAudio -I./USBDevice/USBSerial -I./USBDevice/USBMSD -I./USBDevice/USBMIDI -I./PixelArray -I./PixelArray/BurstSPI -I./mbed -I./mbed/TARGET_LPC11U24 -I./mbed/TARGET_LPC11U24/TARGET_NXP -I./mbed/TARGET_LPC11U24/TARGET_NXP/TARGET_LPC11UXX -I./mbed/TARGET_LPC11U24/TARGET_NXP/TARGET_LPC11UXX/TARGET_LPC11U24_401 -I./mbed/TARGET_LPC11U24/TOOLCHAIN_GCC_ARM
LIBRARY_PATHS = -L./mbed/TARGET_LPC11U24/TOOLCHAIN_GCC_ARM
LIBRARIES = -lmbed
LINKER_SCRIPT = ./mbed/TARGET_LPC11U24/TOOLCHAIN_GCC_ARM/LPC11U24.ld

###############################################################################
AS = $(GCC_BIN)arm-none-eabi-as
CC = $(GCC_BIN)arm-none-eabi-gcc
CPP = $(GCC_BIN)arm-none-eabi-g++
LD = $(GCC_BIN)arm-none-eabi-gcc
OBJCOPY = $(GCC_BIN)arm-none-eabi-objcopy
OBJDUMP = $(GCC_BIN)arm-none-eabi-objdump
SIZE = $(GCC_BIN)arm-none-eabi-size


CPU = -mcpu=cortex-m0 -mthumb
CC_FLAGS = $(CPU) -c -g -fno-common -fmessage-length=0 -Wall -Wextra -fno-exceptions -ffunction-sections -fdata-sections -fomit-frame-pointer -MMD -MP
CC_SYMBOLS = -D__CORTEX_M0 -DMBED_BUILD_TIMESTAMP=1448905628.18 -DTARGET_LPC11UXX -DTOOLCHAIN_GCC -DTARGET_LPC11U24_401 -DTARGET_CORTEX_M -DTARGET_NXP -DTOOLCHAIN_GCC_ARM -DTARGET_M0 -DARM_MATH_CM0 -DTARGET_LPC11U24 -D__MBED__=1

LD_FLAGS = $(CPU) -Wl,--gc-sections --specs=nano.specs -Wl,--wrap,main -Wl,-Map=$(PROJECT).map,--cref
#LD_FLAGS += -u _printf_float -u _scanf_float
LD_SYS_LIBS = -lstdc++ -lsupc++ -lm -lc -lgcc -lnosys


ifeq ($(DEBUG), 1)
CC_FLAGS += -DDEBUG -O0
else
CC_FLAGS += -DNDEBUG -Os
endif

.PHONY: all clean lst size

all: $(PROJECT).bin $(PROJECT).hex size


clean:
rm -f $(PROJECT).bin $(PROJECT).elf $(PROJECT).hex $(PROJECT).map $(PROJECT).lst $(OBJECTS) $(DEPS)


.asm.o:
$(CC) $(CPU) -c -x assembler-with-cpp -o $@ $<
.s.o:
$(CC) $(CPU) -c -x assembler-with-cpp -o $@ $<
.S.o:
$(CC) $(CPU) -c -x assembler-with-cpp -o $@ $<

.c.o:
$(CC) $(CC_FLAGS) $(CC_SYMBOLS) -std=gnu99 $(INCLUDE_PATHS) -o $@ $<

.cpp.o:
$(CPP) $(CC_FLAGS) $(CC_SYMBOLS) -std=gnu++98 -fno-rtti $(INCLUDE_PATHS) -o $@ $<




$(PROJECT).elf: $(OBJECTS) $(SYS_OBJECTS)
$(LD) $(LD_FLAGS) -T$(LINKER_SCRIPT) $(LIBRARY_PATHS) -o $@ $^ $(LIBRARIES) $(LD_SYS_LIBS) $(LIBRARIES) $(LD_SYS_LIBS)

@echo ""
@echo "*****"
@echo "***** You must modify vector checksum value in *.bin and *.hex files."
@echo "*****"
@echo ""


$(PROJECT).bin: $(PROJECT).elf
$(OBJCOPY) -O binary $< $@
./crcset $(PROJECT).bin

$(PROJECT).hex: $(PROJECT).elf
@$(OBJCOPY) -O ihex $< $@

$(PROJECT).lst: $(PROJECT).elf
@$(OBJDUMP) -Sdh $< > $@

lst: $(PROJECT).lst

size: $(PROJECT).elf
$(SIZE) $(PROJECT).elf

DEPS = $(OBJECTS:.o=.d) $(SYS_OBJECTS:.o=.d)
-include $(DEPS)


0 comments on commit 5204515

Please sign in to comment.