commit 056c15496411dcc4edfbf92eeb6cefa4dce6ea6b parent ea5f607f16c3400d06888bcf8b3b0dedbb569b6d Author: Matsuda Kenji <info@mtkn.jp> Date: Wed, 28 Feb 2024 09:27:06 +0900 try to use c file Diffstat:
M | ex3/Makefile | | | 9 | ++++++--- |
A | ex3/main.c | | | 0 | |
R | ex3/main.s -> ex3/start.s | | | 0 |
3 files changed, 6 insertions(+), 3 deletions(-)
diff --git a/ex3/Makefile b/ex3/Makefile @@ -6,7 +6,7 @@ BIN2UF2 = ../tools/bin2uf2 MCPU = -mcpu=cortex-m0plus ASFLAGS = $(MCPU) -CFLAGS = $(MCPU) -ffreestanding -nostartfiles -O0 -fpic -mthumb -c +CFLAGS = $(MCPU) -ffreestanding -nostartfiles -O0 -fpic -c LDFLAGS = --no-relax -nostdlib all: tools a.uf2 @@ -18,8 +18,11 @@ clean: .s.o: $(AS) $(ASFLAGS) -o $@ $< -a.elf: boot2.o main.o memmap.ld - $(LD) $(LDFLAGS) -o $@ -T memmap.ld boot2.o main.o +.c.o: + $(CC) $(CFLAGS) -o $@ $< + +a.elf: boot2.o start.o main.o memmap.ld + $(LD) $(LDFLAGS) -o $@ -T memmap.ld boot2.o start.o a.bin: a.elf $(OBJCOPY) -O binary a.elf $@ diff --git a/ex3/main.c b/ex3/main.c diff --git a/ex3/main.s b/ex3/start.s