flash/nor: add support for Nuvoton NPCX series flash
[openocd.git] / contrib / loaders / flash / npcx / Makefile
1 # SPDX-License-Identifier: GPL-2.0-or-later
2
3 BIN2C = ../../../../src/helper/bin2char.sh
4
5 # Toolchain used in makefile
6 CROSS_COMPILE ?= arm-none-eabi-
7 CC = $(CROSS_COMPILE)gcc
8 CPLUS = $(CROSS_COMPILE)g++
9 CPP = $(CROSS_COMPILE)cpp
10 LD = $(CROSS_COMPILE)gcc
11 AS = $(CROSS_COMPILE)as
12 OBJCOPY = $(CROSS_COMPILE)objcopy
13 OBJDUMP = $(CROSS_COMPILE)objdump
14 OBJSIZE = $(CROSS_COMPILE)size
15
16 TARGET = npcx_algo
17 OBJS := npcx_flash.o
18 FLAGS = -mthumb -Os -ffunction-sections -fdata-sections -g -gdwarf-3 --specs=nano.specs
19 FLAGS += -gstrict-dwarf -Wall -fno-strict-aliasing --asm
20
21 CFLAGS = -c -I. -mcpu=cortex-m4 -fpack-struct
22
23 PRE_LD_FILE = npcx_flash.lds
24 LD_FILE = npcx_flash_generated.lds
25 LDFLAGS = -Wl,-Map,lfw.map -Wl,-T$(LD_FILE) -nostartfiles
26
27 all: $(TARGET).inc
28
29 # Implicit rules
30 %.o: %.c
31 -@ echo CC $@ from $<
32 @$(CC) $< $(FLAGS) $(CFLAGS) -o $@
33
34 $(LD_FILE): $(PRE_LD_FILE)
35 -@ echo Generate $@ from $<
36 -@$(CPP) $(PRE_LD_FILE) | grep -v '^#' >>$(LD_FILE)
37
38 $(TARGET).elf: $(OBJS) $(LD_FILE)
39 -@ echo LD $@ from $<
40 @$(LD) -o $@ $< $(FLAGS) $(LDFLAGS)
41
42 %.bin: %.elf
43 -@ echo OBJCOPY $@ from $<
44 -@ $(OBJCOPY) $< -O binary $@
45 -@ $(OBJSIZE) $< --format=berkeley
46
47 %.inc: %.bin
48 @echo 'Building target: $@'
49 @echo 'Invoking Bin2Char Script'
50 $(BIN2C) < $< > $@
51 rm $< $*.elf
52 @echo 'Finished building target: $@'
53 @echo ' '
54
55 clean:
56 @echo 'Cleaning Targets and Build Artifacts'
57 rm -rf *.inc *.bin *.elf *.map
58 rm -rf *.o *.d
59 rm -rf $(LD_FILE)
60 @echo 'Finished clean'
61 @echo ' '
62
63 .PRECIOUS: %.bin
64
65 .PHONY: all clean

Linking to existing account procedure

If you already have an account and want to add another login method you MUST first sign in with your existing account and then change URL to read https://review.openocd.org/login/?link to get to this page again but this time it'll work for linking. Thank you.

SSH host keys fingerprints

1024 SHA256:YKx8b7u5ZWdcbp7/4AeXNaqElP49m6QrwfXaqQGJAOk gerrit-code-review@openocd.zylin.com (DSA)
384 SHA256:jHIbSQa4REvwCFG4cq5LBlBLxmxSqelQPem/EXIrxjk gerrit-code-review@openocd.org (ECDSA)
521 SHA256:UAOPYkU9Fjtcao0Ul/Rrlnj/OsQvt+pgdYSZ4jOYdgs gerrit-code-review@openocd.org (ECDSA)
256 SHA256:A13M5QlnozFOvTllybRZH6vm7iSt0XLxbA48yfc2yfY gerrit-code-review@openocd.org (ECDSA)
256 SHA256:spYMBqEYoAOtK7yZBrcwE8ZpYt6b68Cfh9yEVetvbXg gerrit-code-review@openocd.org (ED25519)
+--[ED25519 256]--+
|=..              |
|+o..   .         |
|*.o   . .        |
|+B . . .         |
|Bo. = o S        |
|Oo.+ + =         |
|oB=.* = . o      |
| =+=.+   + E     |
|. .=o   . o      |
+----[SHA256]-----+
2048 SHA256:0Onrb7/PHjpo6iVZ7xQX2riKN83FJ3KGU0TvI0TaFG4 gerrit-code-review@openocd.zylin.com (RSA)