Skip to content

Commit c37593d

Browse files
Merge pull request #5 from kristjanvalur/master
Restructure, add Github actions
2 parents b9527f0 + ff624e3 commit c37593d

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

41 files changed

+391
-351
lines changed

.gitattributes

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
# use unix lf line ending for everything except windows bat files
2+
* text=auto eol=lf
3+
*.asm text eol=lf
4+
*.h text eol=lf
5+
*.{cmd,[cC][mM][dD]} text eol=crlf
6+
*.{bat,[bB][aA][tT]} text eol=crlf

.github/workflows/test.yml

Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
name: C/C++ CI
2+
3+
on:
4+
push:
5+
branches: [ master ]
6+
pull_request:
7+
branches: [ master ]
8+
9+
jobs:
10+
11+
test-linux-x86:
12+
runs-on: ubuntu-latest
13+
strategy:
14+
matrix:
15+
include:
16+
- platformflags: ""
17+
name: "AMD64"
18+
- platformflags: -m32
19+
name: "i386"
20+
name: test-linux-x86 (${{matrix.name}})
21+
env:
22+
PLATFORMFLAGS: ${{matrix.platformflags}}
23+
steps:
24+
- uses: actions/checkout@v2
25+
- name: install multilib
26+
run: sudo apt-get install --no-install-recommends -y gcc-multilib g++-multilib
27+
- name: make
28+
run: make && make test
29+
30+
test-linux-arm:
31+
runs-on: ubuntu-latest
32+
strategy:
33+
matrix:
34+
include:
35+
- arch: arm
36+
emulator: qemu-arm
37+
abi: arm-linux-gnueabi
38+
- arch: aarch64
39+
emulator: qemu-aarch64
40+
abi: aarch64-linux-gnu
41+
name: test-linux-arm (${{matrix.arch}})
42+
env:
43+
PLATFORM_PREFIX: ${{matrix.abi}}-
44+
EMULATOR: ${{matrix.emulator}}
45+
steps:
46+
- uses: actions/checkout@v2
47+
- name: install qemu
48+
run: sudo apt-get install --no-install-recommends -y qemu-user
49+
- name: install abi lib
50+
run: sudo apt-get install --no-install-recommends -y gcc-${{matrix.abi}} g++-${{matrix.abi}}
51+
- name: make
52+
run: make && make test
53+
54+
test-windows:
55+
runs-on: windows-2019
56+
strategy:
57+
matrix:
58+
platform: [x86, x64, ARM, ARM64]
59+
include:
60+
- platform: x86
61+
folder: Win32
62+
native: yes
63+
- platform: x64
64+
folder: x64
65+
native: yes
66+
steps:
67+
- uses: actions/checkout@v2
68+
- name: Add msbuild to PATH
69+
uses: microsoft/[email protected]
70+
- name: build
71+
run: msbuild.exe vs2019\stackman.sln /p:Platform=${{matrix.platform}}
72+
- name: test
73+
if: ${{ matrix.native == 'yes' }}
74+
run: vs2019\${{matrix.folder}}\Debug\test.exe

.travis.yml

Lines changed: 0 additions & 40 deletions
This file was deleted.

Makefile

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11

22

3-
CPPFLAGS += -Isrc $(PLATFORMFLAGS)
3+
CPPFLAGS += -Istackman $(PLATFORMFLAGS)
44
CFLAGS += -fPIC -g $(PLATFORMFLAGS)
55
CXXFLAGS += -fPIC -g $(PLATFORMFLAGS)
66
LDFLAGS += -L$(LIB) -g $(PLATFORMFLAGS)
@@ -29,7 +29,7 @@ LIB := lib/$(ABI)
2929

3030
all: $(LIB)/libstackman.a
3131

32-
obj = src/stackman.o src/stackman_s.o
32+
obj = stackman/stackman.o stackman/stackman_s.o
3333

3434

3535
$(LIB)/libstackman.a: lib $(obj)
@@ -40,7 +40,7 @@ lib:
4040
mkdir -p $(LIB) bin
4141

4242
clean:
43-
rm -f src/*.o tests/*.o
43+
rm -f stackman/*.o tests/*.o
4444
rm -f bin/*
4545
rm -rf tmp
4646

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ platforms as they come along.
114114

115115
## Cross-compilation
116116
Linux on x86-64 can be used to cross compile for x86 and ARM targets. This is most useful to generate assembly code, e.g. when compiling
117-
src/platform/gen_asm.c
117+
stackman/platform/gen_asm.c
118118
- x86 requires the -m32 flag to compilers and linkers.
119119
- arm32 requires to use the arm-linux-gnueabi-* tools, including cc and linker
120120
- aarch64 requires the aarch64-linux-gnu-* tools.
@@ -138,4 +138,4 @@ platforms may need to be done independently.
138138
- install **gcc-aarch64-linux-gnu** and **g++-aarch64-linux-gnu**
139139
- install __qemu-user__ for hardware emulation
140140
- *compile* using `aarch64-linux-gnu-gcc`
141-
- *make* using `make PLATFORM_PREFIX=aarch64-linux-gnu- EMULATOR=qemu-arm64 test`
141+
- *make* using `make PLATFORM_PREFIX=aarch64-linux-gnu- EMULATOR=qemu-aarch64 test`

abiname.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#!/bin/sh
22

3-
# this script compiles and runs src/abiname.c which merely prints
3+
# this script compiles and runs stackman/abiname.c which merely prints
44
# out the name of the abi. This can be used by makefiles to identify
55
# the correct library path to use to link the library
66
# Instead of just compiling and running, we will use the provided compiler
@@ -16,7 +16,7 @@ tmp=$(mktemp "${here}/tmp/abinameXXX.c")
1616
#1 create the preprocessed file
1717
CC=${1:-cc}
1818
CFLAGS=${2:-}
19-
${CC} ${CFLAGS} -E -I "${here}/src" -o "${tmp}" "${here}/src/abiname.c"
19+
${CC} ${CFLAGS} -E -o "${tmp}" "${here}/stackman/abiname.c"
2020
#2 compile resulting file
2121
cc -o "${tmp}.out" "${tmp}"
2222
#3 run it
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)