mirror of
ssh://git.janware.com/janware/proj/jw-pkg
synced 2026-04-24 17:23:36 +02:00
jw-pkg supports more than RPM-based package managers, but for historic reasons, lots of its Makefile variables still have "RPM" in their names. This is misleading. Replace "RPM" in variable names by the more generic "PKG" where appropriate. Signed-off-by: Jan Lindemann <jan@janware.com>
231 lines
6.5 KiB
Makefile
231 lines
6.5 KiB
Makefile
all: config
|
|
install: topdir.install
|
|
clean: topdir.clean
|
|
distclean: topdir.distclean
|
|
config:
|
|
mrproper:distclean topdir.mrproper
|
|
|
|
ifeq ($(ORDERED_SUBDIRS),)
|
|
SUBDIRS ?= $(dir $(wildcard $(addsuffix /Makefile,\
|
|
inst/pre make scripts contrib src libsrc \
|
|
tools include lib bin util exe plugins conf config cfg \
|
|
images htdocs tmpl doc test inst/post)))
|
|
endif
|
|
|
|
ifeq ($(USE_USER_URL),true)
|
|
JANWARE_USER_PREFIX = $(JANWARE_USER)@
|
|
endif
|
|
|
|
PROJECT_DESCR = $(TOPDIR)/make/project.conf
|
|
GIT_DESCR = $(TOPDIR)/.git/description
|
|
GIT_MAIN_BRANCH ?= master
|
|
|
|
OPT_JANWARE_PROJECT ?= -j
|
|
INTERACTIVE ?= auto
|
|
PKG_MANAGER ?= $(JW_PKG_PY) --interactive=$(INTERACTIVE) distro
|
|
|
|
ifeq ($(OPT_JANWARE_PROJECT),-j)
|
|
REMOTE_GIT_FLAVOUR ?= proj
|
|
else
|
|
OPT_JANWARE_PROJECT =
|
|
REMOTE_GIT_FLAVOUR ?= priv
|
|
endif
|
|
|
|
ifneq ($(wildcard $(TOPDIR)/make/defs.mk),)
|
|
include $(TOPDIR)/make/defs.mk
|
|
endif
|
|
|
|
include $(JWBDIR)/make/defs.mk
|
|
|
|
REMOTE_GIT_DIR = /srv/git/$(JANWARE_USER)/$(REMOTE_GIT_FLAVOUR)/$(PROJECT)
|
|
REMOTE_GIT_URL = ssh://$(JANWARE_USER_PREFIX)git.janware.com$(REMOTE_GIT_DIR)
|
|
|
|
ifneq ($(DONT_CHECK_PREREQ_DONE),true)
|
|
ifndef PREREQ
|
|
PREREQ := $(call proj_query,pkg-requires --no-subpackages --subsections=jw --syntax names-only --delimiter=' ' build $(PROJECT))
|
|
endif
|
|
ifndef PREREQ_DIRS
|
|
PREREQ_DIRS := $(call proj_query,proj-dir $(PREREQ))
|
|
endif
|
|
PREREQ_DIRS_DONE := $(addsuffix /dirs-all.done,$(filter-out $(TOPDIR) /opt/%,$(PREREQ_DIRS)))
|
|
endif
|
|
|
|
ifneq ($(SUBDIRS_TO_ITERATE),)
|
|
|
|
ifeq ($(MAKECMDGOALS),)
|
|
SUBDIR_TARGETS = all
|
|
else
|
|
SUBDIR_TARGETS = $(filter $(ALLOWED_SUBDIR_TARGETS),$(MAKECMDGOALS))
|
|
endif
|
|
|
|
endif
|
|
|
|
include $(JWBDIR)/make/dirs.mk
|
|
include $(JWBDIR)/make/pkg-dist.mk
|
|
include $(JWBDIR)/make/rules.mk
|
|
include $(JWBDIR)/make/doc-rules.mk
|
|
include $(JWBDIR)/make/list-files.mk
|
|
include $(JWBDIR)/make/projects+project.mk
|
|
|
|
STREAMLINE_PROJECT ?= bash $(JWB_SCRIPT_DIR)/streamline-project.sh
|
|
|
|
INSTALLED_TOPDIR_FILES = $(addprefix $(INSTALL_DOCDIR)/, $(DOCS))
|
|
|
|
local-%:
|
|
find . -name $@.mk | \
|
|
while read f; do (\
|
|
cd `dirname $$f` ;\
|
|
$(RM) -f local.mk ;\
|
|
ln -s `basename $$f` local.mk ;\
|
|
) done
|
|
|
|
unlocal:
|
|
$(RM) -f $(shell find . -name local.mk)
|
|
|
|
topdir.distclean: topdir.clean
|
|
$(RM) -rf dist *.dist
|
|
topdir.clean:
|
|
$(RM) -rf *.done
|
|
topdir.mrproper: topdir.distclean
|
|
find . -name '*.rep' | xargs -r $(RM) -f
|
|
|
|
topdir.install: prefix.done $(INSTALLED_TOPDIR_FILES)
|
|
|
|
do-install-links:
|
|
$(Q)@cwd=$(shell $(PWD)); \
|
|
echo "o in $(INSTALL_LIBDIR):" ;\
|
|
find lib -name '*.so' -o -name '*.so.*' -o -name '*.a' -o -name '*.dll' | \
|
|
$(SED) 's%^\./%%' | \
|
|
while read f; do \
|
|
cd $(INSTALL_LIBDIR) && { \
|
|
echo " sudo ln -sf $$cwd/$$f" ; \
|
|
sudo ln -sf $$cwd/$$f; \
|
|
}; \
|
|
done; \
|
|
echo "o in $(INSTALL_EXEDIR):" ;\
|
|
find bin -type f -a -perm -u+x | \
|
|
$(SED) 's%^\./%%' | \
|
|
while read f; do \
|
|
cd $(INSTALL_EXEDIR) && { \
|
|
echo " sudo ln -sf $$cwd/$$f" ; \
|
|
sudo ln -sf $$cwd/$$f; \
|
|
}; \
|
|
done ;\
|
|
echo "o in $(INSTALL_HDRDIR):" ;\
|
|
find include -name '*.h' | \
|
|
$(SED) 's%^\./%%' | \
|
|
while read f; do \
|
|
cd $(INSTALL_HDRDIR) && { \
|
|
echo " sudo ln -sf $$cwd/$$f" ; \
|
|
sudo ln -sf $$cwd/$$f; \
|
|
}; \
|
|
done; \
|
|
echo "o in $(INSTALL_MAKEDIR):" ;\
|
|
find make -name '*.mk' | \
|
|
$(SED) 's%^\./%%' | \
|
|
while read f; do \
|
|
cd $(INSTALL_MAKEDIR) && { \
|
|
echo " sudo ln -sf $$cwd/$$f" ; \
|
|
sudo ln -sf $$cwd/$$f; \
|
|
}; \
|
|
done; \
|
|
|
|
install-links:
|
|
DEVELOPMENT=false make do-install-links
|
|
|
|
get-maintainer: git-get-maintainer
|
|
get-official: git-get-official
|
|
|
|
git-init: git-init.done $(GIT_DESCR)
|
|
|
|
git-init-from-cvs: git-init
|
|
$(LIST_VCS_FILES) -f | xargs git add
|
|
git commit -m "First commit of $(PKG_VERSION)"
|
|
|
|
git-config:
|
|
git config --global user.name || git config --global user.name "$(FULL_NAME)"
|
|
git config --global user.email || git config --global user.email $(JANWARE_USER)@janware.com
|
|
git remote -v | grep -q '^origin' || git remote add origin $(REMOTE_GIT_URL)
|
|
git remote -v | grep -q "^origin *$(REMOTE_GIT_URL)" || git remote set-url --push origin $(REMOTE_GIT_URL)
|
|
|
|
git-clone-to-remote:
|
|
ssh $(JANWARE_USER)@git.janware.com "/opt/jw-pkg/bin/git-srv-admin.sh $(OPT_JANWARE_PROJECT) create-personal-project $(PROJECT)"
|
|
make git-config
|
|
git push --set-upstream origin $(GIT_MAIN_BRANCH)
|
|
git push --all $(REMOTE_GIT_URL)
|
|
make git-update-project-description
|
|
|
|
git-import: git-init git-config
|
|
git add -A
|
|
git status
|
|
git commit -am "First commit"
|
|
|
|
git-init-remote: git-import git-clone-to-remote
|
|
|
|
git-descr: $(GIT_DESCR)
|
|
|
|
git-update-project-description:
|
|
ssh $(JANWARE_USER)@git.janware.com "/opt/jw-pkg/bin/git-srv-admin.sh $(OPT_JANWARE_PROJECT) update-descriptions $(PROJECT)"
|
|
|
|
projects-%:
|
|
$(PYTHON) $(JWB_SCRIPT_DIR)/jw-pkg.py projects build $* $(PROJECT)
|
|
|
|
install-deps-devel:
|
|
sudo zypper in $(shell echo $(PKG_REQUIRES_DEVEL) | sed "s/ *= */-/g; s/ [^ ]\+-__NEXT_VERSION__//")
|
|
|
|
streamline:
|
|
$(STREAMLINE_PROJECT)
|
|
|
|
$(GIT_DESCR): $(PROJECT_DESCR_FILE)
|
|
/bin/bash $(JWB_SCRIPT_DIR)/ini-section.sh summary $< | tee $@.tmp
|
|
mv $@.tmp $@
|
|
|
|
git-init.done:
|
|
$(Q)if [ -e .git ]; then \
|
|
echo $(TOPDIR)/.git already exists, not running git init ;\
|
|
else \
|
|
@echo git init ;\
|
|
git init; \
|
|
fi
|
|
touch $@
|
|
|
|
prefix.done:
|
|
mkdir -p $(PREFIX)
|
|
touch $@
|
|
|
|
echo-build-deps:
|
|
$(Q)echo $(call proj_query, required-os-pkg --quote "build" $(PROJECT))
|
|
|
|
git-ssh-%:
|
|
bash -c "`git remote get-url --push $* | sed 's|ssh://||; s|\([^/]\+\)/\(.*\)|LC_CDPATH=/\2 ssh -o SendEnv=LC_CDPATH \1|'`"
|
|
git-ssh: git-ssh-origin
|
|
|
|
git-get-official:
|
|
make git-get-devops
|
|
|
|
git-get-maintainer:
|
|
make git-get-$(call proj_query,getval global jw-maintainer)
|
|
|
|
git-get-%:
|
|
PGIT_SH_PROJECTS=. $(PGIT_SH) get --refspec $*:$(GIT_MAIN_BRANCH):current-branch
|
|
|
|
get-%: git-get-%
|
|
@:
|
|
|
|
pkg-manager-refresh:
|
|
$(PKG_MANAGER) refresh
|
|
|
|
pkg-install-build-deps:
|
|
$(PKG_MANAGER) install $(shell $(proj_query_cmd) required-os-pkg --quote --skip-excluded "build" $(PROJECT))
|
|
|
|
pkg-install-release-deps:
|
|
$(PKG_MANAGER) install $(shell $(proj_query_cmd) required-os-pkg --quote --skip-excluded "build,run,release" $(PROJECT))
|
|
|
|
pkg-install-testbuild-deps:
|
|
$(PKG_MANAGER) install $(shell $(proj_query_cmd) pkg-requires --quote --skip-excluded --hide-self --syntax names-only --delimiter " " "build,run,devel,release" $(PROJECT))
|
|
|
|
echo-hash:
|
|
$(Q)/bin/bash $(PKG_SH_EXE) hash
|
|
|
|
recache-vars:
|
|
rm -f $(TOPDIR)/make clean-cache cache
|