Skip to content

Commit ba1a028

Browse files
committed
[autotools] Initial cut.
Adds enhanced autotools build system used by openthread and openweave projects: * Package management: 'make dist' and 'make distcheck' * Cross-platform handling: (Linux, Darwin, iOS, Android, embedded arm, etc.) * Multiple compiler support: clang, GCC * Integrates automated testing framework: 'make check' * Code style enforcement: 'make pretty' and 'make pretty-check' integration with clang-format
1 parent 57e0b9f commit ba1a028

File tree

151 files changed

+33841
-297
lines changed

Some content is hidden

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

151 files changed

+33841
-297
lines changed

.default-version

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
0.1.0

.github/workflows/build-main.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,4 @@ jobs:
1010
steps:
1111
- uses: actions/checkout@v2
1212
- name: Run Build
13-
run: make
13+
run: ./bootstrap && make -f Makefile-Standalone distcheck

BUILDING.md

+80-7
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,96 @@
11
## Build Documentation
22

3-
Currently using simple GNU makefiles on Linux or MacOS (Tested on MacOS and Ubuntu 18.04).
3+
The CHIP build system uses GNU autotools and helper makefiles to build
4+
various platform images on Linux or MacOS.
45

5-
Run:
6+
Tested on:
7+
- MacOS
8+
- Ubuntu 18.04
69

7-
```
8-
$ make all
9-
```
1010

11-
Assuming you have all the required tools installed, this will tidy, format, and run code
12-
coverage on the entire tree. Tests are built into the make system.
11+
Build system features:
12+
- Package management: 'make dist' and 'make distcheck'
13+
- Cross-platform handling: (Linux, Darwin, iOS, Android, embedded arm, etc.)
14+
- Multiple compiler support: clang, GCC
15+
- Integrates automated testing framework: 'make check'
16+
- Code style enforcement: 'make pretty' and 'make pretty-check' integration with clang-format
17+
18+
Assuming you have all the required tools installed, the system will build the code,
19+
build a distribution, tidy, format, run tests, and run code coverage on the entire tree.
20+
Tests are built into the make system.
21+
1322

1423
### Tool Prerequisites
1524

1625
To take advantage of all the current capabilities of the make system, you'll want:
1726

1827
* Bash 4.0 or greater
1928
* GNU make
29+
* GNU automake
2030
* C and C++ compilers
2131
* clang-tidy
2232
* clang-format
2333
* gcov
34+
35+
### Autotools Build Preparation
36+
37+
```
38+
# Initial preparation
39+
git clean -fdx
40+
./bootstrap
41+
42+
make -f Makefile-Standalone
43+
```
44+
45+
### Build Standalone (Native Linux or MacOS)
46+
47+
```
48+
make -f Makefile-Standalone
49+
```
50+
51+
### Build Custom configuration
52+
53+
```
54+
# From top of clean tree
55+
./bootstrap
56+
57+
mkdir out
58+
cd out
59+
../configure
60+
61+
# Build libraries
62+
make
63+
64+
# Build distribution
65+
make dist
66+
67+
# Build and check distribution
68+
make distcheck
69+
70+
# Run tests
71+
make check
72+
73+
# Verify coding style conformance
74+
make pretty-check
75+
```
76+
77+
### Build iOS
78+
79+
Install XCode and XQuarz.
80+
81+
```
82+
make -f Makefile-iOS
83+
```
84+
85+
### Build Android
86+
87+
Install Android Studio, Java, and NDK.
88+
89+
```
90+
# Update these paths based on your environment and version of the tools (MacOS examples):
91+
export JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk-12.0.1.jdk/Contents/Home
92+
export ANDROID_HOME=~/Library/Android/sdk
93+
export ANDROID_NDK_HOME=~/Library/Android/sdk/ndk/21.0.6113669
94+
95+
make -f Makefile-Android
96+
```

Makefile

-7
This file was deleted.

0 commit comments

Comments
 (0)