Skip to content

Commit

Permalink
Update Makefiles and rename folders and code filenames
Browse files Browse the repository at this point in the history
  • Loading branch information
eric15342335 committed Aug 9, 2024
1 parent 828437e commit d40861c
Show file tree
Hide file tree
Showing 28 changed files with 55 additions and 44 deletions.
19 changes: 14 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,28 @@
default: all-emulator

all-emulator:
$(MAKE) emulator -C rv
$(MAKE) emulator -C rv-asm
$(MAKE) emulator -C tic-tac-toe
$(MAKE) emulator -C paint-cursor
$(MAKE) emulator -C movingnum
$(MAKE) emulator -C paint-exe
$(MAKE) emulator -C paint

all-riscv:
$(MAKE) -C rv
$(MAKE) -C rv-asm
$(MAKE) -C tic-tac-toe
$(MAKE) -C paint-cursor
$(MAKE) -C i2c-comm
$(MAKE) -C movingnum
$(MAKE) -C paint-exe
$(MAKE) -C paint
$(MAKE) -C testing

.PHONY: all-emulator all-riscv
clean:
$(MAKE) -C rv-asm clean
$(MAKE) -C tic-tac-toe clean
$(MAKE) -C paint-cursor clean
$(MAKE) -C i2c-comm clean
$(MAKE) -C movingnum clean
$(MAKE) -C paint clean
$(MAKE) -C testing clean

.PHONY: all-emulator all-riscv clean
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,10 @@ Projects:
* PD2: SW (Analog to Digital PIN)
* PC6: IN (WS2812B Data PIN)

* `paint-exe`
* Paint on `InspireMatrix`
* `paint`
* Paint on `InspireMatrix`.

* `rv`
* `rv-asm`
* Coding RISC-V Compressed instructions on a board with buttons, and showing the result on the matrix.
* Originally from <https://github.com/brian-smith-github/rv>

Expand Down
7 changes: 6 additions & 1 deletion i2c-comm/Makefile
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
TARGET:=i2c
TARGET:=i2c-comm

include ../ch32v003fun/ch32v003fun.mk
clean:
rm -f $(TARGET).elf $(TARGET).hex $(TARGET).bin $(TARGET).map $(TARGET).lst \
$(TARGET).o $(TARGET).d $(TARGET).srec $(TARGET).sym $(TARGET).lss

.PHONY: clean
File renamed without changes.
5 changes: 3 additions & 2 deletions movingnum/Makefile
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
TARGET:= nums
TARGET:= movingnum
include ../ch32v003fun/ch32v003fun.mk
clean:
rm -f $(TARGET).elf $(TARGET).hex $(TARGET).bin $(TARGET).map $(TARGET).lst $(TARGET).o $(TARGET).d $(TARGET).srec $(TARGET).sym $(TARGET).lss
rm -f $(TARGET).elf $(TARGET).hex $(TARGET).bin $(TARGET).map $(TARGET).lst \
$(TARGET).o $(TARGET).d $(TARGET).srec $(TARGET).sym $(TARGET).lss
$(MAKE) -f Makefile-emulator clean

emulator:
Expand Down
6 changes: 3 additions & 3 deletions movingnum/Makefile-emulator
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# cl -MD -GL -D_HAS_EXCEPTIONS=0 -GR- -O1 -Oy- -W4 -sdl -I../emulator/ -I../data nums.c user32.lib
# cl -MD -GL -D_HAS_EXCEPTIONS=0 -GR- -O1 -Oy- -W4 -sdl -I../emulator/ -I../data movingnum.c user32.lib
CC=gcc
INCLUDES=-I../emulator -I../data -I.
CFLAGS=-g -Wall -Wextra -Wshadow -Wswitch -Wfloat-equal $(INCLUDES)
Expand All @@ -9,8 +9,8 @@ ifeq ($(UNAME_S), Darwin)
LDFLAGS += -framework CoreFoundation -framework ApplicationServices -pthread
endif

SRCS=nums.c
TARGET=nums
SRCS=movingnum.c
TARGET=movingnum

