stm8 : new target
[openocd.git] / contrib / loaders / erase_check / Makefile
1 BIN2C = ../../../src/helper/bin2char.sh
2
3 ARM_CROSS_COMPILE ?= arm-none-eabi-
4 ARM_AS ?= $(ARM_CROSS_COMPILE)as
5 ARM_OBJCOPY ?= $(ARM_CROSS_COMPILE)objcopy
6
7 ARM_AFLAGS = -EL
8
9 STM8_CROSS_COMPILE ?= stm8-
10 STM8_AS ?= $(STM8_CROSS_COMPILE)as
11 STM8_OBJCOPY ?= $(STM8_CROSS_COMPILE)objcopy
12
13 STM8_AFLAGS =
14
15 arm: armv4_5_erase_check.inc armv7m_erase_check.inc armv7m_0_erase_check.inc
16
17 armv4_5_%.elf: armv4_5_%.s
18 $(ARM_AS) $(ARM_AFLAGS) $< -o $@
19
20 armv4_5_%.bin: armv4_5_%.elf
21 $(ARM_OBJCOPY) -Obinary $< $@
22
23 armv4_5_%.inc: armv4_5_%.bin
24 $(BIN2C) < $< > $@
25
26 armv7m_%.elf: armv7m_%.s
27 $(ARM_AS) $(ARM_AFLAGS) $< -o $@
28
29 armv7m_%.bin: armv7m_%.elf
30 $(ARM_OBJCOPY) -Obinary $< $@
31
32 armv7m_%.inc: armv7m_%.bin
33 $(BIN2C) < $< > $@
34
35 stm8: stm8_erase_check.inc
36
37 stm8_%.elf: stm8_%.s
38 $(STM8_AS) $(STM8_AFLAGS) $< -o $@
39
40 stm8_%.bin: stm8_%.elf
41 $(STM8_OBJCOPY) -Obinary $< $@
42
43 stm8_%.inc: stm8_%.bin
44 $(BIN2C) < $< > $@
45
46 clean:
47 -rm -f *.elf *.bin *.inc