diff options
| author | Julian Blake Kongslie | 2022-06-25 19:49:39 -0700 |
|---|---|---|
| committer | Julian Blake Kongslie | 2022-06-25 19:49:39 -0700 |
| commit | 797c56e0e7d199b728e9f929cb2e78a72f7cb916 (patch) | |
| tree | e590687ce563a47c93bdda963448a75f6f0f117a /Makefile | |
| parent | Marginally safer 'find' invocation for finding subcomponents. (diff) | |
| download | issim-797c56e0e7d199b728e9f929cb2e78a72f7cb916.tar.xz | |
Move git tag generation entirely into the Makefile.
Diffstat (limited to '')
| -rw-r--r-- | Makefile | 17 |
1 files changed, 15 insertions, 2 deletions
| @@ -8,6 +8,19 @@ CXXFLAGS := -Wall -Werror -std=c++20 -fPIC -iquote . ${OPTIMIZE} ${DEBUG} | |||
| 8 | 8 | ||
| 9 | .DEFAULT: issim | 9 | .DEFAULT: issim |
| 10 | 10 | ||
| 11 | VERSION := $(shell git describe --always --dirty --long --tags 2> /dev/null) | ||
| 12 | ifndef VERSION | ||
| 13 | VERSION := unknown | ||
| 14 | endif | ||
| 15 | $(info Version ${VERSION}) | ||
| 16 | |||
| 17 | define GITTAGCPP = | ||
| 18 | #include <string> | ||
| 19 | |||
| 20 | std::string GIT_TAG = "$(subst ",\",${VERSION})"; | ||
| 21 | endef | ||
| 22 | export GITTAGCPP | ||
| 23 | |||
| 11 | libname = $(shell realpath --canonicalize-missing --relative-to . build/$(dir $(1))/lib$(notdir $(1))) | 24 | libname = $(shell realpath --canonicalize-missing --relative-to . build/$(dir $(1))/lib$(notdir $(1))) |
| 12 | 25 | ||
| 13 | define mklib = | 26 | define mklib = |
| @@ -35,7 +48,7 @@ endif | |||
| 35 | 48 | ||
| 36 | endef | 49 | endef |
| 37 | 50 | ||
| 38 | PARTS := $(patsubst ./%,%,$(shell find -mindepth 1 -type d -\( -name .\* -prune -o -name build -prune -o -name tools -prune -o -print -\))) | 51 | PARTS := $(patsubst ./%,%,$(shell find -mindepth 1 -type d -\( -name .\* -prune -o -name build -prune -o -print -\))) |
| 39 | PARTARS := | 52 | PARTARS := |
| 40 | PARTSOS := | 53 | PARTSOS := |
| 41 | 54 | ||
| @@ -68,7 +81,7 @@ clean: | |||
| 68 | 81 | ||
| 69 | build/git-tag.cpp: | 82 | build/git-tag.cpp: |
| 70 | @mkdir -p $(dir $@) | 83 | @mkdir -p $(dir $@) |
| 71 | tools/get-git-tag > $@ | 84 | @echo "$$GITTAGCPP" > $@ |
| 72 | .PHONY: build/git-tag.cpp | 85 | .PHONY: build/git-tag.cpp |
| 73 | 86 | ||
| 74 | include $(shell find -type f -name \*.d) | 87 | include $(shell find -type f -name \*.d) |
