mbed build system
This commit is contained in:
parent
864d1306b9
commit
cdfed79a8d
2
smoother/.gitignore
vendored
Normal file
2
smoother/.gitignore
vendored
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
.build
|
||||||
|
mbed
|
117
smoother/Makefile
Normal file
117
smoother/Makefile
Normal file
@ -0,0 +1,117 @@
|
|||||||
|
# This file was automagically generated by mbed.org. For more information,
|
||||||
|
# see http://mbed.org/handbook/Exporting-to-GCC-ARM-Embedded
|
||||||
|
|
||||||
|
# cross-platform directory manipulation
|
||||||
|
ifeq ($(shell echo $$OS),$$OS)
|
||||||
|
MAKEDIR = if not exist "$(1)" mkdir "$(1)"
|
||||||
|
RM = rmdir /S /Q "$(1)"
|
||||||
|
else
|
||||||
|
MAKEDIR = $(SHELL) -c "mkdir -p \"$(1)\""
|
||||||
|
RM = $(SHELL) -c "rm -rf \"$(1)\""
|
||||||
|
endif
|
||||||
|
|
||||||
|
ifeq (,$(filter .build,$(notdir $(CURDIR))))
|
||||||
|
.SUFFIXES:
|
||||||
|
OBJDIR := .build
|
||||||
|
mkfile_path := $(abspath $(lastword $(MAKEFILE_LIST)))
|
||||||
|
MAKETARGET = $(MAKE) --no-print-directory -C $(OBJDIR) -f $(mkfile_path) \
|
||||||
|
SRCDIR=$(CURDIR) $(MAKECMDGOALS)
|
||||||
|
.PHONY: $(OBJDIR) clean
|
||||||
|
all:
|
||||||
|
+@$(call MAKEDIR,$(OBJDIR))
|
||||||
|
+@$(MAKETARGET)
|
||||||
|
$(OBJDIR): all
|
||||||
|
Makefile : ;
|
||||||
|
% :: $(OBJDIR) ; :
|
||||||
|
clean :
|
||||||
|
$(call RM,$(OBJDIR))
|
||||||
|
|
||||||
|
else
|
||||||
|
|
||||||
|
VPATH = ..
|
||||||
|
|
||||||
|
GCC_BIN =
|
||||||
|
PROJECT = mbed_blinky
|
||||||
|
OBJECTS = src/main.o
|
||||||
|
SYS_OBJECTS = mbed/TARGET_LPC1768/TOOLCHAIN_GCC_ARM/analogin_api.o mbed/TARGET_LPC1768/TOOLCHAIN_GCC_ARM/analogout_api.o mbed/TARGET_LPC1768/TOOLCHAIN_GCC_ARM/can_api.o mbed/TARGET_LPC1768/TOOLCHAIN_GCC_ARM/cmsis_nvic.o mbed/TARGET_LPC1768/TOOLCHAIN_GCC_ARM/ethernet_api.o mbed/TARGET_LPC1768/TOOLCHAIN_GCC_ARM/gpio_api.o mbed/TARGET_LPC1768/TOOLCHAIN_GCC_ARM/gpio_irq_api.o mbed/TARGET_LPC1768/TOOLCHAIN_GCC_ARM/i2c_api.o mbed/TARGET_LPC1768/TOOLCHAIN_GCC_ARM/mbed_board.o mbed/TARGET_LPC1768/TOOLCHAIN_GCC_ARM/pinmap.o mbed/TARGET_LPC1768/TOOLCHAIN_GCC_ARM/port_api.o mbed/TARGET_LPC1768/TOOLCHAIN_GCC_ARM/pwmout_api.o mbed/TARGET_LPC1768/TOOLCHAIN_GCC_ARM/retarget.o mbed/TARGET_LPC1768/TOOLCHAIN_GCC_ARM/rtc_api.o mbed/TARGET_LPC1768/TOOLCHAIN_GCC_ARM/serial_api.o mbed/TARGET_LPC1768/TOOLCHAIN_GCC_ARM/sleep.o mbed/TARGET_LPC1768/TOOLCHAIN_GCC_ARM/spi_api.o mbed/TARGET_LPC1768/TOOLCHAIN_GCC_ARM/startup_LPC17xx.o mbed/TARGET_LPC1768/TOOLCHAIN_GCC_ARM/system_LPC17xx.o mbed/TARGET_LPC1768/TOOLCHAIN_GCC_ARM/us_ticker.o
|
||||||
|
INCLUDE_PATHS = -I../. -I../src -I../mbed/. -I../mbed/TARGET_LPC1768 -I../mbed/TARGET_LPC1768/TARGET_NXP -I../mbed/TARGET_LPC1768/TARGET_NXP/TARGET_LPC176X -I../mbed/TARGET_LPC1768/TARGET_NXP/TARGET_LPC176X/TARGET_MBED_LPC1768 -I../mbed/TARGET_LPC1768/TARGET_NXP/TARGET_LPC176X/device -I../mbed/TARGET_LPC1768/TOOLCHAIN_GCC_ARM -I../mbed/drivers -I../mbed/hal -I../mbed/platform
|
||||||
|
LIBRARY_PATHS = -L../mbed/TARGET_LPC1768/TOOLCHAIN_GCC_ARM
|
||||||
|
LIBRARIES = -lmbed
|
||||||
|
LINKER_SCRIPT = ../mbed/TARGET_LPC1768/TOOLCHAIN_GCC_ARM/LPC1768.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-m3 -mthumb
|
||||||
|
CC_FLAGS = -c -Wall -Wextra -Wno-unused-parameter -Wno-missing-field-initializers -fmessage-length=0 -fno-exceptions -fno-builtin -ffunction-sections -fdata-sections -funsigned-char -MMD -fno-delete-null-pointer-checks -fomit-frame-pointer -mcpu=cortex-m3 -mthumb -Os -std=gnu99 -DDEVICE_ERROR_PATTERN=1 -D__MBED__=1 -DDEVICE_I2CSLAVE=1 -DTARGET_LIKE_MBED -DDEVICE_PORTOUT=1 -DTARGET_NXP -DTARGET_LPC176X -DDEVICE_PORTIN=1 -DDEVICE_RTC=1 -DTOOLCHAIN_object -D__CMSIS_RTOS -DTOOLCHAIN_GCC -DDEVICE_CAN=1 -DTARGET_LIKE_CORTEX_M3 -DTARGET_CORTEX_M -DARM_MATH_CM3 -DDEVICE_ANALOGOUT=1 -DTARGET_UVISOR_UNSUPPORTED -DTARGET_M3 -DDEVICE_PWMOUT=1 -DDEVICE_INTERRUPTIN=1 -DDEVICE_I2C=1 -DMBED_BUILD_TIMESTAMP=1483402623.08 -D__CORTEX_M3 -DDEVICE_STDIO_MESSAGES=1 -DTARGET_LPC1768 -DTARGET_RELEASE -DDEVICE_PORTINOUT=1 -DDEVICE_SERIAL_FC=1 -DTARGET_MBED_LPC1768 -D__MBED_CMSIS_RTOS_CM -DDEVICE_SLEEP=1 -DTOOLCHAIN_GCC_ARM -DDEVICE_SPI=1 -DDEVICE_ETHERNET=1 -DDEVICE_SPISLAVE=1 -DDEVICE_ANALOGIN=1 -DDEVICE_SERIAL=1 -DDEVICE_SEMIHOST=1 -DDEVICE_DEBUG_AWARENESS=1 -DDEVICE_LOCALFILESYSTEM=1 -include mbed_config.h -MMD -MP
|
||||||
|
CPPC_FLAGS = -c -Wall -Wextra -Wno-unused-parameter -Wno-missing-field-initializers -fmessage-length=0 -fno-exceptions -fno-builtin -ffunction-sections -fdata-sections -funsigned-char -MMD -fno-delete-null-pointer-checks -fomit-frame-pointer -mcpu=cortex-m3 -mthumb -Os -std=gnu++98 -fno-rtti -Wvla -DDEVICE_ERROR_PATTERN=1 -D__MBED__=1 -DDEVICE_I2CSLAVE=1 -DTARGET_LIKE_MBED -DDEVICE_PORTOUT=1 -DTARGET_NXP -DTARGET_LPC176X -DDEVICE_PORTIN=1 -DDEVICE_RTC=1 -DTOOLCHAIN_object -D__CMSIS_RTOS -DTOOLCHAIN_GCC -DDEVICE_CAN=1 -DTARGET_LIKE_CORTEX_M3 -DTARGET_CORTEX_M -DARM_MATH_CM3 -DDEVICE_ANALOGOUT=1 -DTARGET_UVISOR_UNSUPPORTED -DTARGET_M3 -DDEVICE_PWMOUT=1 -DDEVICE_INTERRUPTIN=1 -DDEVICE_I2C=1 -DMBED_BUILD_TIMESTAMP=1483402623.08 -D__CORTEX_M3 -DDEVICE_STDIO_MESSAGES=1 -DTARGET_LPC1768 -DTARGET_RELEASE -DDEVICE_PORTINOUT=1 -DDEVICE_SERIAL_FC=1 -DTARGET_MBED_LPC1768 -D__MBED_CMSIS_RTOS_CM -DDEVICE_SLEEP=1 -DTOOLCHAIN_GCC_ARM -DDEVICE_SPI=1 -DDEVICE_ETHERNET=1 -DDEVICE_SPISLAVE=1 -DDEVICE_ANALOGIN=1 -DDEVICE_SERIAL=1 -DDEVICE_SEMIHOST=1 -DDEVICE_DEBUG_AWARENESS=1 -DDEVICE_LOCALFILESYSTEM=1 -include mbed_config.h -MMD -MP
|
||||||
|
ASM_FLAGS = -x assembler-with-cpp -D__CMSIS_RTOS -D__MBED_CMSIS_RTOS_CM -D__CORTEX_M3 -DARM_MATH_CM3 -c -Wall -Wextra -Wno-unused-parameter -Wno-missing-field-initializers -fmessage-length=0 -fno-exceptions -fno-builtin -ffunction-sections -fdata-sections -funsigned-char -MMD -fno-delete-null-pointer-checks -fomit-frame-pointer -mcpu=cortex-m3 -mthumb -Os
|
||||||
|
CC_SYMBOLS = -DDEVICE_ERROR_PATTERN=1 -D__MBED__=1 -DDEVICE_I2CSLAVE=1 -DTARGET_LIKE_MBED -DDEVICE_PORTOUT=1 -DTARGET_NXP -DTARGET_LPC176X -DDEVICE_PORTIN=1 -DDEVICE_RTC=1 -DTOOLCHAIN_object -D__CMSIS_RTOS -DTOOLCHAIN_GCC -DDEVICE_CAN=1 -DTARGET_LIKE_CORTEX_M3 -DTARGET_CORTEX_M -DARM_MATH_CM3 -DDEVICE_ANALOGOUT=1 -DTARGET_UVISOR_UNSUPPORTED -DTARGET_M3 -DDEVICE_PWMOUT=1 -DDEVICE_INTERRUPTIN=1 -DDEVICE_I2C=1 -DMBED_BUILD_TIMESTAMP=1483402623.08 -D__CORTEX_M3 -DDEVICE_STDIO_MESSAGES=1 -DTARGET_LPC1768 -DTARGET_RELEASE -DDEVICE_PORTINOUT=1 -DDEVICE_SERIAL_FC=1 -DTARGET_MBED_LPC1768 -D__MBED_CMSIS_RTOS_CM -DDEVICE_SLEEP=1 -DTOOLCHAIN_GCC_ARM -DDEVICE_SPI=1 -DDEVICE_ETHERNET=1 -DDEVICE_SPISLAVE=1 -DDEVICE_ANALOGIN=1 -DDEVICE_SERIAL=1 -DDEVICE_SEMIHOST=1 -DDEVICE_DEBUG_AWARENESS=1 -DDEVICE_LOCALFILESYSTEM=1
|
||||||
|
|
||||||
|
LD_FLAGS =-Wl,--gc-sections -Wl,--wrap,main -Wl,--wrap,_malloc_r -Wl,--wrap,_free_r -Wl,--wrap,_realloc_r -Wl,--wrap,_calloc_r -mcpu=cortex-m3 -mthumb
|
||||||
|
LD_SYS_LIBS = -lstdc++ -lsupc++ -lm -lc -lgcc -lnosys
|
||||||
|
|
||||||
|
|
||||||
|
ifeq ($(DEBUG), 1)
|
||||||
|
CC_FLAGS += -DDEBUG -O0
|
||||||
|
else
|
||||||
|
CC_FLAGS += -DNDEBUG -Os
|
||||||
|
endif
|
||||||
|
|
||||||
|
|
||||||
|
.PHONY: all lst size
|
||||||
|
|
||||||
|
all: $(PROJECT).bin $(PROJECT).hex size
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
.asm.o:
|
||||||
|
+@$(call MAKEDIR,$(dir $@))
|
||||||
|
$(CC) $(CPU) -c $(ASM_FLAGS) $(CC_SYMBOLS) $(INCLUDE_PATHS) -o $@ $<
|
||||||
|
.s.o:
|
||||||
|
+@$(call MAKEDIR,$(dir $@))
|
||||||
|
$(CC) $(CPU) -c $(ASM_FLAGS) $(CC_SYMBOLS) $(INCLUDE_PATHS) -o $@ $<
|
||||||
|
.S.o:
|
||||||
|
+@$(call MAKEDIR,$(dir $@))
|
||||||
|
$(CC) $(CPU) -c $(ASM_FLAGS) $(CC_SYMBOLS) $(INCLUDE_PATHS) -o $@ $<
|
||||||
|
|
||||||
|
.c.o:
|
||||||
|
+@$(call MAKEDIR,$(dir $@))
|
||||||
|
$(CC) $(CC_FLAGS) $(CC_SYMBOLS) $(INCLUDE_PATHS) -o $@ $<
|
||||||
|
|
||||||
|
.cpp.o:
|
||||||
|
+@$(call MAKEDIR,$(dir $@))
|
||||||
|
$(CPP) $(CPPC_FLAGS) $(CC_SYMBOLS) $(INCLUDE_PATHS) -o $@ $<
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
$(PROJECT).elf: $(OBJECTS) $(SYS_OBJECTS) $(LINKER_SCRIPT)
|
||||||
|
$(LD) $(LD_FLAGS) -T$(filter %.ld, $^) $(LIBRARY_PATHS) -o $@ $(filter %.o, $^) -Wl,--start-group $(LIBRARIES) $(LD_SYS_LIBS) -Wl,--end-group
|
||||||
|
|
||||||
|
$(PROJECT).bin: $(PROJECT).elf
|
||||||
|
$(OBJCOPY) -O binary $< $@
|
||||||
|
|
||||||
|
$(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)
|
||||||
|
|
||||||
|
|
||||||
|
endif
|
1
smoother/mbed.bld
Normal file
1
smoother/mbed.bld
Normal file
@ -0,0 +1 @@
|
|||||||
|
http://mbed.org/users/mbed_official/code/mbed/builds/9baf128c2fab
|
24
smoother/mbed_blinky.uvoptx
Normal file
24
smoother/mbed_blinky.uvoptx
Normal file
@ -0,0 +1,24 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<ProjectOpt xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="project_optx.xsd">
|
||||||
|
<SchemaVersion>1.0</SchemaVersion>
|
||||||
|
<Target>
|
||||||
|
<TargetName>mbed_blinky</TargetName>
|
||||||
|
<ToolsetNumber>0x4</ToolsetNumber>
|
||||||
|
<ToolsetName>ARM-ADS</ToolsetName>
|
||||||
|
<TargetOption>
|
||||||
|
<DebugOpt>
|
||||||
|
<uSim>0</uSim>
|
||||||
|
<uTrg>1</uTrg>
|
||||||
|
<nTsel>12</nTsel>
|
||||||
|
<pMon>BIN\CMSIS_AGDI.dll</pMon>
|
||||||
|
</DebugOpt>
|
||||||
|
<TargetDriverDllRegistry>
|
||||||
|
<SetRegEntry>
|
||||||
|
<Number>0</Number>
|
||||||
|
<Key>CMSIS_AGDI</Key>
|
||||||
|
<Name>UL2CM3(-S0 -C0 -P0 -FD10000000 -FCFE0 -FN1 -FF0LPC_IAP_512 -FS00 -FL080000 -FP0($$Device:LPC1768$Flash\LPC_IAP_512.FLM))</Name>
|
||||||
|
</SetRegEntry>
|
||||||
|
</TargetDriverDllRegistry>
|
||||||
|
</TargetOption>
|
||||||
|
</Target>
|
||||||
|
</ProjectOpt>
|
1162
smoother/mbed_blinky.uvprojx
Normal file
1162
smoother/mbed_blinky.uvprojx
Normal file
File diff suppressed because it is too large
Load Diff
13
smoother/mbed_config.h
Normal file
13
smoother/mbed_config.h
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
// Automatically generated configuration file.
|
||||||
|
// DO NOT EDIT, content will be overwritten.
|
||||||
|
|
||||||
|
#ifndef __MBED_CONFIG_DATA__
|
||||||
|
#define __MBED_CONFIG_DATA__
|
||||||
|
|
||||||
|
// Configuration parameters
|
||||||
|
#define MBED_CONF_PLATFORM_STDIO_BAUD_RATE 9600 // set by library:platform
|
||||||
|
#define MBED_CONF_PLATFORM_DEFAULT_SERIAL_BAUD_RATE 9600 // set by library:platform
|
||||||
|
#define MBED_CONF_PLATFORM_STDIO_FLUSH_AT_EXIT 1 // set by library:platform
|
||||||
|
#define MBED_CONF_PLATFORM_STDIO_CONVERT_NEWLINES 0 // set by library:platform
|
||||||
|
|
||||||
|
#endif
|
12
smoother/src/main.cpp
Normal file
12
smoother/src/main.cpp
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
#include "mbed.h"
|
||||||
|
|
||||||
|
DigitalOut myled(LED1);
|
||||||
|
|
||||||
|
int main() {
|
||||||
|
while(1) {
|
||||||
|
myled = 1;
|
||||||
|
wait(0.2);
|
||||||
|
myled = 0;
|
||||||
|
wait(0.2);
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user