topdir.mk: Beautify topdir.mk (untested)

Signed-off-by: Jan Lindemann <jan@janware.com>
This commit is contained in:
Jan Lindemann 2016-04-20 14:37:09 +00:00
commit c17142388c

View file

@ -5,10 +5,15 @@ 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)
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)
PROJECT_DESCR = $(TOPDIR)/make/project.conf
ifneq ($(wildcard $(TOPDIR)/make/defs.mk),)
include $(TOPDIR)/make/defs.mk
@ -43,13 +48,6 @@ topdir.mrproper:
topdir.install: prefix.done $(INSTALLED_TOPDIR_FILES)
prefix.done:
mkdir -p $(PREFIX)
touch $@
install-links:
DEVELOPMENT=false make do-install-links
do-install-links:
@@cwd=`pwd`; \
echo "o in $(INSTALL_LIBDIR):" ;\
@ -89,25 +87,15 @@ do-install-links:
}; \
done; \
git-init:
@if [ -e .git ]; then \
echo $(TOPDIR)/.git exists, aborting ;\
exit 1 ;\
fi
git init
if [ -e $(PROJECT_DESCR_FILE) ]; then \
touch $(PROJECT_DESCR_FILE) ;\
make description ;\
fi
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)"
WHOAMI = $(shell whoami)
REMOTE_GIT_DIR = /srv/git/$(WHOAMI)/proj/$(PROJECT)
REMOTE_GIT_URL = ssh://$(WHOAMI)@git.jannet.de$(REMOTE_GIT_DIR)
git-config:
git config --global user.name $(FULL_NAME)
git config --global user.email $(WHOAMI)@jannet.de
@ -122,22 +110,34 @@ git-clone-to-remote:
git-import: git-init git-config
git add -A
git commit -am "o initial checkin"
git commit -am "initial checkin"
git-jannet-init: git-import git-clone-to-remote
git-init-remote: git-import git-clone-to-remote
git-descr: $(GIT_DESCR)
projects-%:
python $(MOD_SCRIPT_DIR)/build.py $* $(PROJECT)
$(TOPDIR)/.git/description: $(PROJECT_DESCR_FILE)
$(MOD_SCRIPT_DIR)/ini-section.sh summary $< | tee $@.tmp
mv $@.tmp $@
description: $(TOPDIR)/.git/description
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 $@