From 7c80d10503545cc870c084def44c0ea4a95fd290 Mon Sep 17 00:00:00 2001 From: Freeyorp Date: Tue, 4 Jun 2024 14:16:59 +0000 Subject: Rename .make to .mk .mk is more widely understood than .make, for IDE usage. --- COPYING | 2 +- Makefile.in | 14 +++++++------- README.md | 2 +- generate.make | 42 ---------------------------------------- generate.mk | 42 ++++++++++++++++++++++++++++++++++++++++ tools/protocol.py | 2 +- version.make | 58 ------------------------------------------------------- version.mk | 58 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ 8 files changed, 110 insertions(+), 110 deletions(-) delete mode 100644 generate.make create mode 100644 generate.mk delete mode 100644 version.make create mode 100644 version.mk diff --git a/COPYING b/COPYING index edf98ab..c1c13ff 100644 --- a/COPYING +++ b/COPYING @@ -5,7 +5,7 @@ This combination is explicitly allowed by section 13 of the licenses. See gpl-3.0.txt or agpl-3.0.txt for specific terms. In order to make life easy for users who run this software publicly, -please set VENDOR_SOURCE in version.make if you make any modifications. +please set VENDOR_SOURCE in version.mk if you make any modifications. History: diff --git a/Makefile.in b/Makefile.in index 6fe2de6..75f91f7 100644 --- a/Makefile.in +++ b/Makefile.in @@ -152,7 +152,7 @@ $(info The Road goes ever on and on ...) endif endif -include ${SRC_DIR}/version.make +include ${SRC_DIR}/version.mk ifeq (${ENABLE_SHARED},yes) LIB_SUFFIX_FAKE := so @@ -184,7 +184,7 @@ export PATH:=$(realpath ${SRC_DIR}/tools):${PATH} SHELL=bash # need to generate source files before path lists -$(shell make -f ${SRC_DIR}/generate.make >&2) +$(shell make -f ${SRC_DIR}/generate.mk >&2) stamp/generated.stamp: # if you get here, the shell above failed false @@ -688,15 +688,15 @@ override CPPFLAGS += -I . -I ${SRC_DIR}/include # distribution tarballs # this only works from within a git checkout -dist/%/version.make: +dist/%/version.mk: $(MKDIR_FIRST) - git --git-dir=${SRC_DIR}/.git show HEAD:version.make > $@ + git --git-dir=${SRC_DIR}/.git show HEAD:version.mk > $@ sed 's/^VERSION_FULL := .*/#&\nVERSION_FULL := ${VERSION_FULL}/' -i $@ sed 's/^VERSION_HASH := .*/#&\nVERSION_HASH := ${VERSION_HASH}/' -i $@ -dist/%-src.tar: dist/%/version.make +dist/%-src.tar: dist/%/version.mk git --git-dir=${SRC_DIR}/.git archive --prefix=$*/ -o $@ HEAD - ( mtime="$$(git --git-dir=${SRC_DIR}/.git log -n1 --pretty=%ci)" && cd dist && tar uf $*-src.tar --mtime="$${mtime}" --mode=664 --owner=root --group=root $*/version.make ) - rm dist/$*/version.make + ( mtime="$$(git --git-dir=${SRC_DIR}/.git log -n1 --pretty=%ci)" && cd dist && tar uf $*-src.tar --mtime="$${mtime}" --mode=664 --owner=root --group=root $*/version.mk ) + rm dist/$*/version.mk rmdir dist/$*/ dist/%-attoconf-only.tar: $(MKDIR_FIRST) diff --git a/README.md b/README.md index b2309f5..6de796f 100644 --- a/README.md +++ b/README.md @@ -29,7 +29,7 @@ attoconf), but for any discussions related to TMW development. ## 1. Distributors. ### Important notes: -- Go read [version.make](version.make) +- Go read [version.mk](version.mk) - TMWA requires git to build by default, use 'make dist' to get a tarball. ### Platform dependencies: diff --git a/generate.make b/generate.make deleted file mode 100644 index c32ca8d..0000000 --- a/generate.make +++ /dev/null @@ -1,42 +0,0 @@ -SHELL=bash - -MKDIR_FIRST = @mkdir -p ${@D} -SRC_DIR := $(patsubst %/,%,$(dir ${MAKEFILE_LIST})) -PIES := $(shell cd ${SRC_DIR}; find src/ -name '*.py') -PIES := $(filter-out src/main-gdb-%.py,${PIES}) - -export PATH:=$(realpath ${SRC_DIR}/tools):${PATH} - -vpath %.cpp ${SRC_DIR} -vpath %.hpp ${SRC_DIR} -vpath %.tcc ${SRC_DIR} -vpath tools/% ${SRC_DIR} -vpath %.py ${SRC_DIR} - -stamp/generated.stamp: - $(MKDIR_FIRST) - touch $@ - -stamp/generated.stamp: stamp/generate-proto2.stamp -stamp/generate-proto2.stamp: tools/protocol.py - $(MKDIR_FIRST) - rm -f stamp/generated.stamp - mkdir -p ${SRC_DIR}/src/proto2 - cd ${SRC_DIR} && protocol.py - touch $@ - -stamp/generated.stamp: stamp/generate-debug-debug.stamp -stamp/generate-debug-debug.stamp: tools/debug-debug-scripts ${PIES} - $(MKDIR_FIRST) - rm -f stamp/generated.stamp - mkdir -p ${SRC_DIR}/src/debug-debug - rm -f ${SRC_DIR}/src/debug-debug/test.cpp - debug-debug-scripts ${SRC_DIR}/src/debug-debug/ $(wordlist 2,$(words $^),$^) - touch $@ - -stamp/generated.stamp: stamp/generate-config.stamp -stamp/generate-config.stamp: tools/config.py - $(MKDIR_FIRST) - rm -f stamp/generated.stamp - cd ${SRC_DIR} && config.py - touch $@ diff --git a/generate.mk b/generate.mk new file mode 100644 index 0000000..c32ca8d --- /dev/null +++ b/generate.mk @@ -0,0 +1,42 @@ +SHELL=bash + +MKDIR_FIRST = @mkdir -p ${@D} +SRC_DIR := $(patsubst %/,%,$(dir ${MAKEFILE_LIST})) +PIES := $(shell cd ${SRC_DIR}; find src/ -name '*.py') +PIES := $(filter-out src/main-gdb-%.py,${PIES}) + +export PATH:=$(realpath ${SRC_DIR}/tools):${PATH} + +vpath %.cpp ${SRC_DIR} +vpath %.hpp ${SRC_DIR} +vpath %.tcc ${SRC_DIR} +vpath tools/% ${SRC_DIR} +vpath %.py ${SRC_DIR} + +stamp/generated.stamp: + $(MKDIR_FIRST) + touch $@ + +stamp/generated.stamp: stamp/generate-proto2.stamp +stamp/generate-proto2.stamp: tools/protocol.py + $(MKDIR_FIRST) + rm -f stamp/generated.stamp + mkdir -p ${SRC_DIR}/src/proto2 + cd ${SRC_DIR} && protocol.py + touch $@ + +stamp/generated.stamp: stamp/generate-debug-debug.stamp +stamp/generate-debug-debug.stamp: tools/debug-debug-scripts ${PIES} + $(MKDIR_FIRST) + rm -f stamp/generated.stamp + mkdir -p ${SRC_DIR}/src/debug-debug + rm -f ${SRC_DIR}/src/debug-debug/test.cpp + debug-debug-scripts ${SRC_DIR}/src/debug-debug/ $(wordlist 2,$(words $^),$^) + touch $@ + +stamp/generated.stamp: stamp/generate-config.stamp +stamp/generate-config.stamp: tools/config.py + $(MKDIR_FIRST) + rm -f stamp/generated.stamp + cd ${SRC_DIR} && config.py + touch $@ diff --git a/tools/protocol.py b/tools/protocol.py index d63c22d..08c82b2 100755 --- a/tools/protocol.py +++ b/tools/protocol.py @@ -7124,7 +7124,7 @@ def make_dots(ctx): #p = partition({k: ids_only(v.post) for (k, v) in d.items()}) if not os.path.exists('doc-gen'): - # generate.make will succeed if missing the wiki repo + # generate.mk will succeed if missing the wiki repo # but 'make doc' will fail return for g in glob.glob('doc-gen/*.gv'): diff --git a/version.make b/version.make deleted file mode 100644 index 73ecc83..0000000 --- a/version.make +++ /dev/null @@ -1,58 +0,0 @@ -ABI_VERSION := 0 - -# These lines are automatically replaced in tarballs generated by 'make dist' -# Note so you stop forgetting: export-subst attribute can't do tag-relative -VERSION_FULL := $(shell git --git-dir=${SRC_DIR}/.git describe --tags HEAD) -VERSION_HASH := $(shell git --git-dir=${SRC_DIR}/.git rev-parse HEAD) - -version_bits := $(subst v, ,$(subst -, ,$(subst ., ,${VERSION_FULL}))) -# Note: these four numbers are limited to 255. -# Currently, my tags are yy.mm.dd instead of semantic versioning. -# The dev number is how many commits since the last tag. -VERSION_MAJOR := $(word 1,${version_bits}) -VERSION_MINOR := $(word 2,${version_bits}) -VERSION_PATCH := $(word 3,${version_bits}) -VERSION_DEVEL := $(word 4,${version_bits}) -ifeq "${VERSION_DEVEL}" "" - VERSION_DEVEL := 0 -endif - - - -# Settings for those distributing modified versions. -# -# It is strongly recommended that all distributors set these, -# but the only *requirement* is that modified versions that are run -# (semi)publicly give VENDOR_SOURCE to satisfy section 13 of the AGPLv3. - -# TODO should these be passed to configure instead? - -# Vendor Name: String (no newlines, no parentheses) -# This is usually one word, and does not (usually) change over time. -# (Examples: Gentoo, Debian, Fedora, Ubuntu) -VENDOR_NAME := Vanilla -# Vendor Point: Integer (max value 65535) -# This is intended to be the "packaging revision number", assuming that's -# an integer. At a minimum, please try to make it nonzero if you have -# any non-upstream patches (unconditionally nonzero is also okay). -# (If your revision 0 package has patches ... please be nicer to upstream) -VENDOR_POINT := 0 -# URL where the source may be found (after searching for version number). -# See AGPLv3 section 13 -VENDOR_SOURCE := https://github.com/themanaworld/tmwa - -# Convenience -VERSION_STRING := TMWA ${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_PATCH} dev${VERSION_DEVEL} +${VENDOR_POINT} (${VENDOR_NAME}) -VERSION_DOTS := ${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_PATCH}.${VERSION_DEVEL}.${VENDOR_POINT} - -# Shared libraries -SO_SHORT := so.${ABI_VERSION} -SO_LONG := ${SO_SHORT}.${VERSION_DOTS} -# and thanks for all the fish - -version: - @echo version '${VERSION_STRING}' - @echo based on commit ${VERSION_FULL} aka ${VERSION_HASH} - @echo source ${VENDOR_SOURCE} - @echo abi version ${ABI_VERSION} - @echo 'lib so -> ${SO_SHORT} -> ${SO_LONG}' diff --git a/version.mk b/version.mk new file mode 100644 index 0000000..73ecc83 --- /dev/null +++ b/version.mk @@ -0,0 +1,58 @@ +ABI_VERSION := 0 + +# These lines are automatically replaced in tarballs generated by 'make dist' +# Note so you stop forgetting: export-subst attribute can't do tag-relative +VERSION_FULL := $(shell git --git-dir=${SRC_DIR}/.git describe --tags HEAD) +VERSION_HASH := $(shell git --git-dir=${SRC_DIR}/.git rev-parse HEAD) + +version_bits := $(subst v, ,$(subst -, ,$(subst ., ,${VERSION_FULL}))) +# Note: these four numbers are limited to 255. +# Currently, my tags are yy.mm.dd instead of semantic versioning. +# The dev number is how many commits since the last tag. +VERSION_MAJOR := $(word 1,${version_bits}) +VERSION_MINOR := $(word 2,${version_bits}) +VERSION_PATCH := $(word 3,${version_bits}) +VERSION_DEVEL := $(word 4,${version_bits}) +ifeq "${VERSION_DEVEL}" "" + VERSION_DEVEL := 0 +endif + + + +# Settings for those distributing modified versions. +# +# It is strongly recommended that all distributors set these, +# but the only *requirement* is that modified versions that are run +# (semi)publicly give VENDOR_SOURCE to satisfy section 13 of the AGPLv3. + +# TODO should these be passed to configure instead? + +# Vendor Name: String (no newlines, no parentheses) +# This is usually one word, and does not (usually) change over time. +# (Examples: Gentoo, Debian, Fedora, Ubuntu) +VENDOR_NAME := Vanilla +# Vendor Point: Integer (max value 65535) +# This is intended to be the "packaging revision number", assuming that's +# an integer. At a minimum, please try to make it nonzero if you have +# any non-upstream patches (unconditionally nonzero is also okay). +# (If your revision 0 package has patches ... please be nicer to upstream) +VENDOR_POINT := 0 +# URL where the source may be found (after searching for version number). +# See AGPLv3 section 13 +VENDOR_SOURCE := https://github.com/themanaworld/tmwa + +# Convenience +VERSION_STRING := TMWA ${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_PATCH} dev${VERSION_DEVEL} +${VENDOR_POINT} (${VENDOR_NAME}) +VERSION_DOTS := ${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_PATCH}.${VERSION_DEVEL}.${VENDOR_POINT} + +# Shared libraries +SO_SHORT := so.${ABI_VERSION} +SO_LONG := ${SO_SHORT}.${VERSION_DOTS} +# and thanks for all the fish + +version: + @echo version '${VERSION_STRING}' + @echo based on commit ${VERSION_FULL} aka ${VERSION_HASH} + @echo source ${VENDOR_SOURCE} + @echo abi version ${ABI_VERSION} + @echo 'lib so -> ${SO_SHORT} -> ${SO_LONG}' -- cgit v1.2.3-70-g09d2