slightly optimize sw build

This commit is contained in:
Mateusz Faderewski 2021-11-18 01:51:43 +00:00
parent 29aca8aea6
commit 19c34a861b
3 changed files with 6 additions and 7 deletions

View File

@ -39,7 +39,7 @@ build_n64 () {
if [ "$FORCE_CLEAN" = true ]; then if [ "$FORCE_CLEAN" = true ]; then
make clean make clean
fi fi
make all make all -j
popd popd
BUILT_N64=true BUILT_N64=true
@ -50,7 +50,7 @@ build_riscv () {
pushd sw/riscv pushd sw/riscv
if [ "$FORCE_CLEAN" = true ]; then if [ "$FORCE_CLEAN" = true ]; then
make clean make clean -j
fi fi
make all make all
popd popd

View File

@ -1,7 +1,7 @@
#!/bin/bash #!/bin/bash
docker run \ docker run \
--rm \ --user $(id -u):$(id -g) \
--mount type=bind,src="$(pwd)",target="/workdir" \ --mount type=bind,src="$(pwd)",target="/workdir" \
ghcr.io/polprzewodnikowy/sc64env:v1.2 \ ghcr.io/polprzewodnikowy/sc64env:v1.2 \
./build.sh $@ ./build.sh $@

View File

@ -1,11 +1,10 @@
TOOLCHAIN = riscv32-unknown-elf- TOOLCHAIN = riscv32-unknown-elf-
CC = $(TOOLCHAIN)gcc CC = $(TOOLCHAIN)gcc
AS = $(TOOLCHAIN)as
OBJCOPY = $(TOOLCHAIN)objcopy OBJCOPY = $(TOOLCHAIN)objcopy
OBJDUMP = $(TOOLCHAIN)objdump OBJDUMP = $(TOOLCHAIN)objdump
SIZE = $(TOOLCHAIN)size SIZE = $(TOOLCHAIN)size
FLAGS = -mabi=ilp32 -march=rv32i FLAGS = -mabi=ilp32 -march=rv32i $(USER_FLAGS)
CFLAGS = -Os -Wall -ffunction-sections -fdata-sections -ffreestanding -MMD -MP CFLAGS = -Os -Wall -ffunction-sections -fdata-sections -ffreestanding -MMD -MP
LDFLAGS = -nostartfiles -Wl,--gc-sections LDFLAGS = -nostartfiles -Wl,--gc-sections
@ -25,10 +24,10 @@ $(@info $(shell mkdir -p ./$(BUILD_DIR) &> /dev/null))
all: $(BUILD_DIR)/governor.hex all: $(BUILD_DIR)/governor.hex
$(BUILD_DIR)/%.c.o: %.c $(BUILD_DIR)/%.c.o: %.c
$(CC) $(FLAGS) $(CFLAGS) $(USER_FLAGS) -c $< -o $@ $(CC) $(FLAGS) $(CFLAGS) -c $< -o $@
$(BUILD_DIR)/%.S.o: %.S $(BUILD_DIR)/%.S.o: %.S
$(AS) $(FLAGS) $(ASFLAGS) -c $< -o $@ $(CC) -x assembler $(FLAGS) $(CFLAGS) -c $< -o $@
$(BUILD_DIR)/governor.hex: $(OBJS) SC64.ld $(BUILD_DIR)/governor.hex: $(OBJS) SC64.ld
$(CC) $(FLAGS) $(LDFLAGS) -TSC64.ld $(OBJS) -o $(BUILD_DIR)/governor.elf $(CC) $(FLAGS) $(LDFLAGS) -TSC64.ld $(OBJS) -o $(BUILD_DIR)/governor.elf