Skip to content

Commit

Permalink
tooling: add <package> and push_<package> to Makefile
Browse files Browse the repository at this point in the history
  • Loading branch information
okay committed Sep 3, 2020
1 parent b6b88ee commit 89de284
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 5 deletions.
15 changes: 13 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,26 @@ repo:
docker build --tag toltec:build . -f image/Dockerfile.build
bash scripts/build-repo-in-docker

# Use `make <app>` to build any package individually
# Use `make push_<app>` to push any package to .cache/opkg/ on the rM
PACKAGES=$(shell ls package/)
PUSH_PACKAGES=$(foreach app, $(PACKAGES), push_$(app))

$(PACKAGES): %:
PACKAGE=$(@) make package

$(PUSH_PACKAGES): %:
PACKAGE=$(@:push_%=%) make push_package

package:
docker build --tag toltec:base . -f image/Dockerfile
docker build --tag toltec:build . -f image/Dockerfile.build
echo "BUILDING ${PACKAGE}"
PACKAGE=${PACKAGE} bash scripts/build-package-in-docker

push_package:
ssh root@${HOST} mkdir -p .config/opkg/
PACKAGE=${PACKAGE} scp artifacts/package/${PACKAGE}/*.ipk root@${HOST}:.config/opkg/
ssh root@${HOST} mkdir -p .cache/opkg/
PACKAGE=${PACKAGE} scp artifacts/package/${PACKAGE}/*.ipk root@${HOST}:.cache/opkg/

.PHONY: docker package

4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ will expand to 3GB. the final build artifacts will be found in `artifacts/`.

* clone this repository
* switch to `testing` branch
* edit package/YOURPACKAGE/package, making sure to bump the version
* build the package (`PACKAGE=YOURPACKAGE scripts/build-package-in-docker`), making sure everything looks ok in artifacts/package/YOURPACKAGE/
* edit package/$PACKAGE/package, making sure to bump the version
* build the package (`make $PACKAGE`), making sure everything looks ok in artifacts/package/$PACKAGE/
* install the package to your tablet, verifying things work as expected
* for new packages, submit a pull request with the title: [$PACKAGE][$VERSION] - New Package
* for updating packages, submit a pull request with the title: [$PACKAGE][$VERSION] - Updated Package
2 changes: 1 addition & 1 deletion scripts/build-package-in-docker
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
OUTDIR=artifacts
rm ${OUTDIR} -fr
rm ${OUTDIR}/package/${PACKAGE} -fr
mkdir ${OUTDIR} 2>/dev/null
docker run -i --rm -v "${PWD}/${OUTDIR}:/packages/" toltec:build /bin/bash << COMMANDS
scripts/build-package package/${PACKAGE} /packages/package/${PACKAGE}
Expand Down

0 comments on commit 89de284

Please sign in to comment.