2017-12-14 10:38:44 +00:00
|
|
|
.PHONY: default release clean build-app build-server dist dist-zip sums test
|
2017-12-12 14:12:07 +00:00
|
|
|
|
2018-01-29 16:06:44 +00:00
|
|
|
GRADLE ?= ./gradlew
|
|
|
|
|
|
|
|
APP_BUILD_DIR := app-build
|
2017-12-12 14:12:07 +00:00
|
|
|
DIST := dist
|
|
|
|
TARGET_DIR := scrcpy
|
|
|
|
|
|
|
|
VERSION := $(shell git describe --tags --always)
|
|
|
|
TARGET := $(TARGET_DIR)-$(VERSION).zip
|
|
|
|
|
|
|
|
default:
|
|
|
|
@echo 'You must specify a target. Try: make release'
|
|
|
|
|
|
|
|
release: clean dist-zip sums
|
|
|
|
|
|
|
|
clean:
|
2018-01-29 16:06:44 +00:00
|
|
|
$(GRADLE) clean
|
|
|
|
rm -rf "$(APP_BUILD_DIR)" "$(DIST)"
|
2017-12-12 14:12:07 +00:00
|
|
|
|
|
|
|
build-app:
|
2018-01-29 16:06:44 +00:00
|
|
|
[ -d "$(APP_BUILD_DIR)" ] || ( mkdir "$(APP_BUILD_DIR)" && meson app "$(APP_BUILD_DIR)" --buildtype release )
|
|
|
|
ninja -C "$(APP_BUILD_DIR)"
|
2017-12-12 14:12:07 +00:00
|
|
|
|
|
|
|
build-server:
|
2018-01-29 16:06:44 +00:00
|
|
|
$(GRADLE) assembleRelease
|
2017-12-12 14:12:07 +00:00
|
|
|
|
2018-01-29 16:06:44 +00:00
|
|
|
dist: build-server build-app
|
2017-12-12 14:12:07 +00:00
|
|
|
mkdir -p "$(DIST)/$(TARGET_DIR)"
|
2018-01-29 16:06:44 +00:00
|
|
|
# no need to sign the APK, we dont "install" it
|
|
|
|
cp server/build/outputs/apk/release/server-release-unsigned.apk "$(DIST)/$(TARGET_DIR)/scrcpy.apk"
|
|
|
|
cp $(APP_BUILD_DIR)/scrcpy "$(DIST)/$(TARGET_DIR)/"
|
2017-12-12 14:12:07 +00:00
|
|
|
|
|
|
|
dist-zip: dist
|
|
|
|
cd "$(DIST)"; \
|
|
|
|
zip -r "$(TARGET)" "$(TARGET_DIR)"
|
|
|
|
|
|
|
|
sums:
|
|
|
|
cd "$(DIST)"; \
|
|
|
|
sha256sum *.zip > SHA256SUM.txt
|
2017-12-14 10:38:44 +00:00
|
|
|
|
|
|
|
test:
|
2018-01-29 16:06:44 +00:00
|
|
|
$(GRADLE) test
|
|
|
|
ninja -C "$(APP_BUILD_DIR)" test
|