mirror of
ssh://git.janware.com/srv/git/janware/proj/jw-pkg
synced 2026-01-15 20:13:32 +01:00
165 lines
4.2 KiB
Makefile
165 lines
4.2 KiB
Makefile
all: config
|
|
install: topdir.install
|
|
clean: topdir.clean
|
|
distclean: topdir.distclean
|
|
config:
|
|
mrproper:distclean topdir.mrproper
|
|
|
|
SUBDIRS ?= $(wildcard inst/pre make scripts contrib src libsrc \
|
|
tools include lib bin util plugins conf config cfg \
|
|
images htdocs tmpl doc test inst/post)
|
|
PROJECT_DESCR = $(TOPDIR)/make/project.conf
|
|
GIT_DESCR = $(TOPDIR)/.git/description
|
|
LIST_VCS_FILES = /bin/bash $(MOD_SCRIPT_DIR)/list-cvs-files.sh
|
|
|
|
OPT_JANWARE_PROJECT ?= -j
|
|
|
|
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 $(MODDIR)/make/defs.mk
|
|
|
|
REMOTE_GIT_DIR = /srv/git/$(JANWARE_USER)/$(REMOTE_GIT_FLAVOUR)/$(RPM_PROJECT)
|
|
REMOTE_GIT_URL = ssh://$(JANWARE_USER)@git.jannet.de$(REMOTE_GIT_DIR)
|
|
|
|
include $(MODDIR)/make/dirs.mk
|
|
include $(MODDIR)/make/rpmdist.mk
|
|
include $(MODDIR)/make/rules.mk
|
|
include $(MODDIR)/make/doc-rules.mk
|
|
|
|
STREAMLINE_PROJECT ?= bash $(MOD_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 -f *.done
|
|
topdir.mrproper:
|
|
find . -name '*.rep' | xargs -r rm -f
|
|
|
|
topdir.install: prefix.done $(INSTALLED_TOPDIR_FILES)
|
|
|
|
do-install-links:
|
|
@@cwd=`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
|
|
|
|
git-init: git-init.done $(GIT_DESCR)
|
|
|
|
git-init-from-cvs: git-init
|
|
$(LIST_VCS_FILES) -f | xargs git add
|
|
git commit -m "initial checkin of $(RPM_VERSION)"
|
|
|
|
git-config:
|
|
git config --global user.name "$(FULL_NAME)"
|
|
git config --global user.email $(JANWARE_USER)@janware.com
|
|
git remote add origin $(REMOTE_GIT_URL)
|
|
git remote set-url --push origin $(REMOTE_GIT_URL)
|
|
|
|
git-clone-to-remote:
|
|
ssh git.jannet.de "/opt/jw-build/bin/git-srv-admin.sh $(OPT_JANWARE_PROJECT) create-personal-project $(RPM_PROJECT)"
|
|
git remote set-url --push origin $(REMOTE_GIT_URL)
|
|
git push --set-upstream origin master
|
|
git push --all $(REMOTE_GIT_URL)
|
|
|
|
git-import: git-init git-config
|
|
git add -A
|
|
git status
|
|
git commit -am "initial checkin"
|
|
|
|
git-init-remote: git-import git-clone-to-remote
|
|
|
|
git-descr: $(GIT_DESCR)
|
|
|
|
git-update-project-description:
|
|
ssh git.jannet.de "/opt/jw-build/bin/git-srv-admin.sh $(OPT_JANWARE_PROJECT) update-descriptions $(RPM_PROJECT)"
|
|
|
|
projects-%:
|
|
python $(MOD_SCRIPT_DIR)/build.py $* $(RPM_PROJECT)
|
|
|
|
install-deps-devel:
|
|
sudo zypper in $(shell echo $(RPM_REQUIRES_DEVEL) | sed "s/ *= */-/g; s/ [^ ]\+-__NEXT_VERSION__//")
|
|
|
|
streamline:
|
|
$(STREAMLINE_PROJECT)
|
|
|
|
$(GIT_DESCR): $(PROJECT_DESCR_FILE)
|
|
$(MOD_SCRIPT_DIR)/ini-section.sh summary $< | tee $@.tmp
|
|
mv $@.tmp $@
|
|
|
|
git-init.done:
|
|
@if [ -e .git ]; then \
|
|
echo $(TOPDIR)/.git already exists, not running git init ;\
|
|
else \
|
|
git init; \
|
|
fi
|
|
touch $@
|
|
|
|
prefix.done:
|
|
mkdir -p $(PREFIX)
|
|
touch $@
|
|
|
|
echo-prereq-build:
|
|
@python $(MOD_SCRIPT_DIR)/projects.py --topdir . $(PROJECTS_PY_EXTRA_ARGS) required-pkg $(RPM_PROJECT)
|
|
|
|
list-files echo-files:
|
|
@$(LIST_VCS_FILES) -f
|
|
|
|
list-text-files echo-text-files:
|
|
@$(LIST_VCS_FILES) -ft
|