-.PHONY: all srcall gtags \
- check valgrind \
- doc alldoc doc_inner \
- install uninstall \
- version gittag copyright \
- gitpush gitpushorigin gitpushgithub \
- version_up___stamp gittag___stamp \
- clean src-clean gtags-clean \
- test-clean doc-clean doc_inner-clean
+.PHONY: all gtags check valgrind doc doc_inner copyright install uninstall patchup___stamp gittag gitpush clean src-clean gtags-clean test-clean doc-clean doc_inner-clean
CAT := cat
CP := cp -v
MAINGITREF = $(shell $(GIT) show-ref -s refs/heads/main)
-VERSIONFILES := include/version.h \
- test/system/casl2_opt/opt_v/0.txt \
- test/system/comet2_opt/opt_v/0.txt \
- test/system/dumpword/opt_v/0.txt
+VERSIONFILES := include/version.h test/system/casl2_opt/opt_v/0.txt test/system/comet2_opt/opt_v/0.txt test/system/dumpword/opt_v/0.txt
CMDFILES := casl2 comet2 dumpword casl2rev comet2monitor
doc/install.txt:
$(MAKE) -C doc base
-alldoc:
+doc:
$(MAKE) -C doc all
doc_inner:
uninstall: uninstall-info
$(RM) $(prefix $(bindir)/,$(CMDFILES))
-version: version___stamp
-
-version___stamp: $(VERSIONFILES)
- @$(PRINTF) "YACASL2 Version: %s\n" $(VERSION) >$@
-
$(VERSIONFILES): VERSION
@$(SED) -e "s/@@VERSION@@/$(VERSION)/g" $@.version >$@
$(GIT) push github main --tags
$(GIT) rev-parse HEAD > $@
-gittag___stamp:
- $(GIT) tag --points-at main | $(GREP) -qx "$(VERSION)" || $(GIT) tag $(VERSION) main
+gittag___stamp: patchup___stamp
+ $(GIT) tag --points-at HEAD | $(GREP) -qx "$(VERSION)" || $(GIT) tag $(VERSION) main
$(PRINTF) "%s\n" "$(VERSION)" > $@
-version_up___stamp: VERSION
- if [ -n "$$($(GIT) status -s)" ]; then $(PRINTF) "Error: commit, first.\n"; exit 1; fi
- while $(GIT) rev-parse -q --verify $$($(CAT) VERSION) >/dev/null 2>&1; do $(PRINTF) "v%.1fp%02d\n" $(VERSIONNO) $$($(EXPR) $(PATCHNO) + 1) >$<; done
- $(GIT) add VERSION
- $(GIT) commit -m "version up"
- $(CAT) $< >$@
+patchup___stamp:
+ git diff-index --quiet HEAD -- || ($(PRINTF) "Error: commit, first.\n"; exit 1)
+ $(GIT) tag --points-at HEAD | $(GREP) -qx "$(VERSION)" && exit 0 || while $(GIT) rev-parse -q --verify $(VERSION) >/dev/null 2>&1; do $(PRINTF) "v%.1fp%02d\n" $(VERSIONNO) $$($(EXPR) $(PATCHNO) + 1) >VERSION; done;
+ git diff-index --quiet HEAD -- || $(GIT) commit -a -m "version up to $(VERSION)"
+ $(PRINTF) "%s\n" "$(VERSION)" >$@
gitclean:
$(RM) *___stamp