| 1 |
name: Compile make |
| 2 |
description: compile-make |
| 3 |
inputs: |
| 4 |
version: |
| 5 |
description: make version |
| 6 |
required: true |
| 7 |
workaround: |
| 8 |
description: enable workaround for _alloc bug |
| 9 |
required: false |
| 10 |
default: "false" |
| 11 |
|
| 12 |
runs: |
| 13 |
using: composite |
| 14 |
steps: |
| 15 |
- name: Cache make compiled |
| 16 |
if: ${{ !startsWith(runner.os, 'windows') }} |
| 17 |
id: cache-maka |
| 18 |
uses: actions/cache@v4 |
| 19 |
with: |
| 20 |
path: /usr/local/bin/make-${{ inputs.version }} |
| 21 |
key: v1-${{ runner.os }}-make-${{ inputs.version }} |
| 22 |
|
| 23 |
- name: Make GNU Make from source |
| 24 |
if: ${{ !startsWith(runner.os, 'windows') && steps.cache-make.outputs.cache-hit != 'true' }} |
| 25 |
env: |
| 26 |
VERSION: ${{ inputs.version }} |
| 27 |
WORKAROUND: ${{ inputs.workaround }} |
| 28 |
shell: bash |
| 29 |
run: | |
| 30 |
curl "https://ftp.gnu.org/gnu/make/make-${VERSION}.tar.gz" | tar xz |
| 31 |
pushd "make-${VERSION}" |
| 32 |
./configure |
| 33 |
[[ "$WORKAROUND" = "true" ]] && sed -i 's/#if !defined __alloca \&\& !defined __GNU_LIBRARY__/#if !defined __alloca \&\& defined __GNU_LIBRARY__/g; s/#ifndef __GNU_LIBRARY__/#ifdef __GNU_LIBRARY__/g' "./glob/glob.c" |
| 34 |
make -j 4 |
| 35 |
popd |
| 36 |
cp -p "make-${VERSION}/make" "/usr/local/bin/make-${VERSION}" |