diff --git a/.gitignore b/.gitignore index bb98da71..2f6f064a 100644 --- a/.gitignore +++ b/.gitignore @@ -20,7 +20,6 @@ *tmp* *~ .cache-project.mk -.cache-projects.mk .exrc .feedfs_history .gdb_history @@ -38,20 +37,19 @@ bin/*.tcl conftest.py core dist +last-successful-run.txt ld-*.conf local.conf local.mk -local.mk local.yaml make/*.pc -make/ssh-wrapper.sh mkspec.sh pr-descr*.txt pre-local.mk pyproject.toml pyrightconfig.json test-out.txt -test/integration/jw-pkg/projects/cache/test-pyproject.toml -test/integration/jw-pkg/projects/cache/test-pyrightconfig.json !*.jw-tmpl !*.tmpl +.cache-projects.mk +make/ssh-wrapper.sh diff --git a/conf/templates/gitignore b/conf/templates/gitignore index a64843f4..003b5541 100644 --- a/conf/templates/gitignore +++ b/conf/templates/gitignore @@ -38,6 +38,7 @@ bin/*.tcl conftest.py core dist +last-successful-run.txt ld-*.conf local.conf local.mk diff --git a/make/projects-dir.mk b/make/projects-dir.mk index 411fb034..4b642ab1 100644 --- a/make/projects-dir.mk +++ b/make/projects-dir.mk @@ -337,6 +337,9 @@ git-short-diff: $(SSH_WRAPPER_SH) git-status: $(PGIT_SH) status -uno +git-log-%: + $(PGIT_SH) log -$* 2>&1 + git-get: $(SSH_WRAPPER_SH) $(PGIT_SH_GET_DEFAULT) touch get.done diff --git a/make/py-run.mk b/make/py-run.mk index c2c8f80f..629f88b1 100644 --- a/make/py-run.mk +++ b/make/py-run.mk @@ -1,6 +1,7 @@ include $(JWBDIR)/make/defs.mk include $(JWBDIR)/make/py-defs.mk include $(JWBDIR)/make/test-guard.mk +include $(JWBDIR)/make/run-success.mk EXE ?= $(firstword $(wildcard main.py runme.py test.py *.py)) EXE_ARGS ?= @@ -14,6 +15,7 @@ test: all testability run: $(PYTHON_RUNNER) $(EXE) $(EXE_ARGS) + $(RUN_SUCCESS_CREATE_MARKER) run.sh: echo -e "#!/bin/bash\n\nexport PYTHONPATH=$(PYTHONPATH)\nset -x\nexec $(PYTHON) $(EXE)" '"$$@"' > $@.tmp diff --git a/make/rules.mk b/make/rules.mk index 0179fbbb..e64fca06 100644 --- a/make/rules.mk +++ b/make/rules.mk @@ -243,6 +243,16 @@ ifneq ($(EXE_PATH),) endif endif +git-log-%: + git log -$* 2>&1 + +git-log-tree-%: +ifneq ($(PROJECTS_DIR),) + make --no-print-directory -C $(PROJECTS_DIR) git-log-$* 2>&1 +else + @echo "No PROJECTS_DIR defined to log commits for" +endif + # -- special built-in targets .PRECIOUS: $(LOCAL_H) diff --git a/make/run-success.mk b/make/run-success.mk new file mode 100644 index 00000000..ae4927ba --- /dev/null +++ b/make/run-success.mk @@ -0,0 +1,15 @@ +ifndef RUN_SUCCESS_RECORD_CMD + RUN_SUCCESS_RECORD_CMD := git log --oneline -1 +endif + +ifndef RUN_SUCCESS_MARKER + RUN_SUCCESS_MARKER := last-successful-run.txt +endif + +RUN_SUCCESS_CREATE_MARKER = $(RUN_SUCCESS_RECORD_CMD) > $(RUN_SUCCESS_MARKER).tmp && \ + mv $(RUN_SUCCESS_MARKER).tmp $(RUN_SUCCESS_MARKER) +all: + +distclean: distclean.run-success +distclean.run-success: + rm -f $(RUN_SUCCESS_MARKER) diff --git a/make/run.mk b/make/run.mk index 95fd8b91..ac106315 100644 --- a/make/run.mk +++ b/make/run.mk @@ -5,6 +5,7 @@ include $(JWBDIR)/make/defs.mk include $(JWBDIR)/make/defs-cpp.mk +include $(JWBDIR)/make/run-success.mk DIR_BASENAME = $(notdir $(CWD)) @@ -76,6 +77,7 @@ run test: run-deps @echo "wine $(EXE_CMD)" @echo -e "set PATH=%PATH;$(DLL_PATH)\n" \ "$(EXE_CMD)" | wine cmd + $(RUN_SUCCESS_CREATE_MARKER) start: run-deps @echo "wine $(EXE_CMD)" @@ -85,6 +87,7 @@ start: run-deps else run test: run-deps $(EXE_CMD) + $(RUN_SUCCESS_CREATE_MARKER) start: run-deps $(EXE_CMD) &