make: Add multiple inclusion preventers around makefile rules

Signed-off-by: Jan Lindemann <jan@janware.com>
This commit is contained in:
Jan Lindemann 2018-12-27 17:02:19 +00:00
commit 4d8ff72147
4 changed files with 16 additions and 1 deletions

View file

@ -4,9 +4,13 @@ BACKUP_DATE ?= $(shell date +'%y%m%d-%H%M%S')
_BACKUP_SOURCE = $(notdir $(shell cd $(BACKUP_SOURCE); $(PWD)))
ifndef BACKUP_MK_INCLUDED
BACKUP_MK_INCLUDED = true
backup: distclean
tar -C .. $(_BACKUP_SOURCE) -cjf $(BACKUP_TARGET)/$(_BACKUP_SOURCE)-$(BACKUP_DATE).tar.bz2
purge-last-backup:
$(RM) -f $(shell ls $(BACKUP_TARGET)/$(_BACKUP_SOURCE)-*.tar.bz2 | tail -1)
endif # ifndef BACKUP_MK_INCLUDED

View file

@ -1,4 +1,8 @@
ifndef CPP_EXTRA_TARGETS_MK_INCLUDED
CPP_EXTRA_TARGETS_MK_INCLUDED = true
all:
expand-macros:
make 2>/dev/null | sed '/$(CC)\|$(CPP)/ !d; s/$(CC)\|$(CPP)//; s/-o .*//' | grep -v "Wl\|rdynamic" | xargs $(CPP) -E -C | indent
endif # ifndef CPP_EXTRA_TARGETS_MK_INCLUDED

View file

@ -1,3 +1,6 @@
ifndef DEV_UTILS_MK_INCLUDED
DEV_UTILS_MK_INCLUDED = true
all:
install:
clean distclean:
@ -20,4 +23,4 @@ install-to-system:
sudo systemctl restart $$s ;\
done
endif # ifndef DEV_UTILS_MK_INCLUDED

View file

@ -3,6 +3,9 @@
# contact@jannet.de
# $Id$
ifndef TARGETS_TOOLS_MK_INCLUDED
TARGETS_TOOLS_MK_INCLUDED = true
include $(MODDIR)/make/rules.mk
ifneq ($(strip $(SRC_ALL_CPP)),)
@ -39,3 +42,4 @@ clean: objclean textclean localclean profclean clean.link
clean.link:
if [ -L "$(HDRDIR_SCOPE_SUFFIX)" -a "`readlink $(HDRDIR_SCOPE_SUFFIX) 2>/dev/null`" = . ]; then rm $(HDRDIR_SCOPE_SUFFIX); fi
endif # ifndef TARGETS_TOOLS_MK_INCLUDED