diff options
| author | Zhineng Li <[email protected]> | 2026-02-12 19:00:33 +0800 |
|---|---|---|
| committer | Zhineng Li <[email protected]> | 2026-02-12 19:00:33 +0800 |
| commit | 328602707213990715fccbb98f46731b19289902 (patch) | |
| tree | dfbcb2455ad96af007c562f28c4055c75edd4bb7 /Makefile | |
| download | acs-metadata-build-328602707213990715fccbb98f46731b19289902.tar.gz acs-metadata-build-328602707213990715fccbb98f46731b19289902.zip | |
first commit
Diffstat (limited to 'Makefile')
| -rw-r--r-- | Makefile | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..f7987a8 --- /dev/null +++ b/Makefile @@ -0,0 +1,35 @@ +BUILD_DIR ?= build +TAG ?= $(shell date +%Y%m%d) +JSON_TARBALL := $(BUILD_DIR)/release-$(TAG)-json.tar.gz +PHP_TARBALL := $(BUILD_DIR)/release-$(TAG)-php.tar.gz + +.PHONY: build build-php update clean + +build: build-json build-php + +build-json: update + tar czf "$(JSON_TARBALL)" -C "$(BUILD_DIR)/json" . + shasum -a 256 "$(JSON_TARBALL)" | awk '{print $$1}' > "$(JSON_TARBALL).sha256" + +build-php: update + cd php-generator && composer install --no-dev --optimize-autoloader + mkdir -p "$(BUILD_DIR)/php" + php php-generator/generate.php "$(BUILD_DIR)/json" "$(BUILD_DIR)/php" + tar czf "$(PHP_TARBALL)" -C "$(BUILD_DIR)/php" . + shasum -a 256 "$(PHP_TARBALL)" | awk '{print $$1}' > "$(PHP_TARBALL).sha256" + +update: $(BUILD_DIR)/.metadata.updated + +$(BUILD_DIR)/.metadata.updated: $(BUILD_DIR)/.metadata.en.updated $(BUILD_DIR)/.metadata.zh.updated + touch "$@" + +$(BUILD_DIR)/.metadata.en.updated: + LANGUAGE=EN_US BUILD_DIR="$(BUILD_DIR)/json" ./scripts/update-metadata.sh + touch "$@" + +$(BUILD_DIR)/.metadata.zh.updated: + LANGUAGE=ZH_CN BUILD_DIR="$(BUILD_DIR)/json" ./scripts/update-metadata.sh + touch "$@" + +clean: + rm -rf "$(BUILD_DIR)/" |
