Skip to content
This repository has been archived by the owner on Nov 22, 2024. It is now read-only.

Commit

Permalink
Fix Makefile
Browse files Browse the repository at this point in the history
  • Loading branch information
fugkco committed Aug 18, 2020
1 parent e017d9a commit dc738ce
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,23 @@ NAME = script.elementum.jackett
GIT = git
LAST_GIT_TAG = $(shell $(GIT) describe --tags)
GIT_VERSION = $(shell $(GIT) describe --abbrev=0 --tags --exact-match 2>/dev/null || echo -n "$(LAST_GIT_TAG)-snapshot")

ZIP = zip
ZIP_SUFFIX = zip
ZIP_FILE = $(NAME).$(ZIP_SUFFIX)

BUILD_DIR = build/$(NAME)
BUILD_BASE = build
BUILD_DIR = $(BUILD_BASE)/$(NAME)

all: clean deps-prod locales zip

.PHONY: build-prod
build-prod: clean deps-prod $(ZIP_FILE)

.PHONY: deps-prod
deps-prod: clean deps-prod $(ZIP_FILE)
@poetry install --no-dev

$(BUILD_DIR):
@mkdir -p $(BUILD_DIR)

Expand All @@ -28,12 +35,14 @@ $(ZIP_FILE): $(BUILD_DIR)
--install-option="--install-scripts=$$(mktemp -d)"
@find $(BUILD_DIR) -iname "*.egg-info" -or -iname "*.pyo" -or -iname "*.pyc" | xargs rm -rf
@poetry run ./scripts/update-version.py $(GIT_VERSION) > $(BUILD_DIR)/addon.xml
@(cd $(BUILD_BASE) && $(ZIP) -r $(CURDIR)/$(ZIP_FILE) $(NAME))

.PHONY: zip
zip: $(ZIP_FILE)

clean:
rm -f $(ZIP_FILE)
rm -rf $(BUILD_DIR)

locales:
scripts/xgettext_merge.sh

0 comments on commit dc738ce

Please sign in to comment.