mirror of
https://github.com/hasura/graphql-engine.git
synced 2024-12-15 17:31:56 +03:00
e80804532e
* Updated Readme.md * Updated Makefile with updated commands * Added help for Make * Fix for `cli-ext` building on mac https://github.com/hasura/graphql-engine-mono/issues/133 closes https://github.com/hasura/graphql-engine-mono/issues/133 PR-URL: https://github.com/hasura/graphql-engine-mono/pull/138 Co-authored-by: Aravind K P <8335904+scriptonist@users.noreply.github.com> GitOrigin-RevId: 02f882896997ba49657a58f7c2c9bdc877e258d5
67 lines
1.6 KiB
Makefile
67 lines
1.6 KiB
Makefile
BUILDDIR := bin
|
|
BINARY_ASSETS := $(BUILDDIR)/cli-ext-hasura-node12-linux-x64 $(BUILDDIR)/cli-ext-hasura-node12-macos-x64 $(BUILDDIR)/cli-ext-hasura-node12-win-x64.exe $(BUILDDIR)/cli-ext-hasura-node12-linux-arm64 $(BUILDDIR)/cli-ext-hasura-node16-macos-arm64
|
|
BINARY_ASSET_CHECKSUMS := $(patsubst %,%.sha256,$(BINARY_ASSETS))
|
|
GLOBALBUILDDIR ?= /build
|
|
|
|
COMPRESS := gzip --best -k -c
|
|
|
|
deps:
|
|
npm install
|
|
|
|
.PHONY: ci-deps
|
|
## ci-deps: builds if not already build
|
|
ci-deps:
|
|
if [ ! -d "node_modules" ]; then npm ci; fi
|
|
|
|
.PHONY: clean-deps
|
|
## clean-deps: deletes node_modules
|
|
clean-deps:
|
|
if [ -d "node_modules" ]; then rm -r node_modules; fi
|
|
|
|
.PHONY: build
|
|
## build: generates build
|
|
build: ci-deps
|
|
npm run build
|
|
$(MAKE) $(BINARY_ASSET_CHECKSUMS)
|
|
|
|
.PHONY: clean-build
|
|
## clean-build: generates clean build
|
|
clean-build: clean clean-deps ci-deps
|
|
npm run build
|
|
|
|
.PHONY: ci-copy-assets
|
|
ci-copy-assets:
|
|
## ci-copy-assets: copies assests to global build folder
|
|
mkdir -p $(GLOBALBUILDDIR)/_cli_ext_output
|
|
cp $(BUILDDIR)/* $(GLOBALBUILDDIR)/_cli_ext_output/
|
|
|
|
# Not supported: Refer https://github.com/zeit/pkg/issues/50
|
|
upx-compress: $(BUILDDIR)
|
|
ls $(BUILDDIR)/cli-ext-hasura-* | xargs upx
|
|
|
|
.PRECIOUS: %.zip
|
|
%.zip: %.exe
|
|
cd $(BUILDDIR) && \
|
|
zip $(patsubst $(BUILDDIR)/%, %, $@) $(patsubst $(BUILDDIR)/%, %, $<)
|
|
|
|
.PRECIOUS: %.gz
|
|
%.gz: %
|
|
$(COMPRESS) "$<" > "$@"
|
|
|
|
%.tar: %
|
|
tar cf "$@" -C $(BUILDDIR) $(patsubst $(BUILDDIR)/%,%,$^)
|
|
|
|
%.sha256: %
|
|
shasum -a 256 $< > $@
|
|
|
|
.PHONY: clean
|
|
clean:
|
|
$(RM) -r $(BUILDDIR)
|
|
|
|
.PHONY: help
|
|
## help: prints this help message
|
|
help:
|
|
@echo "Usage: \n"
|
|
@sed -n 's/^##//p' ${MAKEFILE_LIST} | column -t -s ':' | sed -e 's/^/ /'
|
|
|