Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Move all makefiles from examples into using the common makefile.
- Loading branch information
Showing
23 changed files
with
96 additions
and
784 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,43 +1,11 @@ | ||
TARGET:=GPIO | ||
|
||
all : flash | ||
|
||
PREFIX:=riscv64-unknown-elf | ||
|
||
GPIO_Toggle:=EXAM/GPIO/GPIO_Toggle/User | ||
|
||
EVT:=../../ch32v003evt | ||
|
||
MINICHLINK:=../../minichlink | ||
CH32V003FUN:=../../ch32v003fun | ||
|
||
CFLAGS:= \ | ||
-g -Os -flto -ffunction-sections \ | ||
-static-libgcc \ | ||
-march=rv32ec \ | ||
-mabi=ilp32e \ | ||
-I/usr/include/newlib \ | ||
-I$(CH32V003FUN) \ | ||
-nostdlib \ | ||
-I. -DTINYVECTOR -Wall | ||
CFLAGS+=-DTINYVECTOR | ||
ADDITIONAL_C_FILES+=wiring.c | ||
|
||
LDFLAGS:=-T $(CH32V003FUN)/ch32v003fun.ld -Wl,--gc-sections -L../../misc -lgcc | ||
include ../../ch32v003fun/ch32v003fun.mk | ||
|
||
SYSTEM_C:=$(CH32V003FUN)/ch32v003fun.c | ||
|
||
$(TARGET).elf : $(SYSTEM_C) $(TARGET).c wiring.c | ||
$(PREFIX)-gcc -o $@ $^ $(CFLAGS) $(LDFLAGS) | ||
|
||
$(TARGET).bin : $(TARGET).elf | ||
$(PREFIX)-size $^ | ||
$(PREFIX)-objdump -S $^ > $(TARGET).lst | ||
$(PREFIX)-objdump -t $^ > $(TARGET).map | ||
$(PREFIX)-objcopy -O binary $< $(TARGET).bin | ||
$(PREFIX)-objcopy -O ihex $< $(TARGET).hex | ||
|
||
flash : $(TARGET).bin | ||
$(MINICHLINK)/minichlink -w $< flash -b | ||
|
||
clean : | ||
rm -rf $(TARGET).elf $(TARGET).bin $(TARGET).hex $(TARGET).lst $(TARGET).map $(TARGET).hex | ||
all : flash | ||
flash : cv_flash | ||
clean : cv_clean | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,43 +1,11 @@ | ||
TARGET:=GPIO_analogRead | ||
|
||
all : flash | ||
|
||
PREFIX:=riscv64-unknown-elf | ||
|
||
GPIO_Toggle:=EXAM/GPIO/GPIO_Toggle/User | ||
|
||
EVT:=../../ch32v003evt | ||
|
||
MINICHLINK:=../../minichlink | ||
CH32V003FUN:=../../ch32v003fun | ||
|
||
CFLAGS:= \ | ||
-g -Os -flto -ffunction-sections \ | ||
-static-libgcc \ | ||
-march=rv32ec \ | ||
-mabi=ilp32e \ | ||
-I/usr/include/newlib \ | ||
-I$(CH32V003FUN) \ | ||
-nostdlib \ | ||
-I. -DTINYVECTOR -Wall | ||
CFLAGS+=-DTINYVECTOR | ||
ADDITIONAL_C_FILES+=wiring.c | ||
|
||
LDFLAGS:=-T $(CH32V003FUN)/ch32v003fun.ld -Wl,--gc-sections -L../../misc -lgcc | ||
include ../../ch32v003fun/ch32v003fun.mk | ||
|
||
SYSTEM_C:=$(CH32V003FUN)/ch32v003fun.c | ||
|
||
$(TARGET).elf : $(SYSTEM_C) $(TARGET).c wiring.c | ||
$(PREFIX)-gcc -o $@ $^ $(CFLAGS) $(LDFLAGS) | ||
|
||
$(TARGET).bin : $(TARGET).elf | ||
$(PREFIX)-size $^ | ||
$(PREFIX)-objdump -S $^ > $(TARGET).lst | ||
$(PREFIX)-objdump -t $^ > $(TARGET).map | ||
$(PREFIX)-objcopy -O binary $< $(TARGET).bin | ||
$(PREFIX)-objcopy -O ihex $< $(TARGET).hex | ||
|
||
flash : $(TARGET).bin | ||
$(MINICHLINK)/minichlink -w $< flash -b | ||
|
||
clean : | ||
rm -rf $(TARGET).elf $(TARGET).bin $(TARGET).hex $(TARGET).lst $(TARGET).map $(TARGET).hex | ||
all : flash | ||
flash : cv_flash | ||
clean : cv_clean | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,51 +1,10 @@ | ||
TARGET:=MCOtest | ||
|
||
all : flash | ||
|
||
PREFIX:=riscv64-unknown-elf | ||
|
||
GPIO_Toggle:=EXAM/GPIO/GPIO_Toggle/User | ||
|
||
EVT:=../../ch32v003evt | ||
|
||
MINICHLINK:=../../minichlink | ||
|
||
ifeq ($(OS),Windows_NT) | ||
# On Windows, all the major RISC-V GCC installs are missing the -ec libgcc. | ||
LIB_GCC=../../misc/libgcc.a | ||
else | ||
LIB_GCC=-lgcc | ||
endif | ||
|
||
CH32V003FUN:=../../ch32v003fun | ||
CFLAGS+=-DTINYVECTOR -DSTDOUT_UART | ||
|
||
CFLAGS:= \ | ||
-g -Os -flto -ffunction-sections \ | ||
-static-libgcc $(LIB_GCC) \ | ||
-march=rv32ec \ | ||
-mabi=ilp32e \ | ||
-I/usr/include/newlib \ | ||
-I$(CH32V003FUN) \ | ||
-nostdlib \ | ||
-I. -DSTDOUT_UART -DTINYVECTOR -Wall | ||
include ../../ch32v003fun/ch32v003fun.mk | ||
|
||
LDFLAGS:=-T $(CH32V003FUN)/ch32v003fun.ld -Wl,--gc-sections | ||
|
||
SYSTEM_C:=$(CH32V003FUN)/ch32v003fun.c | ||
|
||
$(TARGET).elf : $(SYSTEM_C) $(TARGET).c | ||
$(PREFIX)-gcc -o $@ $^ $(CFLAGS) $(LDFLAGS) | ||
|
||
$(TARGET).bin : $(TARGET).elf | ||
$(PREFIX)-size $^ | ||
$(PREFIX)-objdump -S $^ > $(TARGET).lst | ||
$(PREFIX)-objdump -t $^ > $(TARGET).map | ||
$(PREFIX)-objcopy -O binary $< $(TARGET).bin | ||
$(PREFIX)-objcopy -O ihex $< $(TARGET).hex | ||
|
||
flash : $(TARGET).bin | ||
$(MINICHLINK)/minichlink -w $< flash -b | ||
|
||
clean : | ||
rm -rf $(TARGET).elf $(TARGET).bin $(TARGET).hex $(TARGET).lst $(TARGET).map $(TARGET).hex | ||
all : flash | ||
flash : cv_flash | ||
clean : cv_clean | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,41 +1,9 @@ | ||
TARGET:=adc_dma_opamp | ||
|
||
all : flash | ||
|
||
PREFIX:=riscv64-unknown-elf | ||
|
||
GPIO_Toggle:=EXAM/GPIO/GPIO_Toggle/User | ||
|
||
CH32V003FUN:=../../ch32v003fun | ||
MINICHLINK:=../../minichlink | ||
|
||
CFLAGS:= \ | ||
-g -Os -flto -ffunction-sections \ | ||
-static-libgcc \ | ||
-march=rv32ec \ | ||
-mabi=ilp32e \ | ||
-I/usr/include/newlib \ | ||
-I$(CH32V003FUN) \ | ||
-nostdlib \ | ||
-I. -DSTDOUT_UART -Wall | ||
include ../../ch32v003fun/ch32v003fun.mk | ||
|
||
LDFLAGS:=-T $(CH32V003FUN)/ch32v003fun.ld -Wl,--gc-sections -L../../misc -lgcc | ||
|
||
SYSTEM_C:=$(CH32V003FUN)/ch32v003fun.c | ||
|
||
$(TARGET).elf : $(SYSTEM_C) $(TARGET).c | ||
$(PREFIX)-gcc -o $@ $^ $(CFLAGS) $(LDFLAGS) | ||
|
||
$(TARGET).bin : $(TARGET).elf | ||
$(PREFIX)-size $^ | ||
$(PREFIX)-objdump -S $^ > $(TARGET).lst | ||
$(PREFIX)-objdump -t $^ > $(TARGET).map | ||
$(PREFIX)-objcopy -O binary $< $(TARGET).bin | ||
$(PREFIX)-objcopy -O ihex $< $(TARGET).hex | ||
|
||
flash : $(TARGET).bin | ||
$(MINICHLINK)/minichlink -w $< flash -b | ||
all : flash | ||
flash : cv_flash | ||
clean : cv_clean | ||
|
||
clean : | ||
rm -rf $(TARGET).elf $(TARGET).bin $(TARGET).hex $(TARGET).lst $(TARGET).map $(TARGET).hex | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,41 +1,9 @@ | ||
TARGET:=adc_polled | ||
|
||
all : flash | ||
|
||
PREFIX:=riscv64-unknown-elf | ||
|
||
GPIO_Toggle:=EXAM/GPIO/GPIO_Toggle/User | ||
|
||
CH32V003FUN:=../../ch32v003fun | ||
MINICHLINK:=../../minichlink | ||
|
||
CFLAGS:= \ | ||
-g -Os -flto -ffunction-sections \ | ||
-static-libgcc \ | ||
-march=rv32ec \ | ||
-mabi=ilp32e \ | ||
-I/usr/include/newlib \ | ||
-I$(CH32V003FUN) \ | ||
-nostdlib \ | ||
-I. -DSTDOUT_UART -Wall | ||
include ../../ch32v003fun/ch32v003fun.mk | ||
|
||
LDFLAGS:=-T $(CH32V003FUN)/ch32v003fun.ld -Wl,--gc-sections -L../../misc -lgcc | ||
|
||
SYSTEM_C:=$(CH32V003FUN)/ch32v003fun.c | ||
|
||
$(TARGET).elf : $(SYSTEM_C) $(TARGET).c | ||
$(PREFIX)-gcc -o $@ $^ $(CFLAGS) $(LDFLAGS) | ||
|
||
$(TARGET).bin : $(TARGET).elf | ||
$(PREFIX)-size $^ | ||
$(PREFIX)-objdump -S $^ > $(TARGET).lst | ||
$(PREFIX)-objdump -t $^ > $(TARGET).map | ||
$(PREFIX)-objcopy -O binary $< $(TARGET).bin | ||
$(PREFIX)-objcopy -O ihex $< $(TARGET).hex | ||
|
||
flash : $(TARGET).bin | ||
$(MINICHLINK)/minichlink -w $< flash -b | ||
all : flash | ||
flash : cv_flash | ||
clean : cv_clean | ||
|
||
clean : | ||
rm -rf $(TARGET).elf $(TARGET).bin $(TARGET).hex $(TARGET).lst $(TARGET).map $(TARGET).hex | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,43 +1,9 @@ | ||
TARGET:=blink | ||
|
||
all : flash | ||
|
||
PREFIX:=riscv64-unknown-elf | ||
|
||
GPIO_Toggle:=EXAM/GPIO/GPIO_Toggle/User | ||
|
||
EVT:=../../ch32v003evt | ||
|
||
MINICHLINK:=../../minichlink | ||
CH32V003FUN:=../../ch32v003fun | ||
|
||
CFLAGS:= \ | ||
-g -Os -flto -ffunction-sections \ | ||
-static-libgcc \ | ||
-march=rv32ec \ | ||
-mabi=ilp32e \ | ||
-I/usr/include/newlib \ | ||
-I$(CH32V003FUN) \ | ||
-nostdlib \ | ||
-I. -DTINYVECTOR -Wall | ||
include ../../ch32v003fun/ch32v003fun.mk | ||
|
||
LDFLAGS:=-T $(CH32V003FUN)/ch32v003fun.ld -Wl,--gc-sections -L../../misc -lgcc | ||
|
||
SYSTEM_C:=$(CH32V003FUN)/ch32v003fun.c | ||
|
||
$(TARGET).elf : $(SYSTEM_C) $(TARGET).c | ||
$(PREFIX)-gcc -o $@ $^ $(CFLAGS) $(LDFLAGS) | ||
|
||
$(TARGET).bin : $(TARGET).elf | ||
$(PREFIX)-size $^ | ||
$(PREFIX)-objdump -S $^ > $(TARGET).lst | ||
$(PREFIX)-objdump -t $^ > $(TARGET).map | ||
$(PREFIX)-objcopy -O binary $< $(TARGET).bin | ||
$(PREFIX)-objcopy -O ihex $< $(TARGET).hex | ||
|
||
flash : $(TARGET).bin | ||
$(MINICHLINK)/minichlink -w $< flash -b | ||
all : flash | ||
flash : cv_flash | ||
clean : cv_clean | ||
|
||
clean : | ||
rm -rf $(TARGET).elf $(TARGET).bin $(TARGET).hex $(TARGET).lst $(TARGET).map $(TARGET).hex | ||
|
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,43 +1,8 @@ | ||
TARGET:=bootload | ||
|
||
all : flash | ||
|
||
PREFIX:=riscv64-unknown-elf | ||
|
||
GPIO_Toggle:=EXAM/GPIO/GPIO_Toggle/User | ||
|
||
EVT:=../../ch32v003evt | ||
|
||
MINICHLINK:=../../minichlink | ||
CH32V003FUN:=../../ch32v003fun | ||
|
||
CFLAGS:= \ | ||
-g -Os -flto -ffunction-sections \ | ||
-static-libgcc \ | ||
-march=rv32ec \ | ||
-mabi=ilp32e \ | ||
-I/usr/include/newlib \ | ||
-I$(CH32V003FUN) \ | ||
-nostdlib \ | ||
-I. -DCUSTOM_INTERRUPT_VECTOR | ||
include ../../ch32v003fun/ch32v003fun.mk | ||
|
||
LDFLAGS:=-T $(CH32V003FUN)/ch32v003fun-bootloader.ld -Wl,--gc-sections -L../../misc -lgcc | ||
|
||
SYSTEM_C:=$(CH32V003FUN)/ch32v003fun.c | ||
|
||
$(TARGET).elf : $(SYSTEM_C) $(TARGET).c | ||
$(PREFIX)-gcc -o $@ $^ $(CFLAGS) $(LDFLAGS) | ||
|
||
$(TARGET).bin : $(TARGET).elf | ||
$(PREFIX)-size $^ | ||
$(PREFIX)-objdump -S $^ > $(TARGET).lst | ||
$(PREFIX)-objdump -t $^ > $(TARGET).map | ||
$(PREFIX)-objcopy -O binary $< $(TARGET).bin | ||
$(PREFIX)-objcopy -O ihex $< $(TARGET).hex | ||
|
||
flash : $(TARGET).bin | ||
$(MINICHLINK)/minichlink -h -U -w $< bootloader -B | ||
|
||
clean : | ||
rm -rf $(TARGET).elf $(TARGET).bin $(TARGET).hex $(TARGET).lst $(TARGET).map $(TARGET).hex | ||
all : flash | ||
flash : cv_flash | ||
clean : cv_clean | ||
|
Oops, something went wrong.