Now fetching libgcc.a from upstream properly

This commit is contained in:
Imbus 2025-02-12 15:37:45 +01:00
parent e0d4a112c0
commit c8bf60cada

View file

@ -1,5 +1,5 @@
REV := master
BASE := https://raw.githubusercontent.com/cnlohr/ch32v003fun/$(REV)/ch32fun
BASE := https://raw.githubusercontent.com/cnlohr/ch32v003fun/$(REV)
CURL_FLAGS := -O -\# --fail --location --tlsv1.3 --proto =https --max-time 300
TARGET = blink
@ -38,7 +38,7 @@ EXTFLAGS := -march=rv32ec \
default: $(TARGET).bin
$(TARGET).elf: $(SRC) | ch32v003.ld ch32fun.h ch32v003hw.h
$(TARGET).elf: $(SRC) libgcc.a | ch32v003.ld ch32fun.h ch32v003hw.h
@echo CC $@
@$(CC) $(CFLAGS) $(LDFLAGS) $(EXTFLAGS) -o $@ $^
@ -52,7 +52,11 @@ ch32v003.ld: ch32fun.ld
# Rule to use curl to fetch all files beginning with ch32
ch32%:
@echo "Fetching $@"
@curl $(CURL_FLAGS) $(BASE)/$@
@curl $(CURL_FLAGS) $(BASE)/ch32fun/$@
libgcc.a:
@echo "Fetching $@"
@curl $(CURL_FLAGS) $(BASE)/misc/$@
%.bin : %.elf
$(OBJCOPY) -O binary $< $@
@ -71,7 +75,7 @@ flash2: $(TARGET).bin
clean:
rm -f ch32*.[ch]
rm -f *.{ld,hex,bin,map,lst,elf}
rm -f *.{ld,hex,bin,map,lst,elf,a}
.PHONY: clean flash deps default