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
make clean
fi
make all
make all -j
popd
BUILT_N64=true
@ -50,7 +50,7 @@ build_riscv () {
pushd sw/riscv
if [ "$FORCE_CLEAN" = true ]; then
make clean
make clean -j
fi
make all
popd

View File

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

View File

@ -1,11 +1,10 @@
TOOLCHAIN = riscv32-unknown-elf-
CC = $(TOOLCHAIN)gcc
AS = $(TOOLCHAIN)as
OBJCOPY = $(TOOLCHAIN)objcopy
OBJDUMP = $(TOOLCHAIN)objdump
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
LDFLAGS = -nostartfiles -Wl,--gc-sections
@ -25,10 +24,10 @@ $(@info $(shell mkdir -p ./$(BUILD_DIR) &> /dev/null))
all: $(BUILD_DIR)/governor.hex
$(BUILD_DIR)/%.c.o: %.c
$(CC) $(FLAGS) $(CFLAGS) $(USER_FLAGS) -c $< -o $@
$(CC) $(FLAGS) $(CFLAGS) -c $< -o $@
$(BUILD_DIR)/%.S.o: %.S
$(AS) $(FLAGS) $(ASFLAGS) -c $< -o $@
$(CC) -x assembler $(FLAGS) $(CFLAGS) -c $< -o $@
$(BUILD_DIR)/governor.hex: $(OBJS) SC64.ld
$(CC) $(FLAGS) $(LDFLAGS) -TSC64.ld $(OBJS) -o $(BUILD_DIR)/governor.elf