Merge pull request #1980 from cesanta/ti-nodocker

Get rid of Docker (TI), part 1
This commit is contained in:
Sergio R. Caprile 2023-01-20 16:21:45 -03:00 committed by GitHub
commit 5f00e4d34d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 4 additions and 22 deletions

View File

@ -1,8 +1,5 @@
TARGET = firmware
ROOT ?= $(realpath $(CURDIR)/../../..)
D ?= docker
DOCKER ?= $(D) run --rm -v $(ROOT):$(ROOT) -w $(CURDIR) mdashnet/armgcc
CROSS ?= arm-none-eabi
CFLAGS ?= -W -Wall -Wextra -Werror -Wundef -Wshadow -Wdouble-promotion \
-Wformat-truncation -fno-common -Wconversion \
-g3 -Os -ffunction-sections -fdata-sections -I. -I$(ROOT) \
@ -18,21 +15,10 @@ SOURCES = boot.c main.c syscalls.c \
all build example: $(TARGET).bin
$(TARGET).bin: $(TARGET).elf
$(DOCKER) $(CROSS)-objcopy -O binary $< $@
arm-none-eabi-objcopy -O binary $< $@
$(TARGET).elf: $(SOURCES) mcu.h
$(DOCKER) $(CROSS)-gcc $(SOURCES) $(CFLAGS) $(LDFLAGS) -o $@
# Build on Windows. Download Win32 Zip from ARM GCC downloads, unzip to c:\armgcc
ARMGCC ?= c:/armgcc
windows: $(TARGET).bin
windows: CROSS = $(ARMGCC)/bin/arm-none-eabi
windows: DOCKER =
# Show top 10 stack-hungry functions
su: CFLAGS += -fstack-usage
su: $(TARGET).elf
cat *.su | sort -rnk2 | head -10
arm-none-eabi-gcc $(SOURCES) $(CFLAGS) $(LDFLAGS) -o $@
clean:
@rm -rf $(TARGET).* *.su

View File

@ -22,9 +22,7 @@ which implements the following:
- [ARM GCC](http://mongoose.ws/tutorials/tools/#arm-gcc)
- [Uniflash](https://mongoose.ws/tutorials/ti/ek-tm4c1294xl-baremetal/#build-and-run) for flashing
The Makefile defaults to using Docker for the compiler, so you don't actually need to install it if you are using a Linux/Mac workstation. If you are not, or you want to run your local ARM compiler, just append `DOCKER=` to the make commands depicted below to call the compiler directly; it must be in your executable path.
In any case, the links above will send you to tutorials on how to install each of those tools in your workstation for Linux, Mac, and Windows.
The links above will send you to tutorials on how to install each of those tools in your workstation for Linux, Mac, and Windows.
## Usage

View File

@ -16,9 +16,7 @@ It implements the following:
- [ARM GCC](http://mongoose.ws/tutorials/tools/#arm-gcc)
- [Uniflash](https://mongoose.ws/tutorials/ti/ek-tm4c1294xl-baremetal/#build-and-run) for flashing
The Makefile defaults to using Docker for the compiler, so you don't actually need to install it if you are using a Linux/Mac workstation. If you are not, or you want to run your local ARM compiler, just append `DOCKER=` to the make commands depicted below to call the compiler directly; it must be in your executable path.
In any case, the links above will send you to tutorials on how to install each of those tools in your workstation for Linux, Mac, and Windows.
The links above will send you to tutorials on how to install each of those tools in your workstation for Linux, Mac, and Windows.
You'll also need _git_ so the Makefile can clone the FreeRTOS-Kernel repository. We assume you have it since you got to get this repository somehow. If you don't, and don't want to install it, just get the proper [FreeRTOS-Kernel](https://github.com/FreeRTOS/FreeRTOS-Kernel) version (see the Makefile) from its repository, as you did with the Mongoose repository.