Skip to content
This repository has been archived by the owner on Jul 23, 2023. It is now read-only.

Commit

Permalink
let a single make build the most single useful thing.
Browse files Browse the repository at this point in the history
  • Loading branch information
fiatjaf committed Apr 9, 2019
1 parent 2725ea5 commit e2b2c06
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 7 deletions.
10 changes: 6 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,16 +1,18 @@
all: prod

prod: $(shell find . -name "*.go") node_modules/spark-wallet
go-bindata -tags full -prefix node_modules/spark-wallet/dist/www -o bindata.go node_modules/spark-wallet/dist/www/...
go build -tags full -o ./sparko -ldflags "-X main.Version=$$(jq -r '.version' node_modules/spark-wallet/package.json)"

dist: $(shell find . -name "*.go") node_modules/spark-wallet
go-bindata -tags full -prefix node_modules/spark-wallet/dist/www -o bindata.go node_modules/spark-wallet/dist/www/...
mkdir -p dist
gox -tags="full" -osarch="darwin/amd64 linux/386 linux/amd64 linux/arm windows/386 windows/amd64" -output="dist/sparko_full_{{.OS}}_{{.Arch}}" -ldflags "-X main.Version=$$(jq -r '.version' node_modules/spark-wallet/package.json)"
gox -osarch="darwin/amd64 linux/386 linux/amd64 linux/arm windows/386 windows/amd64" -output="dist/sparko_lean_{{.OS}}_{{.Arch}}" -ldflags "-X main.Version=$$(git log --pretty=format:'%H' | head -n 1)"

sparko: $(shell find . -name "*.go") bindata.go
go build -tags full -o ./sparko -ldflags "-X main.Version=$$(jq -r '.version' node_modules/spark-wallet/package.json)"

bindata.go: node_modules/spark-wallet
sparko: $(shell find . -name "*.go") node_modules/spark-wallet
go-bindata -tags full -debug -prefix node_modules/spark-wallet/dist/www -o bindata.go node_modules/spark-wallet/dist/www/...
go build -tags full -o ./sparko -ldflags "-X main.Version=$$(jq -r '.version' node_modules/spark-wallet/package.json)"

node_modules/spark-wallet:
npm install spark-wallet
7 changes: 4 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,10 +61,11 @@ If you're looking for a RPC server to place in front of your lightningd node and

It's an ACL-like security model that is much simpler (and old) than macaroons. Read more on [PERMISSIONS.md](PERMISSIONS.md).

How to build
------------
FAQ
---

`make` should work.
* **How do I build?** `make` should work as long as you have [go-bindata](https://github.com/go-bindata/go-bindata) and all the other dependencies (maybe we move to the new Go modules thing, but not yet).
* **What are these "lean" and "full" binaries?** Lean binaries don't include the HTML/JS UI, just the server (for when you just want to call RPC methods over the wire). Doesn't make much difference, but it's something.

License
-------
Expand Down

0 comments on commit e2b2c06

Please sign in to comment.