allow game ID as version identifier
This commit is contained in:
parent
011d2f9d35
commit
d6243f08e0
3 changed files with 25 additions and 12 deletions
6
.github/Build.Dockerfile
vendored
6
.github/Build.Dockerfile
vendored
|
@ -1,11 +1,11 @@
|
||||||
FROM devkitpro/devkitppc:20210726
|
FROM devkitpro/devkitppc:20210726
|
||||||
ARG VERSION
|
ARG GAME_VERSION
|
||||||
|
|
||||||
ENV PATH="${PATH}:/opt/devkitpro/devkitPPC/bin"
|
ENV PATH="${PATH}:/opt/devkitpro/devkitPPC/bin"
|
||||||
ENV VERSION=${VERSION}
|
ENV GAME_VERSION=${GAME_VERSION}
|
||||||
|
|
||||||
RUN apt-get update && apt-get install make
|
RUN apt-get update && apt-get install make
|
||||||
|
|
||||||
WORKDIR /build
|
WORKDIR /build
|
||||||
|
|
||||||
ENTRYPOINT make VERSION=${VERSION}
|
ENTRYPOINT make GAME_VERSION=${GAME_VERSION}
|
12
.github/workflows/build.yml
vendored
12
.github/workflows/build.yml
vendored
|
@ -11,20 +11,20 @@ jobs:
|
||||||
fail-fast: false
|
fail-fast: false
|
||||||
matrix:
|
matrix:
|
||||||
version:
|
version:
|
||||||
- 1
|
- GMSE01
|
||||||
- 2
|
- GMSJ01
|
||||||
- 3
|
- GMSP01
|
||||||
- 4
|
- GMSJ0A
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v2
|
uses: actions/checkout@v2
|
||||||
- name: Build Docker Image
|
- name: Build Docker Image
|
||||||
run: docker build --build-arg VERSION=${{ matrix.version }} -t build:base -f ./.github/Build.Dockerfile .
|
run: docker build --build-arg GAME_VERSION=${{ matrix.version }} -t build:base -f ./.github/Build.Dockerfile .
|
||||||
- name: Build Project
|
- name: Build Project
|
||||||
run: docker run --mount type=bind,source="$(pwd)",target=/build build:base
|
run: docker run --mount type=bind,source="$(pwd)",target=/build build:base
|
||||||
- name: Upload Artifactes
|
- name: Upload Artifactes
|
||||||
uses: actions/upload-artifact@master
|
uses: actions/upload-artifact@master
|
||||||
with:
|
with:
|
||||||
name: build-artifact
|
name: build-output-${{ matrix.version }}
|
||||||
path: out
|
path: out
|
||||||
retention-days: 7
|
retention-days: 7
|
19
Makefile
19
Makefile
|
@ -1,5 +1,5 @@
|
||||||
CC := powerpc-eabi-gcc
|
CC := powerpc-eabi-gcc
|
||||||
CFLAGS := -D VERSION=${VERSION} -Os -I. -Wa,-mregnames,-mgekko -Wall -fno-asynchronous-unwind-tables -fno-unwind-tables
|
CFLAGS := -Os -I. -Wa,-mregnames,-mgekko -Wall -fno-asynchronous-unwind-tables -fno-unwind-tables
|
||||||
|
|
||||||
AS := powerpc-eabi-as
|
AS := powerpc-eabi-as
|
||||||
ASFLAGS := -mregnames -mgekko
|
ASFLAGS := -mregnames -mgekko
|
||||||
|
@ -25,6 +25,13 @@ OUT_MAIN := main.out
|
||||||
OUT_BIN := main.bin
|
OUT_BIN := main.bin
|
||||||
OUT_ASM := main.asm
|
OUT_ASM := main.asm
|
||||||
|
|
||||||
|
GMSE01 := 1
|
||||||
|
GMSJ01 := 2
|
||||||
|
GMSP01 := 3
|
||||||
|
GMSJ0A := 4
|
||||||
|
|
||||||
|
TARGET_VERSION = $($(GAME_VERSION))
|
||||||
|
|
||||||
SRC_FILES := $(wildcard source/*.c)
|
SRC_FILES := $(wildcard source/*.c)
|
||||||
OBJ_FILES := $(SRC_FILES:.c=.o)
|
OBJ_FILES := $(SRC_FILES:.c=.o)
|
||||||
|
|
||||||
|
@ -42,12 +49,18 @@ $(OUT_DIR)/$(OUT_BIN): $(OUT_DIR)/$(OUT_MAIN)
|
||||||
$(OUT_DIR)/$(OUT_MAIN): $(OBJ_FILES) $(LD_FILE) $(OUT_DIR)
|
$(OUT_DIR)/$(OUT_MAIN): $(OBJ_FILES) $(LD_FILE) $(OUT_DIR)
|
||||||
$(LD) $(LDFLAGS) -o $@ -T $(LD_FILE) -Map $(OUT_DIR)/$(OUT_MAP) $(OBJ_FILES)
|
$(LD) $(LDFLAGS) -o $@ -T $(LD_FILE) -Map $(OUT_DIR)/$(OUT_MAP) $(OBJ_FILES)
|
||||||
|
|
||||||
$(OBJ_FILES): $(SRC_FILES)
|
$(OBJ_FILES): $(SRC_FILES) check-set-TARGET_VERSION
|
||||||
$(CC) $(CFLAGS) -I $(INC_DIR) -o $@ -c $(@:.o=.c)
|
$(CC) $(CFLAGS) -D VERSION=$(TARGET_VERSION) -I $(INC_DIR) -o $@ -c $(@:.o=.c)
|
||||||
|
|
||||||
$(OUT_DIR):
|
$(OUT_DIR):
|
||||||
mkdir -p $@
|
mkdir -p $@
|
||||||
|
|
||||||
|
check-set-%:
|
||||||
|
@ if [ "${${*}}" = "" ]; then \
|
||||||
|
echo "Variable $* not set"; \
|
||||||
|
exit 1; \
|
||||||
|
fi
|
||||||
|
|
||||||
.PHONY: clean
|
.PHONY: clean
|
||||||
clean:
|
clean:
|
||||||
$(RM) -rv $(OUT_DIR) $(OBJ_FILES)
|
$(RM) -rv $(OUT_DIR) $(OBJ_FILES)
|
Loading…
Reference in a new issue