-
Notifications
You must be signed in to change notification settings - Fork 3
77 lines (67 loc) · 2.49 KB
/
build.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
name: Build
on: [push, pull_request]
jobs:
build:
runs-on: ${{ matrix.TARGET.OS }}
strategy:
fail-fast: false
matrix:
TARGET:
- {
OS: 'ubuntu-latest',
CFLAGS: '-static -std=gnu89 -m32',
HOST: 'i386-pc-linux',
ARCHIVE_NAME: 'gcc-2.7.2-linux.tar.gz'
}
- {
OS: 'macos-13',
CFLAGS: '-DDARWIN -std=gnu89 -Wno-return-type -Wno-error -Wno-implicit-function-declaration -Wno-int-conversion',
HOST: 'i386-apple-darwin',
ARCHIVE_NAME: 'gcc-2.7.2-mac.tar.gz'
}
- {
OS: 'macos-14',
CFLAGS: '-DDARWIN -std=gnu89 -Wno-return-type -Wno-error -Wno-implicit-function-declaration -Wno-int-conversion',
HOST: 'arm-apple-darwin',
ARCHIVE_NAME: 'gcc-2.7.2-mac-arm.tar.gz'
}
name: Building gcc for ${{ matrix.TARGET.OS }}
steps:
- uses: actions/checkout@v4
- name: Install dependencies (Ubuntu)
shell: bash
if: matrix.TARGET.OS == 'ubuntu-latest'
run: |
sudo apt-get update
sudo apt-get install -y build-essential bison file gperf gcc gcc-multilib autoconf
- name: Configure for mips
shell: bash
run: |
./configure --target=mips-mips-gnu --prefix=/opt/cross --with-gnu-as --disable-gprof --disable-gdb --disable-werror --host=${{ matrix.TARGET.HOST }} --build=${{ matrix.TARGET.HOST }}
- name: Make
shell: bash # The generated `c-parse.c` is already commited on the repo, so we touch it to avoid regenerating it (trying to build old lex/yacc files with modern tools fails)
run: |
touch c-parse.c
make CFLAGS="${{ matrix.TARGET.CFLAGS }}" xgcc cc1 cc1plus cpp cccp g++
- name: Test for file
shell: bash
run: |
test -f cc1
file cc1
./cc1 test.c
- name: Create release archive
shell: bash
run: |
cp xgcc gcc
tar -czf ${{ matrix.TARGET.ARCHIVE_NAME }} gcc cc1 cc1plus cpp cccp g++
- name: Upload archive
uses: actions/upload-artifact@v3
with:
name: gcc-2.7.2-${{ matrix.TARGET.OS }}
path: |
${{ matrix.TARGET.ARCHIVE_NAME }}
- name: Publish release
uses: softprops/action-gh-release@v1
if: startsWith(github.ref, 'refs/tags/')
with:
files: ${{ matrix.TARGET.ARCHIVE_NAME }}