Skip to content

Commit

Permalink
fix makefile on windows
Browse files Browse the repository at this point in the history
  • Loading branch information
[email protected] authored and [email protected] committed Jan 31, 2024
1 parent 0ba7eb7 commit 7fe874b
Showing 1 changed file with 13 additions and 5 deletions.
18 changes: 13 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ test: test-$(strip $(1))
test-$(strip $(1)): build/venv.build
@echo 'Testing "$(strip $(1))"...'
rm -rf test-actual/$(strip $(1))/
build/venv/bin/template-specialize template/ test-actual/$(strip $(1))/ $(strip $(2))
build/venv/$$(VENV_BIN)/template-specialize template/ test-actual/$(strip $(1))/ $(strip $(2))
$(call SED_FILE, 's/[0-9]{4}(,? John Doe)/YYYY\1/g', test-actual/$(strip $(1))/LICENSE)
$(call SED_FILE, 's/[0-9]{4}(,? John Doe)/YYYY\1/g', test-actual/$(strip $(1))/doc/conf.py)
diff -r test-actual/$(strip $(1))/ test-expected/$(strip $(1))/
Expand Down Expand Up @@ -73,11 +73,19 @@ $(eval $(call TEST_RULE, noapi-0-nomain-0, \

.PHONY: changelog
changelog: build/venv.build
build/venv/bin/simple-git-changelog
build/venv/$(VENV_BIN)/simple-git-changelog


build/venv.build:
python3 -m venv build/venv
build/venv/bin/pip -q install --progress-bar off -U pip setuptools
build/venv/bin/pip -q install --progress-bar off simple-git-changelog template-specialize
python3 -m venv --upgrade-deps build/venv
build/venv/$(VENV_BIN)/pip -q install --progress-bar off simple-git-changelog template-specialize
touch $@


# Windows support
VENV_BIN := bin
ifeq '$(OS)' 'Windows_NT'
ifeq ($(shell python3 -c "import sysconfig; print(sysconfig.get_preferred_scheme('user'))"),nt_user)
VENV_BIN := Scripts
endif
endif

0 comments on commit 7fe874b

Please sign in to comment.