summaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorRuben Pollan <meskio@sindominio.net>2019-01-12 18:18:23 +0100
committerRuben Pollan <meskio@sindominio.net>2019-01-15 14:39:21 +0100
commitbea32af5d45702e5608d347bf2bf6314d899f2e0 (patch)
tree3a3b65123a751624a866176d9d59424707474363 /Makefile
parent933ad2aeda754499753e91be05aa9f5556539d35 (diff)
[feat] Reorganize code
Let's use a more structured folder system: https://github.com/golang-standards/project-layout - Resolves: #99
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile30
1 files changed, 16 insertions, 14 deletions
diff --git a/Makefile b/Makefile
index 5d3847b..f03f5eb 100644
--- a/Makefile
+++ b/Makefile
@@ -8,27 +8,29 @@ get:
go get -tags $(TAGS) ./...
go get -tags "$(TAGS) bitmaskd" ./...
-build:
- go build -tags $(TAGS) -ldflags "-X main.version=`git describe --tags`"
+build: $(foreach path,$(wildcard cmd/*),build_$(patsubst cmd/%,%,$(path)))
+
+build_%:
+ go build -tags $(TAGS) -ldflags "-X main.version=`git describe --tags`" -o $* ./cmd/$*
test:
go test -tags "integration $(TAGS)" ./...
build_bitmaskd:
- go build -tags "$(TAGS) bitmaskd" -ldflags "-X main.version=`git describe --tags`"
+ go build -tags "$(TAGS) bitmaskd" -ldflags "-X main.version=`git describe --tags`" ./cmd/*
build_win:
- powershell -Command '$$version=git describe --tags; go build -ldflags "-H windowsgui -X main.version=$$version"'
+ powershell -Command '$$version=git describe --tags; go build -ldflags "-H windowsgui -X main.version=$$version" ./cmd/*'
clean:
make -C icon clean
- rm bitmask-systray
+ rm bitmask-vpn
icon:
make -C icon
get_deps:
- sudo apt install libgtk-3-dev libappindicator3-dev golang pkg-config
+ sudo apt install libgtk-3-dev libappindicator3-dev golang pkg-config
LANGS ?= $(foreach path,$(wildcard locales/*),$(patsubst locales/%,%,$(path)))
@@ -36,17 +38,17 @@ empty :=
space := $(empty) $(empty)
lang_list := $(subst $(space),,$(foreach lang,$(LANGS),$(lang),))
-locales: $(foreach lang,$(LANGS),get_$(lang)) catalog.go
+locales: $(foreach lang,$(LANGS),get_$(lang)) cmd/bitmask-vpn/catalog.go
generate_locales: $(foreach lang,$(LANGS),locales/$(lang)/out.gotext.json)
- make -C transifex
+ make -C tools/transifex
-locales/%/out.gotext.json: systray.go notificator.go
- gotext update -lang=$*
+locales/%/out.gotext.json: pkg/systray/systray.go pkg/systray/notificator.go pkg/bitmask/standalone.go pkg/bitmask/bitmaskd.go
+ gotext update -lang=$* ./pkg/systray ./pkg/bitmask
-catalog.go: $(foreach lang,$(LANGS),locales/$(lang)/messages.gotext.json)
- gotext update -lang=$(lang_list) -out catalog.go
+cmd/bitmask-vpn/catalog.go: $(foreach lang,$(LANGS),locales/$(lang)/messages.gotext.json)
+ gotext update -lang=$(lang_list) -out cmd/bitmask-vpn/catalog.go ./pkg/systray ./pkg/bitmask
get_%:
- make -C transifex build
- curl -L -X GET --user "api:${API_TOKEN}" "https://www.transifex.com/api/2/project/bitmask/resource/RiseupVPN/translation/${subst -,_,$*}/?file" | transifex/transifex t2g locales/$*/
+ make -C tools/transifex build
+ curl -L -X GET --user "api:${API_TOKEN}" "https://www.transifex.com/api/2/project/bitmask/resource/RiseupVPN/translation/${subst -,_,$*}/?file" | tools/transifex/transifex t2g locales/$*/