mirror of
https://github.com/vishapoberon/vipak.git
synced 2026-04-06 13:02:26 +00:00
makefile, default tree path.
This commit is contained in:
parent
2c598e394f
commit
e26040431f
3 changed files with 70 additions and 59 deletions
|
|
@ -3,6 +3,8 @@ DEPEND = github.com/norayr/lists github.com/norayr/Internet github.com/norayr/op
|
||||||
VOC = /opt/voc/bin/voc
|
VOC = /opt/voc/bin/voc
|
||||||
mkfile_path := $(abspath $(lastword $(MAKEFILE_LIST)))
|
mkfile_path := $(abspath $(lastword $(MAKEFILE_LIST)))
|
||||||
mkfile_dir_path := $(shell dirname $(realpath $(firstword $(MAKEFILE_LIST))))
|
mkfile_dir_path := $(shell dirname $(realpath $(firstword $(MAKEFILE_LIST))))
|
||||||
|
$(info $$mkfile_path is [${mkfile_path}])
|
||||||
|
$(info $$mkfile_dir_path is [${mkfile_dir_path}])
|
||||||
ifndef BUILD
|
ifndef BUILD
|
||||||
BUILD="build"
|
BUILD="build"
|
||||||
endif
|
endif
|
||||||
|
|
|
||||||
125
Makefile
125
Makefile
|
|
@ -1,70 +1,79 @@
|
||||||
.POSIX:
|
.POSIX:
|
||||||
|
DEPEND = github.com/norayr/lists github.com/norayr/Internet github.com/norayr/opts github.com/norayr/skprLogger github.com/norayr/skprJson
|
||||||
|
|
||||||
CFLAGS =
|
VOC = /opt/voc/bin/voc
|
||||||
|
#mkfile_path = $(abspath $(lastword $(MAKEFILE_LIST)))
|
||||||
|
#mkfile_dir_path = $(shell dirname $(realpath $(firstword $(MAKEFILE_LIST))))
|
||||||
|
#mkfile_path = $(abspath $(lastword $(MAKEFILE_LIST)))
|
||||||
|
#mkfile_dir_path = $(notdir $(patsubst %/,%,$(dir $(mkfile_path))))
|
||||||
|
|
||||||
# The following order is important, do not alphabetise
|
#mkfile_path := $(abspath $(lastword $(MAKEFILE_LIST)))
|
||||||
DEPS = norayr/strutils \
|
##mkfile_dir_path := $(shell dirname $(realpath $(firstword $(MAKEFILE_LIST)))
|
||||||
norayr/lists \
|
#mkfile_dir_path = $(dir $(firstword $(MAKEFILE_LIST)))
|
||||||
norayr/Internet \
|
|
||||||
norayr/opts \
|
|
||||||
norayr/time \
|
|
||||||
norayr/skprLogger \
|
|
||||||
norayr/skprJson
|
|
||||||
|
|
||||||
GITHUB = https://github.com/
|
#$(info $$mkfile_path is [${mkfile_path}])
|
||||||
|
#$(info $$mkfile_dir_path is [${mkfile_dir_path}])
|
||||||
|
mkfile_dir_path = $(shell pwd)
|
||||||
|
mkfile_path = $(mkfile_dir_path)/Makefile
|
||||||
|
$(info $(mkfile_path))
|
||||||
|
|
||||||
ROOTDIR = $$PWD
|
BUILD ?= build
|
||||||
|
build_dir_path = $(mkfile_dir_path)/$(BUILD)
|
||||||
|
current_dir = $(notdir $(patsubst %/,%,$(dir $(mkfile_path))))
|
||||||
|
BLD = $(mkfile_dir_path)/build
|
||||||
|
DPD = deps
|
||||||
|
DPS ?= $(mkfile_dir_path)/$(DPD)
|
||||||
|
|
||||||
CFLAGS =
|
all: get_deps build_deps buildThis
|
||||||
|
|
||||||
all: ${DEPS}
|
get_deps:
|
||||||
@if [ ! -d build ]; then \
|
@for i in $(DEPEND); do \
|
||||||
mkdir build; \
|
if [ -d "$(DPS)/$${i}" ]; then \
|
||||||
fi
|
cd "$(DPS)/$${i}"; \
|
||||||
@for i in $?; do \
|
git pull; \
|
||||||
cp -r ${ROOTDIR}/build \
|
cd - ; \
|
||||||
${ROOTDIR}/deps/$${i#*/}/build; \
|
|
||||||
make -C ${ROOTDIR}/deps/$${i#*/}; \
|
|
||||||
cp -r ${ROOTDIR}/deps/$${i#*/}/build/* \
|
|
||||||
${ROOTDIR}/build/; \
|
|
||||||
done
|
|
||||||
|
|
||||||
@cd build; voc -s ${ROOTDIR}/../src/vpkSettings.Mod \
|
|
||||||
${ROOTDIR}/../src/unix/vpkLinuxFiles.Mod \
|
|
||||||
${ROOTDIR}/../src/unix/vpkTime.Mod \
|
|
||||||
${ROOTDIR}/../src/vpkLogger.Mod \
|
|
||||||
${ROOTDIR}/../src/vpkHttp.Mod \
|
|
||||||
${ROOTDIR}/../src/unix/vpkEnv.Mod \
|
|
||||||
${ROOTDIR}/../src/unix/vpkGit.Mod \
|
|
||||||
${ROOTDIR}/../src/vpkCharacterStack.Mod \
|
|
||||||
${ROOTDIR}/../src/vpkJsonParser.Mod \
|
|
||||||
${ROOTDIR}/../src/vpkConf.Mod \
|
|
||||||
${ROOTDIR}/../src/vpkStorage.Mod \
|
|
||||||
${ROOTDIR}/../src/vpkSyncer.Mod \
|
|
||||||
${ROOTDIR}/../src/vpkdepTree.Mod \
|
|
||||||
${ROOTDIR}/../src/vpkDot.Mod \
|
|
||||||
${ROOTDIR}/../src/vpkResolver.Mod \
|
|
||||||
${ROOTDIR}/../src/vpkJsonDepRetriever.Mod \
|
|
||||||
${ROOTDIR}/../src/vpkInstaller.Mod \
|
|
||||||
${ROOTDIR}/../src/vipack.Mod -m
|
|
||||||
|
|
||||||
${DEPS}:
|
|
||||||
@for i in $@; do \
|
|
||||||
if [ -d deps/$${i#*/} ]; then \
|
|
||||||
printf "Updating %s: " $${i#*/}; \
|
|
||||||
git -C deps/$${i#*/} pull --ff-only \
|
|
||||||
${GITHUB}$$i > /dev/null 2>&1 \
|
|
||||||
&& echo done \
|
|
||||||
|| (echo failed && exit 1); \
|
|
||||||
else \
|
else \
|
||||||
printf "Fetching %s: " $${i#*/}; \
|
mkdir -p "$(DPS)/$${i}"; \
|
||||||
git clone ${GITHUB}$$i deps/$${i#*/} \
|
cd "$(DPS)/$${i}"; \
|
||||||
> /dev/null 2>&1 \
|
cd .. ; \
|
||||||
&& echo done \
|
git clone "https://$${i}"; \
|
||||||
|| (echo failed && exit 1); \
|
cd - ; \
|
||||||
fi \
|
fi; \
|
||||||
done
|
done
|
||||||
|
|
||||||
|
build_deps:
|
||||||
|
mkdir -p $(BUILD)
|
||||||
|
cd $(BUILD);
|
||||||
|
@for i in $(DEPEND); do \
|
||||||
|
#make -f "$(DPS)/$${i}/Makefile" BUILD=$(BUILD); \
|
||||||
|
cd $(DPS)/$${i}" && make BUILD=$(BUILD); \
|
||||||
|
done
|
||||||
|
|
||||||
|
buildThis:
|
||||||
|
cd $(BUILD) && $(VOC) -s $(mkfile_dir_path)/src/vpkSettings.Mod
|
||||||
|
cd $(BUILD) && $(VOC) -s $(mkfile_dir_path)/src/unix/vpkLinuxFiles.Mod
|
||||||
|
cd $(BUILD) && $(VOC) -s $(mkfile_dir_path)/src/unix/vpkTime.Mod
|
||||||
|
cd $(BUILD) && $(VOC) -s $(mkfile_dir_path)/src/vpkLogger.Mod
|
||||||
|
cd $(BUILD) && $(VOC) -s $(mkfile_dir_path)/src/vpkHttp.Mod
|
||||||
|
cd $(BUILD) && $(VOC) -s $(mkfile_dir_path)/src/unix/vpkEnv.Mod
|
||||||
|
cd $(BUILD) && $(VOC) -s $(mkfile_dir_path)/src/unix/vpkGit.Mod
|
||||||
|
cd $(BUILD) && $(VOC) -s $(mkfile_dir_path)/src/vpkCharacterStack.Mod
|
||||||
|
cd $(BUILD) && $(VOC) -s $(mkfile_dir_path)/src/vpkJsonParser.Mod
|
||||||
|
cd $(BUILD) && $(VOC) -s $(mkfile_dir_path)/src/vpkConf.Mod
|
||||||
|
cd $(BUILD) && $(VOC) -s $(mkfile_dir_path)/src/vpkStorage.Mod
|
||||||
|
cd $(BUILD) && $(VOC) -s $(mkfile_dir_path)/src/vpkSyncer.Mod
|
||||||
|
cd $(BUILD) && $(VOC) -s $(mkfile_dir_path)/src/vpkdepTree.Mod
|
||||||
|
cd $(BUILD) && $(VOC) -s $(mkfile_dir_path)/src/vpkDot.Mod
|
||||||
|
cd $(BUILD) && $(VOC) -s $(mkfile_dir_path)/src/vpkResolver.Mod
|
||||||
|
cd $(BUILD) && $(VOC) -s $(mkfile_dir_path)/src/vpkJsonDepRetriever.Mod
|
||||||
|
cd $(BUILD) && $(VOC) -s $(mkfile_dir_path)/src/vpkInstaller.Mod
|
||||||
|
cd $(BUILD) && $(VOC) $(mkfile_dir_path)/src/vipack.Mod -m
|
||||||
|
|
||||||
|
tests:
|
||||||
|
#cd $(BUILD) && $(VOC) $(mkfile_dir_path)/test/testList.Mod -m
|
||||||
|
#build/testList
|
||||||
|
|
||||||
clean:
|
clean:
|
||||||
rm -rf build deps
|
if [ -d "$(BUILD)" ]; then rm -rf $(BLD); fi
|
||||||
|
|
||||||
|
print-% : ; @echo $* = $($*)
|
||||||
|
|
|
||||||
|
|
@ -19,8 +19,8 @@ CONST
|
||||||
rmtTreeKey* = "path";
|
rmtTreeKey* = "path";
|
||||||
rmtTreeBranchKey* = "branch";
|
rmtTreeBranchKey* = "branch";
|
||||||
bldType* = "Build";
|
bldType* = "Build";
|
||||||
(*defTreeVal* = "https://github.com/vishaps/vipackTree";*)
|
defTreeVal* = "https://github.com/vishaps/vipackTree";
|
||||||
defTreeVal* = "git@github.com:vishaps/vipackTree";
|
(*defTreeVal* = "git@github.com:vishaps/vipackTree";*)
|
||||||
confTreeVal* = defTreeVal;
|
confTreeVal* = defTreeVal;
|
||||||
defTypVal* = rmtTypGitVal;
|
defTypVal* = rmtTypGitVal;
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue