Skip to content

Commit 2b68e93

Browse files
authored
Merge pull request #502 from uyjulian/buildsystem_improvements_240116
Buildsystem improvements 240116
2 parents 9b248e7 + a0bdb5b commit 2b68e93

File tree

21 files changed

+59
-60
lines changed

21 files changed

+59
-60
lines changed

.github/workflows/compilation.yml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,10 @@ jobs:
2020
run: |
2121
apk add build-base git bash
2222
23-
# Still compilation is not fully compatible with multi-thread
2423
- name: Compile project ${{ matrix.debug }}
2524
run: |
2625
make -j $(getconf _NPROCESSORS_ONLN) clean
27-
make -j 1 ${{ matrix.debug }}
26+
make -j $(getconf _NPROCESSORS_ONLN) ${{ matrix.debug }}
2827
make -j $(getconf _NPROCESSORS_ONLN) install
2928
ln -sf "$PS2SDK/ee/lib/libcglue.a" "$PS2DEV/ee/mips64r5900el-ps2-elf/lib/libcglue.a"
3029
ln -sf "$PS2SDK/ee/lib/libpthreadglue.a" "$PS2DEV/ee/mips64r5900el-ps2-elf/lib/libpthreadglue.a"
@@ -39,7 +38,7 @@ jobs:
3938
4039
- name: Get short SHA
4140
id: slug
42-
run: echo "sha8=$(echo ${GITHUB_SHA} | cut -c1-8)" >> $GITHUB_OUTPUT
41+
run: printf '%s\n' "sha8=$(printf '%s\n' ${GITHUB_SHA} | cut -c1-8)" >> $GITHUB_OUTPUT
4342

4443
- name: Upload artifacts
4544
if: ${{ success() }}

.github/workflows/docker.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -23,12 +23,12 @@ jobs:
2323
- name: Extract DOCKER_TAG using tag name
2424
if: startsWith(github.ref, 'refs/tags/')
2525
run: |
26-
echo "DOCKER_TAG=${GITHUB_REF/refs\/tags\//}" >> $GITHUB_ENV
26+
printf '%s\n' "DOCKER_TAG=${GITHUB_REF/refs\/tags\//}" >> $GITHUB_ENV
2727
2828
- name: Use default DOCKER_TAG
2929
if: startsWith(github.ref, 'refs/tags/') != true
3030
run: |
31-
echo "DOCKER_TAG=latest" >> $GITHUB_ENV
31+
printf '%s\n' "DOCKER_TAG=latest" >> $GITHUB_ENV
3232
3333
- name: Login to DockerHub
3434
uses: docker/login-action@v2
@@ -47,12 +47,12 @@ jobs:
4747
- name: Set docker tag list to include DockerHub if credentials available
4848
if: env.DOCKER_USERNAME != null
4949
run: |
50-
echo "DOCKER_TAG_LIST=ghcr.io/${{ github.repository }}:${{ env.DOCKER_TAG }},${{ github.repository }}:${{ env.DOCKER_TAG }}" >> $GITHUB_ENV
50+
printf '%s\n' "DOCKER_TAG_LIST=ghcr.io/${{ github.repository }}:${{ env.DOCKER_TAG }},${{ github.repository }}:${{ env.DOCKER_TAG }}" >> $GITHUB_ENV
5151
5252
- name: Set docker tag list to not include DockerHub if credentials not available
5353
if: env.DOCKER_USERNAME == null
5454
run: |
55-
echo "DOCKER_TAG_LIST=ghcr.io/${{ github.repository }}:${{ env.DOCKER_TAG }}" >> $GITHUB_ENV
55+
printf '%s\n' "DOCKER_TAG_LIST=ghcr.io/${{ github.repository }}:${{ env.DOCKER_TAG }}" >> $GITHUB_ENV
5656
5757
- name: Build and Push to container registry
5858
uses: docker/build-push-action@v3
@@ -64,8 +64,8 @@ jobs:
6464
6565
- name: Send Compile action
6666
run: |
67-
export DISPATCH_ACTION="$(echo run_build)"
68-
echo "NEW_DISPATCH_ACTION=$DISPATCH_ACTION" >> $GITHUB_ENV
67+
export DISPATCH_ACTION="$(printf '%s\n' run_build)"
68+
printf '%s\n' "NEW_DISPATCH_ACTION=$DISPATCH_ACTION" >> $GITHUB_ENV
6969
7070
- name: Repository Dispatch to ps2sdk-ports
7171
uses: peter-evans/repository-dispatch@v2

Defs.make

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,5 +57,6 @@ STRIP ?= strip
5757
MKDIR ?= mkdir
5858
RMDIR ?= rmdir
5959
ECHO ?= echo
60+
PRINTF ?= printf
6061

6162
MAKEREC ?= $(MAKE) -C

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ RUN apk add build-base git bash
99
# Still compilation is not fully compatible with multi-thread
1010
RUN cd /src && \
1111
make -j $(getconf _NPROCESSORS_ONLN) clean && \
12-
make -j 1 && \
12+
make -j $(getconf _NPROCESSORS_ONLN) && \
1313
make -j $(getconf _NPROCESSORS_ONLN) install
1414
RUN ln -sf "$PS2SDK/ee/lib/libcglue.a" "$PS2DEV/ee/mips64r5900el-ps2-elf/lib/libcglue.a"
1515
RUN ln -sf "$PS2SDK/ee/lib/libpthreadglue.a" "$PS2DEV/ee/mips64r5900el-ps2-elf/lib/libpthreadglue.a"

Makefile

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,7 @@ endif
1515
SUBDIRS = tools iop ee common samples
1616

1717
all: build
18-
@$(ECHO) .;
19-
@$(ECHO) .PS2SDK Built.;
20-
@$(ECHO) .;
18+
@$(PRINTF) '.\n.PS2SDK Built.\n.\n'
2119

2220
# Common rules shared by all build targets.
2321

@@ -84,13 +82,13 @@ release_base: | env_release_check
8482
env_build_check:
8583
@if test -z $(PS2SDKSRC) ; \
8684
then \
87-
$(ECHO) PS2SDKSRC environment variable should be defined. ; \
85+
$(PRINTF) 'PS2SDKSRC environment variable should be defined.\n' ; \
8886
fi
8987

9088
env_release_check:
9189
@if test -z $(PS2SDK) ; \
9290
then \
93-
$(ECHO) PS2SDK environment variable must be defined. ; \
91+
$(PRINTF) 'PS2SDK environment variable must be defined.\n' ; \
9492
exit 1; \
9593
fi
9694

common/Rules.release

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,9 @@ release-include:
1515
@if test -d include ; then \
1616
for file in $$(find include -type f | cut -d'/' -f2-); do \
1717
if test -f include/$$file ; then \
18-
$(ECHO) Installing include/$$file to $(PS2SDK)/common/include ; \
18+
$(PRINTF) 'Installing include/%s to %s/common/include\n' $$file $(PS2SDK) ; \
1919
mkdir -p $(PS2SDK)/common/include/$$(dirname $$file) ; \
20-
cp -t $(PS2SDK)/common/include/$$(dirname $$file) -f include/$$file ; \
20+
cp -f include/$$file $(PS2SDK)/common/include/$$(dirname $$file) ; \
2121
chmod 644 $(PS2SDK)/common/include/$$file ; \
2222
fi \
2323
done; \

common/external_deps/Makefile

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,11 @@ LWIP := $(PS2SDKSRC)/common/external_deps/lwip
44
all: $(LWIP)
55

66
$(LWIP):
7-
cd $(PS2SDKSRC) && ./dowload_dependencies.sh
7+
cd $(PS2SDKSRC) && ./download_dependencies.sh
88

99
clean:
10-
$(ECHO) Cleaning PS2SDK dependencies.
11-
$(ECHO) Cleaning lwip.
10+
@$(PRINTF) 'Cleaning PS2SDK dependencies.\n'
11+
@$(PRINTF) 'Cleaning lwip.\n'
1212
rm -rf $(LWIP) $(LWIP)_inprogress
1313

1414
include $(PS2SDKSRC)/Defs.make

ee/Rules.release

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -26,15 +26,15 @@ release-ee-dirs:
2626

