Skip to content

Commit 34b7a57

Browse files
committed
Improved Makefile
1 parent 81350b4 commit 34b7a57

File tree

2 files changed

+6
-8
lines changed

2 files changed

+6
-8
lines changed

BUILDING.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,9 @@ Builds a statically linked binary under the current architecture, in the `bin/`
2222
Builds binaries for the 6 supported OSs/architectures, also creating the distribution archives in
2323
the `bin/` folder. Uses [xgo](https://github.com/techknowlogick/xgo) for cross compiling.
2424

25-
It's actually a three-stage process: the first time use `make dist-pre` to setup the environment;
26-
then `make dist` to build the binaries. Then you need to re-own the output dir; run the command
27-
outputted by the last `make dist`. Finally, do `make dist-post`.
25+
It's actually a two-stage process: the first time use `make dist-pre` to setup the environment;
26+
then `make dist` to build the binaries and package them. Root password required, to re-own the
27+
files (xgo produces them as root).
2828

2929
## Docker targets
3030

Makefile

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -32,18 +32,16 @@ dist-pre:
3232
dist:
3333
xgo -gcflags='-trimpath -a' -tags="netgo osusergo sqlite_omit_load_extension" -ldflags='-w -extldflags "-static"' --targets=linux/amd64,linux/arm-6,linux/arm64 ./src/
3434
xgo -trimpath --targets=windows-10.0/amd64,darwin/* ./src/
35-
echo "Run 'sudo chown -R $(whoami):$(whoami) \"github.com\" && make dist-post'"
36-
37-
dist-post:
35+
sudo chown -R `stat -c "%U:%G" Makefile` "github.com"
3836
mv github.com/proofrock/ bin
3937
rm -rf github.com/
4038
mv bin/ws4sql-windows-10.0-amd64.exe bin/ws4sql.exe
4139
cd bin/ && zip -9 ws4sql-v0.17.0beta1-win-x86_64.zip ws4sql.exe
4240
rm bin/ws4sql.exe
4341
mv bin/ws4sql-darwin-10.12-amd64 bin/ws4sql
44-
cd bin/ && bash -c "tar c ws4sql | gzip -9 > ws4sql-v0.17.0beta1-darwin-x86_64.tar.gz"
42+
cd bin/ && zip -9 ws4sql-v0.17.0beta1-darwin-x86_64.zip ws4sql
4543
mv bin/ws4sql-darwin-10.12-arm64 bin/ws4sql
46-
cd bin/ && bash -c "tar c ws4sql | gzip -9 > ws4sql-v0.17.0beta1-darwin-arm64.tar.gz"
44+
cd bin/ && zip -9 ws4sql-v0.17.0beta1-darwin-arm64.zip ws4sql
4745
mv bin/ws4sql-linux-amd64 bin/ws4sql
4846
cd bin/ && bash -c "tar c ws4sql | gzip -9 > ws4sql-v0.17.0beta1-linux-x86_64.tar.gz"
4947
mv bin/ws4sql-linux-arm64 bin/ws4sql

0 commit comments

Comments
 (0)