commit 8f7d49364ad11587a473ccf0480b36735ae37d46
parent a25700fc78d9d14be6c2d5ffc68fe1f02a186410
Author: Vincent Forest <vincent.forest@meso-star.com>
Date: Sun, 21 May 2023 16:31:59 +0200
Update the path where git projects are cloned
Git projects are cloned in a path whose main directory is the project
name and the following directories are given by the project tag. This
allows the same project to have, at the same time, the clone of its
source code in different tags. This commit anticipates the situation
where the same project is used in several builds, each with its own
version of the project.
Diffstat:
2 files changed, 15 insertions(+), 12 deletions(-)
diff --git a/.gitignore b/.gitignore
@@ -2,8 +2,8 @@
*.sha512sum
*.swp
*.tgz
-*_dir
*.profile
.prefix
build.mk
local
+*/
diff --git a/git.mk.in b/git.mk.in
@@ -1,34 +1,37 @@
@NAME@: build_@NAME@ prefix
- @cd -- @NAME@_dir &&\
- $(MAKE) PREFIX="$$(cat ../.prefix)" @OPT@ install
+ @prefix=$$(cat .prefix) &&\
+ cd -- @NAME@/@TAG@ &&\
+ $(MAKE) PREFIX="$${prefix}" @OPT@ install
# Delete the dependency file to force their regeneration. This is necessary
# because the .prefix file may have been updated and therefore the dependency
# files may be outdated.
build_@NAME@: @DEP@ fetch_@NAME@ prefix
- @cd -- @NAME@_dir &&\
+ @prefix=$$(cat .prefix) &&\
+ cd -- @NAME@/@TAG@ &&\
rm -f $$(find src -name "*.d") &&\
- PKG_CONFIG_PATH="$$(cat ../.prefix)/lib/pkgconfig/" $(MAKE) @OPT@
+ PKG_CONFIG_PATH="$${prefix}/lib/pkgconfig/" $(MAKE) @OPT@
-@NAME@_dir:
+@NAME@/@TAG@:
@git clone @URL@ $@
-fetch_@NAME@: @NAME@_dir
- @cd -- @NAME@_dir &&\
+fetch_@NAME@: @NAME@/@TAG@
+ @cd -- @NAME@/@TAG@ &&\
git fetch origin &&\
git checkout -B star-build &&\
git reset --hard @TAG@
clean_@NAME@:
- @if [ -d @NAME@_dir ]; then\
- cd -- @NAME@_dir && make clean;\
+ @if [ -d @NAME@/@TAG@ ]; then\
+ cd -- @NAME@/@TAG@ && make clean;\
fi
uninstall_@NAME@: fetch_@NAME@ prefix
- cd -- @NAME@_dir && make PREFIX="$$(cat ../.prefix)" uninstall
+ @prefix=$$(cat .prefix) &&\
+ cd -- @NAME@/@TAG@ && make PREFIX="$${prefix}" uninstall
distclean_@NAME@:
- @rm -rf @NAME@_dir
+ rm -rf @NAME@
clean_all: clean_@NAME@
distclean_all: distclean_@NAME@