SRCS += $(wildcard ../emulator/*.c)
ifneq ($(UNAME_S), Darwin)
Expand Down
File renamed without changes.
Binary file removed paint-cursor/CH32V003J4M6.jpg
Binary file not shown.
3 changes: 2 additions & 1 deletion paint-cursor/Makefile
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
TARGET:= paint-cursor
include ../ch32v003fun/ch32v003fun.mk
clean:
rm -f $(TARGET).elf $(TARGET).hex $(TARGET).bin $(TARGET).map $(TARGET).lst $(TARGET).o $(TARGET).d $(TARGET).srec $(TARGET).sym $(TARGET).lss
rm -f $(TARGET).elf $(TARGET).hex $(TARGET).bin $(TARGET).map $(TARGET).lst \
$(TARGET).o $(TARGET).d $(TARGET).srec $(TARGET).sym $(TARGET).lss
$(MAKE) -f Makefile-emulator clean

emulator:
Expand Down
7 changes: 4 additions & 3 deletions paint-cursor/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# paint-cursor

## Description
`paint-cursor.c`:
* Draw images on InspireMatrix with direction buttons and matrix buttons
* Color is hard-coded in the following, change the value in ```paint-cursor.c``` for different colors

* `paint-cursor.c`:
* Draw images on InspireMatrix with direction buttons and matrix buttons
* Color is hard-coded in the following, change the value in ```paint-cursor.c``` for different colors
8 changes: 0 additions & 8 deletions paint-exe/README.md

This file was deleted.

3 changes: 2 additions & 1 deletion paint-exe/Makefile → paint/Makefile
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
TARGET:= paint
include ../ch32v003fun/ch32v003fun.mk
clean:
rm -f $(TARGET).elf $(TARGET).hex $(TARGET).bin $(TARGET).map $(TARGET).lst $(TARGET).o $(TARGET).d $(TARGET).srec $(TARGET).sym $(TARGET).lss
rm -f $(TARGET).elf $(TARGET).hex $(TARGET).bin $(TARGET).map $(TARGET).lst \
$(TARGET).o $(TARGET).d $(TARGET).srec $(TARGET).sym $(TARGET).lss
$(MAKE) -f Makefile-emulator clean

emulator:
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
5 changes: 3 additions & 2 deletions rv/Makefile → rv-asm/Makefile
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
TARGET:=asm
TARGET:=rv-asm
ADDITIONAL_C_FILES:= rv.c
include ../ch32v003fun/ch32v003fun.mk
clean:
rm -f $(TARGET).elf $(TARGET).hex $(TARGET).bin $(TARGET).map $(TARGET).lst $(TARGET).o $(TARGET).d $(TARGET).srec $(TARGET).sym $(TARGET).lss
rm -f $(TARGET).elf $(TARGET).hex $(TARGET).bin $(TARGET).map $(TARGET).lst \
$(TARGET).o $(TARGET).d $(TARGET).srec $(TARGET).sym $(TARGET).lss
$(MAKE) -f Makefile-emulator clean

emulator:
Expand Down
4 changes: 2 additions & 2 deletions rv/Makefile-emulator → rv-asm/Makefile-emulator
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ ifeq ($(UNAME_S), Darwin)
LDFLAGS += -framework CoreFoundation -framework ApplicationServices -pthread
endif

SRCS=asm.c rv.c
TARGET=asm
SRCS=rv-asm.c rv.c
TARGET=rv-asm

SRCS += $(wildcard ../emulator/*.c)
ifneq ($(UNAME_S), Darwin)
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
5 changes: 3 additions & 2 deletions rv-dis/Makefile
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
TARGET:=t2
TARGET:=rv-dis
ADDITIONAL_C_FILES:=riscv-disas.c
include ../ch32v003fun/ch32v003fun.mk
clean:
rm -f $(TARGET).elf $(TARGET).hex $(TARGET).bin $(TARGET).map $(TARGET).lst $(TARGET).o $(TARGET).d $(TARGET).srec $(TARGET).sym $(TARGET).lss
rm -f $(TARGET).elf $(TARGET).hex $(TARGET).bin $(TARGET).map $(TARGET).lst \
$(TARGET).o $(TARGET).d $(TARGET).srec $(TARGET).sym $(TARGET).lss
$(MAKE) -f Makefile-emulator clean

emulator:
Expand Down
7 changes: 0 additions & 7 deletions rv-dis/README.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,3 @@
# RISC-V Disassembler

RISC-V Disassembler with support for RV32/RV64/RV128 IMAFDC

## Build instructions

```bash
cmake -B build
cmake --build build
```
4 changes: 4 additions & 0 deletions rv-dis/t2.c → rv-dis/rv-dis.c
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
/**
* Originally from `t2.c`.
*/

#include <stdio.h>

#include "riscv-disas.h"
Expand Down
7 changes: 4 additions & 3 deletions testing/Makefile
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
TARGET:= testing
TARGET:=testing
include ../ch32v003fun/ch32v003fun.mk
clean:
rm -f $(TARGET).elf $(TARGET).hex $(TARGET).bin $(TARGET).map $(TARGET).lst $(TARGET).o $(TARGET).d $(TARGET).srec $(TARGET).sym $(TARGET).lss
rm -f $(TARGET).elf $(TARGET).hex $(TARGET).bin $(TARGET).map $(TARGET).lst \
$(TARGET).o $(TARGET).d $(TARGET).srec $(TARGET).sym $(TARGET).lss
$(MAKE) -f Makefile-emulator clean

emulator:
$(MAKE) -f Makefile-emulator clean
$(MAKE) -f Makefile-emulator

.PHONY: emulator
.PHONY: emulator clean
3 changes: 2 additions & 1 deletion tic-tac-toe/Makefile
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
TARGET:= tic-tac-toe
include ../ch32v003fun/ch32v003fun.mk
clean:
rm -f $(TARGET).elf $(TARGET).hex $(TARGET).bin $(TARGET).map $(TARGET).lst $(TARGET).o $(TARGET).d $(TARGET).srec $(TARGET).sym $(TARGET).lss
rm -f $(TARGET).elf $(TARGET).hex $(TARGET).bin $(TARGET).map $(TARGET).lst \
$(TARGET).o $(TARGET).d $(TARGET).srec $(TARGET).sym $(TARGET).lss
$(MAKE) -f Makefile-emulator clean

emulator:
Expand Down

0 comments on commit d40861c

Please sign in to comment.