Makefile added with Version 1.4
This commit is contained in:
父節點
621166073d
當前提交
74cbd64cd3
43
Makefile
43
Makefile
@ -1,17 +1,33 @@
|
|||||||
# git helper Makefile: Version 1.3 (2025-08-05)
|
# git helper Makefile: Version 1.4 (2025-08-05)
|
||||||
default: help
|
default: help
|
||||||
|
|
||||||
.ONESHELL:
|
.ONESHELL:
|
||||||
SHELL = /usr/bin/bash
|
SHELL = /usr/bin/bash
|
||||||
.SILENT:
|
.SILENT:
|
||||||
|
|
||||||
|
-include make.d/*.mk
|
||||||
|
|
||||||
GIT_FLAG = ./.git
|
GIT_FLAG = ./.git
|
||||||
VENV_FLAG = ./.venv_required
|
VENV_FLAG = ./.venv_required
|
||||||
VENV_FOLDER = ./venv
|
VENV_FOLDER = ./venv
|
||||||
INIT_FILE = ./init
|
|
||||||
|
localhelp:
|
||||||
|
|
||||||
help:
|
help:
|
||||||
echo "Possible options are: init, status, venv_flag, clean, cleanall"
|
echo "Possible common options are:"
|
||||||
|
echo " - init - Initialise the repository and all folders below with a Makefile"
|
||||||
|
echo " - giti - Get the git status of all submodules including their submodules"
|
||||||
|
echo " - update_submodules - Set all submodules to remote master"
|
||||||
|
echo " - venv_flag - Set the venev flag for the base folder. A venv will be generated"
|
||||||
|
echo " - clean - clean up"
|
||||||
|
echo " - deepclean - clean up this and all Makefiles below"
|
||||||
|
$(MAKE) localhelp
|
||||||
|
echo "You are able to create files make.d/*.mk and add local rules there. "
|
||||||
|
echo " - localinit - Will be executed as last step in the init process."
|
||||||
|
echo " - localhelp - Will be executed in th middle of the help text generation"
|
||||||
|
echo " - localclean - Will be executed before the clean rule"
|
||||||
|
|
||||||
|
localinit:
|
||||||
|
|
||||||
init: print_head
|
init: print_head
|
||||||
# Init git repo
|
# Init git repo
|
||||||
@ -29,26 +45,23 @@ init: print_head
|
|||||||
mkvenv
|
mkvenv
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
# Start my init script if needed
|
# Start local init
|
||||||
if [[ -x $(INIT_FILE) ]]; then
|
$(MAKE) localinit
|
||||||
$(INIT_FILE)
|
|
||||||
fi
|
|
||||||
|
|
||||||
update_submodules:
|
update_submodules:
|
||||||
git submodule foreach "git checkout master && git pull && git submodule init && git submodule update"
|
git submodule foreach "git checkout master && git pull && git submodule init && git submodule update"
|
||||||
|
|
||||||
status: print_head
|
giti_sub: print_head
|
||||||
giti
|
giti
|
||||||
echo " Submodules:"
|
echo " Submodules:"
|
||||||
echo "-----------"
|
git submodule --quiet foreach "echo -n ' ' && giti"
|
||||||
git submodule --quiet foreach giti
|
|
||||||
|
|
||||||
statusall:
|
giti:
|
||||||
for subdir in $$(find . -maxdepth 2 -mindepth 2 -name Makefile | sort); do
|
git submodule --quiet foreach make --no-print-directory giti_sub
|
||||||
$(MAKE) --no-print-directory -C $$(dirname $$subdir) status
|
|
||||||
done
|
|
||||||
|
|
||||||
clean:
|
localclean:
|
||||||
|
|
||||||
|
clean: localclean
|
||||||
if [[ ! -e $(VENV_FLAG) ]]; then
|
if [[ ! -e $(VENV_FLAG) ]]; then
|
||||||
if [[ -d $(VENV_FOLDER) ]]; then
|
if [[ -d $(VENV_FOLDER) ]]; then
|
||||||
rm -rf $(VENV_FOLDER)
|
rm -rf $(VENV_FOLDER)
|
||||||
|
12
init
12
init
@ -1,12 +0,0 @@
|
|||||||
#!/bin/bash
|
|
||||||
#
|
|
||||||
echo "* Linking pylibs to venv"
|
|
||||||
for path in `find pylibs/ -maxdepth 1 -type d`; do
|
|
||||||
if [[ $path != "pylibs/" ]];then
|
|
||||||
lib=${path#*/}
|
|
||||||
echo Creating symbolic link for library $lib
|
|
||||||
rm -f venv/lib/python*/site-packages/$lib
|
|
||||||
ln -s ../../../../$path venv/lib/python*/site-packages/
|
|
||||||
fi
|
|
||||||
done
|
|
||||||
|
|
15
make.d/init.mk
Executable file
15
make.d/init.mk
Executable file
@ -0,0 +1,15 @@
|
|||||||
|
.ONESHELL:
|
||||||
|
SHELL = /usr/bin/bash
|
||||||
|
.SILENT:
|
||||||
|
|
||||||
|
localinit:
|
||||||
|
echo "* Linking pylibs to venv"
|
||||||
|
for path in `find pylibs/ -maxdepth 1 -type d`; do
|
||||||
|
if [[ $path != "pylibs/" ]];then
|
||||||
|
lib=${path#*/}
|
||||||
|
echo Creating symbolic link for library $lib
|
||||||
|
rm -f venv/lib/python*/site-packages/$lib
|
||||||
|
ln -s ../../../../$path venv/lib/python*/site-packages/
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
|
2
pylibs
2
pylibs
@ -1 +1 @@
|
|||||||
Subproject commit 39994b26a2ef2e667e7094dac05777c696408857
|
Subproject commit f7af8ee09dc57442663c5948a8915ca869ba730a
|
Loading…
x
Reference in New Issue
Block a user