2020-04-08 10:59:16 +00:00
|
|
|
export GO111MODULE=on
|
2020-05-18 06:18:34 +00:00
|
|
|
|
|
|
|
# By default, the target OS is the same as the host OS,
|
|
|
|
# but this can be overridden by setting TARGET_OS to "windows"/"darwin"/"linux".
|
2020-04-08 10:59:16 +00:00
|
|
|
GOOS:=$(shell go env GOOS)
|
2020-05-27 13:58:50 +00:00
|
|
|
TARGET_CMD?=Desktop-Bridge
|
2020-05-18 06:18:34 +00:00
|
|
|
TARGET_OS?=${GOOS}
|
2020-04-08 10:59:16 +00:00
|
|
|
|
|
|
|
## Build
|
2020-12-02 15:31:03 +00:00
|
|
|
.PHONY: build build-ie build-nogui build-ie-nogui build-launcher build-launcher-ie versioner hasher
|
2020-04-08 10:59:16 +00:00
|
|
|
|
2020-08-27 06:13:08 +00:00
|
|
|
# Keep version hardcoded so app build works also without Git repository.
|
2021-01-20 15:48:03 +00:00
|
|
|
BRIDGE_APP_VERSION?=1.5.6+git
|
2020-10-23 08:05:26 +00:00
|
|
|
IE_APP_VERSION?=1.2.3+git
|
2020-08-20 14:09:47 +00:00
|
|
|
APP_VERSION:=${BRIDGE_APP_VERSION}
|
|
|
|
SRC_ICO:=logo.ico
|
|
|
|
SRC_ICNS:=Bridge.icns
|
|
|
|
SRC_SVG:=logo.svg
|
|
|
|
TGT_ICNS:=Bridge.icns
|
2020-11-11 13:06:50 +00:00
|
|
|
EXE_NAME:=proton-bridge
|
2020-12-16 23:13:16 +00:00
|
|
|
CONFIGNAME:=bridge
|
2020-06-17 13:29:41 +00:00
|
|
|
ifeq "${TARGET_CMD}" "Import-Export"
|
2020-08-20 14:09:47 +00:00
|
|
|
APP_VERSION:=${IE_APP_VERSION}
|
|
|
|
SRC_ICO:=ie.ico
|
|
|
|
SRC_ICNS:=ie.icns
|
|
|
|
SRC_SVG:=ie.svg
|
|
|
|
TGT_ICNS:=ImportExport.icns
|
2020-11-11 13:06:50 +00:00
|
|
|
EXE_NAME:=proton-ie
|
2020-12-16 23:13:16 +00:00
|
|
|
CONFIGNAME:=importExport
|
2020-06-17 13:29:41 +00:00
|
|
|
endif
|
2020-04-08 10:59:16 +00:00
|
|
|
REVISION:=$(shell git rev-parse --short=10 HEAD)
|
|
|
|
BUILD_TIME:=$(shell date +%FT%T%z)
|
|
|
|
|
|
|
|
BUILD_FLAGS:=-tags='${BUILD_TAGS}'
|
2020-12-16 23:13:16 +00:00
|
|
|
BUILD_FLAGS_LAUNCHER:=${BUILD_FLAGS}
|
2020-04-08 10:59:16 +00:00
|
|
|
BUILD_FLAGS_NOGUI:=-tags='${BUILD_TAGS} nogui'
|
2020-11-23 10:56:57 +00:00
|
|
|
GO_LDFLAGS:=$(addprefix -X github.com/ProtonMail/proton-bridge/internal/constants.,Version=${APP_VERSION} Revision=${REVISION} BuildTime=${BUILD_TIME})
|
2020-04-08 10:59:16 +00:00
|
|
|
ifneq "${BUILD_LDFLAGS}" ""
|
2020-12-16 23:13:16 +00:00
|
|
|
GO_LDFLAGS+=${BUILD_LDFLAGS}
|
2020-04-08 10:59:16 +00:00
|
|
|
endif
|
2020-12-16 23:13:16 +00:00
|
|
|
GO_LDFLAGS_LAUNCHER:=${GO_LDFLAGS}
|
|
|
|
GO_LDFLAGS_LAUNCHER+=$(addprefix -X main.,ConfigName=${CONFIGNAME} ExeName=proton-${APP})
|
2021-01-12 16:11:28 +00:00
|
|
|
ifeq "${TARGET_OS}" "windows"
|
|
|
|
GO_LDFLAGS_LAUNCHER+=-H=windowsgui
|
2020-04-08 10:59:16 +00:00
|
|
|
endif
|
2020-12-16 23:13:16 +00:00
|
|
|
|
|
|
|
BUILD_FLAGS+=-ldflags '${GO_LDFLAGS}'
|
|
|
|
BUILD_FLAGS_NOGUI+=-ldflags '${GO_LDFLAGS}'
|
|
|
|
BUILD_FLAGS_LAUNCHER+=-ldflags '${GO_LDFLAGS_LAUNCHER}'
|
2020-04-08 10:59:16 +00:00
|
|
|
|
2020-05-27 13:58:50 +00:00
|
|
|
DEPLOY_DIR:=cmd/${TARGET_CMD}/deploy
|
2020-04-08 10:59:16 +00:00
|
|
|
ICO_FILES:=
|
2020-11-11 13:06:50 +00:00
|
|
|
DIRNAME:=$(shell basename ${CURDIR})
|
|
|
|
EXE:=${EXE_NAME}
|
|
|
|
EXE_QT:=${DIRNAME}
|
2020-05-18 06:18:34 +00:00
|
|
|
ifeq "${TARGET_OS}" "windows"
|
2020-05-21 08:24:23 +00:00
|
|
|
EXE:=${EXE}.exe
|
2020-11-11 13:06:50 +00:00
|
|
|
EXE_QT:=${EXE_QT}.exe
|
2020-08-20 14:09:47 +00:00
|
|
|
ICO_FILES:=${SRC_ICO} icon.rc icon_windows.syso
|
2020-04-08 10:59:16 +00:00
|
|
|
endif
|
2020-05-18 06:18:34 +00:00
|
|
|
ifeq "${TARGET_OS}" "darwin"
|
2020-04-08 10:59:16 +00:00
|
|
|
DARWINAPP_CONTENTS:=${DEPLOY_DIR}/darwin/${EXE}.app/Contents
|
2020-11-11 13:06:50 +00:00
|
|
|
EXE:=${EXE}.app
|
|
|
|
EXE_QT:=${EXE_QT}.app
|
|
|
|
EXE_BINARY_DARWIN:=/Contents/MacOS/${EXE_NAME}
|
2020-04-08 10:59:16 +00:00
|
|
|
endif
|
2020-05-18 06:18:34 +00:00
|
|
|
EXE_TARGET:=${DEPLOY_DIR}/${TARGET_OS}/${EXE}
|
2020-11-11 13:06:50 +00:00
|
|
|
EXE_QT_TARGET:=${DEPLOY_DIR}/${TARGET_OS}/${EXE_QT}
|
2020-05-27 13:58:50 +00:00
|
|
|
|
2020-05-18 06:18:34 +00:00
|
|
|
TGZ_TARGET:=bridge_${TARGET_OS}_${REVISION}.tgz
|
2020-05-27 13:58:50 +00:00
|
|
|
ifeq "${TARGET_CMD}" "Import-Export"
|
|
|
|
TGZ_TARGET:=ie_${TARGET_OS}_${REVISION}.tgz
|
|
|
|
endif
|
2020-04-08 10:59:16 +00:00
|
|
|
|
2020-12-07 10:41:07 +00:00
|
|
|
ifdef QT_API
|
|
|
|
VENDOR_TARGET:=prepare-vendor update-qt-docs
|
|
|
|
else
|
|
|
|
VENDOR_TARGET=update-vendor
|
|
|
|
endif
|
|
|
|
|
2020-05-21 08:24:23 +00:00
|
|
|
build: ${TGZ_TARGET}
|
2020-11-23 10:56:57 +00:00
|
|
|
|
2020-05-27 13:58:50 +00:00
|
|
|
build-ie:
|
|
|
|
TARGET_CMD=Import-Export $(MAKE) build
|
2020-05-19 14:19:51 +00:00
|
|
|
|
2020-04-24 08:47:48 +00:00
|
|
|
build-nogui:
|
2020-11-23 06:29:10 +00:00
|
|
|
go build ${BUILD_FLAGS_NOGUI} -o ${EXE_NAME} cmd/${TARGET_CMD}/main.go
|
2020-05-27 13:58:50 +00:00
|
|
|
|
|
|
|
build-ie-nogui:
|
|
|
|
TARGET_CMD=Import-Export $(MAKE) build-nogui
|
2020-04-24 08:47:48 +00:00
|
|
|
|
2020-11-23 10:56:57 +00:00
|
|
|
build-launcher:
|
2020-12-16 23:13:16 +00:00
|
|
|
go build ${BUILD_FLAGS_LAUNCHER} -o launcher-${APP} cmd/launcher/main.go
|
2020-11-23 10:56:57 +00:00
|
|
|
|
|
|
|
build-launcher-ie:
|
2020-12-16 23:13:16 +00:00
|
|
|
TARGET_CMD=Import-Export $(MAKE) build-launcher
|
2020-11-23 10:56:57 +00:00
|
|
|
|
|
|
|
versioner:
|
2020-12-16 23:13:16 +00:00
|
|
|
go build ${BUILD_FLAGS} -o versioner utils/versioner/main.go
|
2020-12-02 15:31:03 +00:00
|
|
|
|
|
|
|
hasher:
|
|
|
|
go build -o hasher utils/hasher/main.go
|
2020-11-23 10:56:57 +00:00
|
|
|
|
2020-05-18 06:18:34 +00:00
|
|
|
${TGZ_TARGET}: ${DEPLOY_DIR}/${TARGET_OS}
|
2020-04-08 10:59:16 +00:00
|
|
|
rm -f $@
|
2020-11-23 10:56:57 +00:00
|
|
|
cd ${DEPLOY_DIR}/${TARGET_OS} && tar czf ../../../../$@ .
|
2020-04-08 10:59:16 +00:00
|
|
|
|
|
|
|
${DEPLOY_DIR}/linux: ${EXE_TARGET}
|
2020-08-20 14:09:47 +00:00
|
|
|
cp -pf ./internal/frontend/share/icons/${SRC_SVG} ${DEPLOY_DIR}/linux/logo.svg
|
2020-04-08 10:59:16 +00:00
|
|
|
cp -pf ./LICENSE ${DEPLOY_DIR}/linux/
|
|
|
|
cp -pf ./Changelog.md ${DEPLOY_DIR}/linux/
|
|
|
|
|
|
|
|
${DEPLOY_DIR}/darwin: ${EXE_TARGET}
|
2020-11-11 13:06:50 +00:00
|
|
|
if [ "${DIRNAME}" != "${EXE_NAME}" ]; then \
|
|
|
|
mv ${EXE_TARGET}/Contents/MacOS/{${DIRNAME},${EXE_NAME}}; \
|
|
|
|
perl -i -pe"s/>${DIRNAME}/>${EXE_NAME}/g" ${EXE_TARGET}/Contents/Info.plist; \
|
|
|
|
fi
|
2020-08-20 14:09:47 +00:00
|
|
|
cp ./internal/frontend/share/icons/${SRC_ICNS} ${DARWINAPP_CONTENTS}/Resources/${TGT_ICNS}
|
2020-04-08 10:59:16 +00:00
|
|
|
cp LICENSE ${DARWINAPP_CONTENTS}/Resources/
|
|
|
|
rm -rf "${DARWINAPP_CONTENTS}/Frameworks/QtWebEngine.framework"
|
|
|
|
rm -rf "${DARWINAPP_CONTENTS}/Frameworks/QtWebView.framework"
|
|
|
|
rm -rf "${DARWINAPP_CONTENTS}/Frameworks/QtWebEngineCore.framework"
|
2020-11-11 13:06:50 +00:00
|
|
|
./utils/remove_non_relative_links_darwin.sh "${EXE_TARGET}${EXE_BINARY_DARWIN}"
|
2020-04-08 10:59:16 +00:00
|
|
|
|
|
|
|
${DEPLOY_DIR}/windows: ${EXE_TARGET}
|
2020-08-20 14:09:47 +00:00
|
|
|
cp ./internal/frontend/share/icons/${SRC_ICO} ${DEPLOY_DIR}/windows/logo.ico
|
2020-04-20 17:10:02 +00:00
|
|
|
cp LICENSE ${DEPLOY_DIR}/windows/
|
2020-04-08 10:59:16 +00:00
|
|
|
|
2020-05-18 06:18:34 +00:00
|
|
|
QT_BUILD_TARGET:=build desktop
|
|
|
|
ifneq "${GOOS}" "${TARGET_OS}"
|
|
|
|
ifeq "${TARGET_OS}" "windows"
|
|
|
|
QT_BUILD_TARGET:=-docker build windows_64_shared
|
|
|
|
endif
|
|
|
|
endif
|
|
|
|
|
2020-12-07 10:41:07 +00:00
|
|
|
${EXE_TARGET}: check-has-go gofiles ${ICO_FILES} ${VENDOR_TARGET}
|
2020-05-18 06:18:34 +00:00
|
|
|
rm -rf deploy ${TARGET_OS} ${DEPLOY_DIR}
|
2020-05-27 13:58:50 +00:00
|
|
|
cp cmd/${TARGET_CMD}/main.go .
|
2020-05-18 06:18:34 +00:00
|
|
|
qtdeploy ${BUILD_FLAGS} ${QT_BUILD_TARGET}
|
2020-05-27 13:58:50 +00:00
|
|
|
mv deploy cmd/${TARGET_CMD}
|
2020-11-11 13:06:50 +00:00
|
|
|
if [ "${EXE_QT_TARGET}" != "${EXE_TARGET}" ]; then mv ${EXE_QT_TARGET} ${EXE_TARGET}; fi
|
2020-05-18 06:18:34 +00:00
|
|
|
rm -rf ${TARGET_OS} main.go
|
2020-04-08 10:59:16 +00:00
|
|
|
|
2020-08-20 14:09:47 +00:00
|
|
|
logo.ico ie.ico: ./internal/frontend/share/icons/${SRC_ICO}
|
|
|
|
cp $^ $@
|
2020-04-08 10:59:16 +00:00
|
|
|
icon.rc: ./internal/frontend/share/icon.rc
|
|
|
|
cp $^ .
|
2020-08-20 14:09:47 +00:00
|
|
|
icon_windows.syso: icon.rc logo.ico
|
2020-05-18 08:30:18 +00:00
|
|
|
windres --target=pe-x86-64 -o $@ $<
|
2020-04-08 10:59:16 +00:00
|
|
|
|
|
|
|
|
|
|
|
## Rules for therecipe/qt
|
2020-12-07 10:41:07 +00:00
|
|
|
.PHONY: prepare-vendor update-vendor update-qt-docs
|
2020-05-18 06:18:34 +00:00
|
|
|
THERECIPE_ENV:=github.com/therecipe/env_${TARGET_OS}_amd64_513
|
2020-04-08 10:59:16 +00:00
|
|
|
|
|
|
|
# vendor folder will be deleted by gomod hence we cache the big repo
|
|
|
|
# therecipe/env in order to download it only once
|
|
|
|
vendor-cache/${THERECIPE_ENV}:
|
|
|
|
git clone https://${THERECIPE_ENV}.git vendor-cache/${THERECIPE_ENV}
|
|
|
|
|
2020-05-18 06:18:34 +00:00
|
|
|
# The command used to make symlinks is different on windows.
|
|
|
|
# So if the GOOS is windows and we aren't crossbuilding (in which case the host os would still be *nix)
|
|
|
|
# we need to change the LINKCMD to something windowsy.
|
2020-04-08 10:59:16 +00:00
|
|
|
LINKCMD:=ln -sf ${CURDIR}/vendor-cache/${THERECIPE_ENV} vendor/${THERECIPE_ENV}
|
|
|
|
ifeq "${GOOS}" "windows"
|
2020-05-18 06:18:34 +00:00
|
|
|
WINDIR:=$(subst /c/,c:\\,${CURDIR})/vendor-cache/${THERECIPE_ENV}
|
|
|
|
LINKCMD:=cmd //c 'mklink $(subst /,\,vendor\${THERECIPE_ENV} ${WINDIR})'
|
2020-04-08 10:59:16 +00:00
|
|
|
endif
|
|
|
|
|
|
|
|
prepare-vendor:
|
|
|
|
go install -v -tags=no_env github.com/therecipe/qt/cmd/...
|
|
|
|
go mod vendor
|
|
|
|
|
|
|
|
# update-vendor is PHONY because we need to make sure that we always have updated vendor
|
|
|
|
update-vendor: vendor-cache/${THERECIPE_ENV} prepare-vendor
|
|
|
|
${LINKCMD}
|
|
|
|
|
2020-12-07 10:41:07 +00:00
|
|
|
update-qt-docs:
|
|
|
|
go get github.com/therecipe/qt/internal/binding/files/docs/$(QT_API)
|
2020-04-08 10:59:16 +00:00
|
|
|
|
|
|
|
## Dev dependencies
|
|
|
|
.PHONY: install-devel-tools install-linter install-go-mod-outdated
|
2020-07-28 07:34:16 +00:00
|
|
|
LINTVER:="v1.29.0"
|
2020-04-08 10:59:16 +00:00
|
|
|
LINTSRC:="https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh"
|
|
|
|
|
|
|
|
install-dev-dependencies: install-devel-tools install-linter install-go-mod-outdated
|
|
|
|
|
|
|
|
install-devel-tools: check-has-go
|
|
|
|
go get -v github.com/golang/mock/gomock
|
|
|
|
go get -v github.com/golang/mock/mockgen
|
|
|
|
go get -v github.com/go-delve/delve
|
|
|
|
|
|
|
|
install-linter: check-has-go
|
|
|
|
curl -sfL $(LINTSRC) | sh -s -- -b $(shell go env GOPATH)/bin $(LINTVER)
|
|
|
|
|
|
|
|
install-go-mod-outdated:
|
|
|
|
which go-mod-outdated || go get -u github.com/psampaz/go-mod-outdated
|
|
|
|
|
|
|
|
|
|
|
|
## Checks, mocks and docs
|
2020-10-23 08:05:26 +00:00
|
|
|
.PHONY: check-has-go add-license change-copyright-year test bench coverage mocks lint-license lint-golang lint updates doc release-notes
|
2020-04-08 10:59:16 +00:00
|
|
|
check-has-go:
|
|
|
|
@which go || (echo "Install Go-lang!" && exit 1)
|
|
|
|
|
2020-05-28 12:25:00 +00:00
|
|
|
add-license:
|
|
|
|
./utils/missing_license.sh add
|
|
|
|
|
|
|
|
change-copyright-year:
|
|
|
|
./utils/missing_license.sh change-year
|
2020-04-08 10:59:16 +00:00
|
|
|
|
|
|
|
test: gofiles
|
|
|
|
@# Listing packages manually to not run Qt folder (which needs to run qtsetup first) and integration tests.
|
|
|
|
go test -coverprofile=/tmp/coverage.out -run=${TESTRUN} \
|
|
|
|
./internal/api/... \
|
|
|
|
./internal/bridge/... \
|
2020-11-23 10:56:57 +00:00
|
|
|
./internal/config/... \
|
|
|
|
./internal/constants/... \
|
|
|
|
./internal/cookies/... \
|
|
|
|
./internal/crash/... \
|
2020-04-08 10:59:16 +00:00
|
|
|
./internal/events/... \
|
|
|
|
./internal/frontend/autoconfig/... \
|
|
|
|
./internal/frontend/cli/... \
|
|
|
|
./internal/imap/... \
|
2020-05-14 13:22:29 +00:00
|
|
|
./internal/importexport/... \
|
2020-11-23 10:56:57 +00:00
|
|
|
./internal/locations/... \
|
|
|
|
./internal/logging/... \
|
|
|
|
./internal/metrics/... \
|
2020-04-08 10:59:16 +00:00
|
|
|
./internal/smtp/... \
|
|
|
|
./internal/store/... \
|
2020-05-14 13:22:29 +00:00
|
|
|
./internal/transfer/... \
|
2020-11-23 10:56:57 +00:00
|
|
|
./internal/updater/... \
|
2020-05-21 12:37:15 +00:00
|
|
|
./internal/users/... \
|
2020-11-23 10:56:57 +00:00
|
|
|
./internal/versioner/... \
|
2020-04-08 10:59:16 +00:00
|
|
|
./pkg/...
|
|
|
|
|
|
|
|
bench:
|
|
|
|
go test -run '^$$' -bench=. -memprofile bench_mem.pprof -cpuprofile bench_cpu.pprof ./internal/store
|
|
|
|
go tool pprof -png -output bench_mem.png bench_mem.pprof
|
|
|
|
go tool pprof -png -output bench_cpu.png bench_cpu.pprof
|
|
|
|
|
|
|
|
coverage: test
|
|
|
|
go tool cover -html=/tmp/coverage.out -o=coverage.html
|
|
|
|
|
|
|
|
mocks:
|
2020-11-23 10:56:57 +00:00
|
|
|
mockgen --package mocks github.com/ProtonMail/proton-bridge/internal/users Locator,PanicHandler,ClientManager,CredentialsStorer,StoreMaker > internal/users/mocks/mocks.go
|
2020-11-06 13:23:38 +00:00
|
|
|
mockgen --package mocks github.com/ProtonMail/proton-bridge/internal/transfer PanicHandler,ClientManager,IMAPClientProvider > internal/transfer/mocks/mocks.go
|
2020-11-24 13:53:38 +00:00
|
|
|
mockgen --package mocks github.com/ProtonMail/proton-bridge/internal/store PanicHandler,ClientManager,BridgeUser,ChangeNotifier > internal/store/mocks/mocks.go
|
2020-04-08 10:59:16 +00:00
|
|
|
mockgen --package mocks github.com/ProtonMail/proton-bridge/pkg/listener Listener > internal/store/mocks/utils_mocks.go
|
2020-04-06 14:02:37 +00:00
|
|
|
mockgen --package mocks github.com/ProtonMail/proton-bridge/pkg/pmapi Client > pkg/pmapi/mocks/mocks.go
|
2020-04-08 10:59:16 +00:00
|
|
|
|
2020-11-24 14:31:25 +00:00
|
|
|
lint: lint-golang lint-license lint-changelog
|
2020-05-28 12:25:00 +00:00
|
|
|
|
|
|
|
lint-license:
|
|
|
|
./utils/missing_license.sh check
|
|
|
|
|
2020-11-24 14:31:25 +00:00
|
|
|
lint-changelog:
|
2020-12-30 09:06:11 +00:00
|
|
|
./utils/changelog_linter.sh Changelog.md
|
|
|
|
./utils/changelog_linter.sh unreleased.md
|
2020-11-24 14:31:25 +00:00
|
|
|
|
2020-05-28 12:25:00 +00:00
|
|
|
lint-golang:
|
2020-04-08 10:59:16 +00:00
|
|
|
which golangci-lint || $(MAKE) install-linter
|
2020-12-11 10:27:26 +00:00
|
|
|
$(info linting with GOMAXPROCS=${GOMAXPROCS})
|
2020-04-08 10:59:16 +00:00
|
|
|
golangci-lint run ./...
|
|
|
|
|
|
|
|
updates: install-go-mod-outdated
|
|
|
|
# Uncomment the "-ci" to fail the job if something can be updated.
|
|
|
|
go list -u -m -json all | go-mod-outdated -update -direct #-ci
|
|
|
|
|
|
|
|
doc:
|
|
|
|
godoc -http=:6060
|
|
|
|
|
2021-01-18 10:52:17 +00:00
|
|
|
release-notes: release-notes/bridge.html release-notes/ie.html
|
2020-10-23 08:05:26 +00:00
|
|
|
|
|
|
|
release-notes/bridge.html:
|
2021-01-18 10:52:17 +00:00
|
|
|
./utils/release_notes.sh bridge
|
2020-10-23 08:05:26 +00:00
|
|
|
|
2021-01-18 10:52:17 +00:00
|
|
|
release-notes/ie.html:
|
|
|
|
./utils/release_notes.sh ie
|
2020-10-23 08:05:26 +00:00
|
|
|
|
2020-04-08 10:59:16 +00:00
|
|
|
.PHONY: gofiles
|
|
|
|
# Following files are for the whole app so it makes sense to have them in bridge package.
|
|
|
|
# (Options like cmd or internal were considered and bridge package is the best place for them.)
|
2020-10-23 08:05:26 +00:00
|
|
|
gofiles: ./internal/bridge/credits.go ./internal/importexport/credits.go
|
2020-04-08 10:59:16 +00:00
|
|
|
./internal/bridge/credits.go: ./utils/credits.sh go.mod
|
2020-05-14 13:22:29 +00:00
|
|
|
cd ./utils/ && ./credits.sh bridge
|
|
|
|
./internal/importexport/credits.go: ./utils/credits.sh go.mod
|
|
|
|
cd ./utils/ && ./credits.sh importexport
|
2020-04-08 10:59:16 +00:00
|
|
|
|
|
|
|
|
|
|
|
## Run and debug
|
2020-08-12 11:56:49 +00:00
|
|
|
.PHONY: run run-qt run-qt-cli run-nogui run-nogui-cli run-debug run-qml-preview run-ie-qml-preview run-ie run-ie-qt run-ie-qt-cli run-ie-nogui run-ie-nogui-cli clean-vendor clean-frontend-qt clean-frontend-qt-ie clean-frontend-qt-common clean
|
|
|
|
|
2020-11-23 10:56:57 +00:00
|
|
|
VERBOSITY?=debug
|
2020-04-08 10:59:16 +00:00
|
|
|
RUN_FLAGS:=-m -l=${VERBOSITY}
|
|
|
|
|
|
|
|
run: run-nogui-cli
|
|
|
|
|
|
|
|
run-qt: ${EXE_TARGET}
|
|
|
|
PROTONMAIL_ENV=dev ./$< ${RUN_FLAGS} | tee last.log
|
|
|
|
run-qt-cli: ${EXE_TARGET}
|
|
|
|
PROTONMAIL_ENV=dev ./$< ${RUN_FLAGS} -c
|
|
|
|
|
|
|
|
run-nogui: clean-vendor gofiles
|
2020-05-27 13:58:50 +00:00
|
|
|
PROTONMAIL_ENV=dev go run ${BUILD_FLAGS_NOGUI} cmd/${TARGET_CMD}/main.go ${RUN_FLAGS} | tee last.log
|
2020-04-08 10:59:16 +00:00
|
|
|
run-nogui-cli: clean-vendor gofiles
|
2020-05-27 13:58:50 +00:00
|
|
|
PROTONMAIL_ENV=dev go run ${BUILD_FLAGS_NOGUI} cmd/${TARGET_CMD}/main.go ${RUN_FLAGS} -c
|
2020-04-08 10:59:16 +00:00
|
|
|
|
|
|
|
run-debug:
|
2020-05-27 13:58:50 +00:00
|
|
|
PROTONMAIL_ENV=dev dlv debug --build-flags "${BUILD_FLAGS_NOGUI}" cmd/${TARGET_CMD}/main.go -- ${RUN_FLAGS}
|
2020-04-08 10:59:16 +00:00
|
|
|
|
|
|
|
run-qml-preview:
|
2020-05-27 13:58:50 +00:00
|
|
|
$(MAKE) -C internal/frontend/qt -f Makefile.local qmlpreview
|
|
|
|
run-ie-qml-preview:
|
|
|
|
$(MAKE) -C internal/frontend/qt-ie -f Makefile.local qmlpreview
|
|
|
|
|
|
|
|
run-ie:
|
|
|
|
TARGET_CMD=Import-Export $(MAKE) run
|
|
|
|
run-ie-qt:
|
|
|
|
TARGET_CMD=Import-Export $(MAKE) run-qt
|
2020-08-12 11:56:49 +00:00
|
|
|
run-ie-nogui:
|
|
|
|
TARGET_CMD=Import-Export $(MAKE) run-nogui
|
|
|
|
|
2020-04-08 10:59:16 +00:00
|
|
|
clean-frontend-qt:
|
2020-05-27 13:58:50 +00:00
|
|
|
$(MAKE) -C internal/frontend/qt -f Makefile.local clean
|
|
|
|
clean-frontend-qt-ie:
|
|
|
|
$(MAKE) -C internal/frontend/qt-ie -f Makefile.local clean
|
|
|
|
clean-frontend-qt-common:
|
|
|
|
$(MAKE) -C internal/frontend/qt-common -f Makefile.local clean
|
2020-04-08 10:59:16 +00:00
|
|
|
|
2020-05-27 13:58:50 +00:00
|
|
|
clean-vendor: clean-frontend-qt clean-frontend-qt-ie clean-frontend-qt-common
|
2020-04-08 10:59:16 +00:00
|
|
|
rm -rf ./vendor
|
|
|
|
|
2020-05-27 13:58:50 +00:00
|
|
|
clean: clean-vendor
|
2020-04-08 10:59:16 +00:00
|
|
|
rm -rf vendor-cache
|
|
|
|
rm -rf cmd/Desktop-Bridge/deploy
|
2020-05-27 13:58:50 +00:00
|
|
|
rm -rf cmd/Import-Export/deploy
|
|
|
|
rm -f build last.log mem.pprof main.go
|
2020-05-18 06:18:34 +00:00
|
|
|
rm -rf logo.ico icon.rc icon_windows.syso internal/frontend/qt/icon_windows.syso
|
2020-10-23 08:05:26 +00:00
|
|
|
rm -f release-notes/bridge.html
|
|
|
|
rm -f release-notes/import-export.html
|
|
|
|
|
|
|
|
.PHONY: generate
|
|
|
|
generate:
|
|
|
|
go generate ./...
|
|
|
|
$(MAKE) add-license
|