2727
release-ee-lib:
2828
@if test $(EE_LIB) ; then \
29-
$(ECHO) Installing $(EE_LIB) to $(PS2SDK)/ee/lib ; \
29+
$(PRINTF) 'Installing %s to %s/ee/lib\n' $(EE_LIB) $(PS2SDK) ; \
3030
cp -f $(EE_LIB) $(PS2SDK)/ee/lib ; \
3131
cp -f $(EE_LIB:%.a=%.erl) $(PS2SDK)/ee/lib ; \
32-
chmod 644 $(PS2SDK)/ee/lib/`basename $(EE_LIB)` $(PS2SDK)/ee/lib/`basename $(EE_LIB:%.a=%.erl)`; \
32+
chmod 644 $(PS2SDK)/ee/lib/$$(basename $(EE_LIB)) $(PS2SDK)/ee/lib/$$(basename $(EE_LIB:%.a=%.erl)); \
3333
for file in $(EE_LIB_ALTNAMES); do \
34-
ln -s `basename $(EE_LIB)` $(PS2SDK)/ee/lib/$$file; \
34+
ln -s $$(basename $(EE_LIB)) $(PS2SDK)/ee/lib/$$file; \
3535
done; \
3636
for file in $(EE_LIB_ALTNAMES:%.a=%.erl); do \
37-
ln -sf `basename $(EE_LIB:%.a=%.erl)` $(PS2SDK)/ee/lib/$$file; \
37+
ln -sf $$(basename $(EE_LIB:%.a=%.erl)) $(PS2SDK)/ee/lib/$$file; \
3838
done; \
3939
fi;
4040

@@ -45,11 +45,11 @@ release-ee-lib:
4545

4646
release-ee-bin:
4747
@if test $(EE_BIN) ; then \
48-
$(ECHO) Installing $(EE_BIN) to $(PS2SDK)/ee/bin ; \
48+
$(PRINTF) 'Installing %s to %s/ee/bin\n' $(EE_BIN) $(PS2SDK) ; \
4949
cp -f $(EE_BIN) $(PS2SDK)/ee/bin ; \
50-
chmod 644 $(PS2SDK)/ee/bin/`basename $(EE_BIN)` ; \
50+
chmod 644 $(PS2SDK)/ee/bin/$$(basename $(EE_BIN)) ; \
5151
for file in $(EE_BIN_ALTNAMES); do \
52-
ln -sf `basename $(EE_BIN)` $(PS2SDK)/ee/bin/$$file; \
52+
ln -sf $$(basename $(EE_BIN)) $(PS2SDK)/ee/bin/$$file; \
5353
done; \
5454
fi;
5555

@@ -62,9 +62,9 @@ release-ee-include:
6262
@if test -d include ; then \
6363
for file in $$(find include -type f | cut -d'/' -f2-); do \
6464
if test -f include/$$file ; then \
65-
$(ECHO) Installing include/$$file to $(PS2SDK)/ee/include ; \
65+
$(PRINTF) 'Installing include/%s to %s/ee/include\n' $$file $(PS2SDK) ; \
6666
mkdir -p $(PS2SDK)/ee/include/$$(dirname $$file) ; \
67-
cp -t $(PS2SDK)/ee/include/$$(dirname $$file) -f include/$$file ; \
67+
cp -f include/$$file $(PS2SDK)/ee/include/$$(dirname $$file) ; \
6868
chmod 644 $(PS2SDK)/ee/include/$$file ; \
6969
fi \
7070
done; \

ee/erl-loader/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ clean:
2727
rm -f -r $(EE_OBJS_DIR) $(EE_BIN_DIR) $(EE_SRC_DIR)exports.c
2828

2929
release:
30-
$(ECHO) Installing $(LOADER_BIN) to $(PS2SDK)/ee/bin/ ;
30+
@$(ECHO) 'Installing %s to %s/ee/bin/\n' $(LOADER_BIN) $(PS2SDK) ;
3131
cp -f $(LOADER_BIN) $(PS2SDK)/ee/bin/
3232
chmod 644 $(PS2SDK)/ee/bin/erl-loader.elf
3333

0 commit comments

Comments
 (0)