jw-pkg/make/topdir.mk

143 lines
3.5 KiB
Makefile
Raw Normal View History

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 doc test inst/post)
PROJECT_DESCR = $(TOPDIR)/make/project.conf
GIT_DESCR = $(TOPDIR)/.git/description
WHOAMI = $(shell whoami)
REMOTE_GIT_DIR = /srv/git/$(WHOAMI)/proj/$(PROJECT)
REMOTE_GIT_URL = ssh://$(WHOAMI)@git.jannet.de$(REMOTE_GIT_DIR)
ifneq ($(wildcard $(TOPDIR)/make/defs.mk),)
include $(TOPDIR)/make/defs.mk
endif
include $(MODDIR)/make/defs.mk
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))
2006-05-26 14:07:43 +00:00
local-%:
find . -name $@.mk | \
2006-06-01 09:10:30 +00:00
while read f; do (\
cd `dirname $$f` ;\
2006-05-26 14:07:43 +00:00
rm -f local.mk ;\
2006-06-01 09:10:30 +00:00
ln -s `basename $$f` local.mk ;\
) done
2006-05-26 14:07:43 +00:00
unlocal:
rm -f $(shell find . -name local.mk)
topdir.distclean:
topdir.clean:
2007-09-05 18:08:20 +00:00
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' | \
2012-02-04 10:59:02 +00:00
$(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 | \
2012-02-04 10:59:02 +00:00
$(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' | \
2012-02-04 10:59:02 +00:00
$(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' | \
2012-02-04 10:59:02 +00:00
$(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-cvs-files.sh -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 $(WHOAMI)@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/ytools/bin/git-srv-admin.sh -j create-personal-project $(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 commit -am "initial checkin"
git-init-remote: git-import git-clone-to-remote
git-descr: $(GIT_DESCR)
projects-%:
python $(MOD_SCRIPT_DIR)/build.py $* $(PROJECT)
2012-04-30 07:56:35 +00:00
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 $@