Skip to content

Commit

Permalink
[autotools] Initial cut.
Browse files Browse the repository at this point in the history
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
  • Loading branch information
turon committed Mar 17, 2020
1 parent 57e0b9f commit ba1a028
Show file tree
Hide file tree
Showing 151 changed files with 33,841 additions and 297 deletions.
1 change: 1 addition & 0 deletions .default-version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
0.1.0
2 changes: 1 addition & 1 deletion .github/workflows/build-main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,4 @@ jobs:
steps:
- uses: actions/checkout@v2
- name: Run Build
run: make
run: ./bootstrap && make -f Makefile-Standalone distcheck
87 changes: 80 additions & 7 deletions BUILDING.md
Original file line number Diff line number Diff line change
@@ -1,23 +1,96 @@
## Build Documentation

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

Run:
Tested on:
- MacOS
- Ubuntu 18.04

```
$ make all
```

Assuming you have all the required tools installed, this will tidy, format, and run code
coverage on the entire tree. Tests are built into the make system.
Build system features:
- 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

Assuming you have all the required tools installed, the system will build the code,
build a distribution, tidy, format, run tests, and run code coverage on the entire tree.
Tests are built into the make system.


### Tool Prerequisites

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

* Bash 4.0 or greater
* GNU make
* GNU automake
* C and C++ compilers
* clang-tidy
* clang-format
* gcov

### Autotools Build Preparation

```
# Initial preparation
git clean -fdx
./bootstrap
make -f Makefile-Standalone
```

### Build Standalone (Native Linux or MacOS)

```
make -f Makefile-Standalone
```

### Build Custom configuration

```
# From top of clean tree
./bootstrap
mkdir out
cd out
../configure
# Build libraries
make
# Build distribution
make dist
# Build and check distribution
make distcheck
# Run tests
make check
# Verify coding style conformance
make pretty-check
```

### Build iOS

Install XCode and XQuarz.

```
make -f Makefile-iOS
```

### Build Android

Install Android Studio, Java, and NDK.

```
# Update these paths based on your environment and version of the tools (MacOS examples):
export JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk-12.0.1.jdk/Contents/Home
export ANDROID_HOME=~/Library/Android/sdk
export ANDROID_NDK_HOME=~/Library/Android/sdk/ndk/21.0.6113669
make -f Makefile-Android
```
7 changes: 0 additions & 7 deletions Makefile

This file was deleted.

Loading

0 comments on commit ba1a028

Please sign in to comment.