2016-07-22 19:30:21 +03:00
|
|
|
BINDIR=bin
|
|
|
|
BIN=custom-script-extension
|
2021-09-28 22:07:25 +03:00
|
|
|
BIN_ARM64=custom-script-extension-arm64
|
2016-07-29 00:39:53 +03:00
|
|
|
BUNDLEDIR=bundle
|
|
|
|
BUNDLE=custom-script-extension.zip
|
2016-07-22 19:30:21 +03:00
|
|
|
|
2016-07-29 00:43:15 +03:00
|
|
|
bundle: clean binary
|
|
|
|
@mkdir -p $(BUNDLEDIR)
|
2021-09-28 22:07:25 +03:00
|
|
|
zip -r ./$(BUNDLEDIR)/$(BUNDLE) ./$(BINDIR)
|
2016-08-01 23:51:52 +03:00
|
|
|
zip -j ./$(BUNDLEDIR)/$(BUNDLE) ./misc/HandlerManifest.json
|
2016-08-02 09:14:15 +03:00
|
|
|
zip -j ./$(BUNDLEDIR)/$(BUNDLE) ./misc/manifest.xml
|
|
|
|
|
2016-07-22 19:30:21 +03:00
|
|
|
binary: clean
|
|
|
|
if [ -z "$$GOPATH" ]; then \
|
|
|
|
echo "GOPATH is not set"; \
|
|
|
|
exit 1; \
|
|
|
|
fi
|
2016-08-11 21:49:36 +03:00
|
|
|
GOOS=linux GOARCH=amd64 govvv build -v \
|
|
|
|
-ldflags "-X main.Version=`grep -E -m 1 -o '<Version>(.*)</Version>' misc/manifest.xml | awk -F">" '{print $$2}' | awk -F"<" '{print $$1}'`" \
|
2016-08-01 23:44:25 +03:00
|
|
|
-o $(BINDIR)/$(BIN) ./main
|
2021-09-28 22:07:25 +03:00
|
|
|
GOOS=linux GOARCH=arm64 govvv build -v \
|
|
|
|
-ldflags "-X main.Version=`grep -E -m 1 -o '<Version>(.*)</Version>' misc/manifest.xml | awk -F">" '{print $$2}' | awk -F"<" '{print $$1}'`" \
|
|
|
|
-o $(BINDIR)/$(BIN_ARM64) ./main
|
2016-07-29 00:39:53 +03:00
|
|
|
cp ./misc/custom-script-shim ./$(BINDIR)
|
2016-07-22 19:30:21 +03:00
|
|
|
clean:
|
2016-07-29 00:39:53 +03:00
|
|
|
rm -rf "$(BINDIR)" "$(BUNDLEDIR)"
|
2016-07-22 19:30:21 +03:00
|
|
|
|
2016-07-29 00:39:53 +03:00
|
|
|
.PHONY: clean binary
|