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)/"