1 # Be quiet and do not echo the cmd
4 # Try to use bash as shell for make
5 SHELL := $(shell if [ -x /bin/bash ]; then echo /bin/bash; else echo /bin/sh; fi)
7 # Compiler related stuff
13 LDQ = $(Q)echo -e " LD\t$@" && $(CCACHE) $(CC)
14 CCQ = $(Q)echo -e " CC\t$<" && $(CCNQ)
20 CHECK = $(Q)echo -e " CHECK\t$<" && sparse
32 LEXQ = $(Q)echo -e " LEX\t$<" && $(LEX)
33 YACCQ = $(Q)echo -e " YAAC\t$<" && $(YACC)
36 # Installation related
37 INST = echo -e " INST\t$(1)" && install -d $(2) && \
38 install --mode=644 -DC $(1) $(2)/$(shell basename $(1))
40 INSTD = echo -e " INSTD\t$(1)" && install -d $(1)
42 # Determine wheter origin of PREFIX is "file" or "command line"
43 ifeq ("$(origin PREFIX)", "$(filter $(origin PREFIX), file command line)")
44 INSTX = echo -e " INST\t$(1)" && install -d $(2) && \
45 install -C $(1) $(2)/$(shell basename $(1))
47 INSTX = echo -e " INST\t$(1)" && install -C $(1) $(2)/$(shell basename $(1))
50 MKDIR = echo -e " MKDIR\t$(1)" && mkdir -p $(1)
52 RM = echo -e " RM\t$(1)" && rm -rf $(1)
53 RMDIR = echo -e " RM\t$(1)" && rmdir --ignore-fail-on-non-empty $(1) 2> /dev/null || true
58 GIT_LAST_TAG = git describe --abbrev=0 v$(VERSION_SHORT)^
59 GIT_ARCHIVE = git archive --prefix=netsniff-ng-$(VERSION_SHORT)/ v$(VERSION_SHORT) | \
60 $(1) > ../netsniff-ng-$(VERSION_SHORT).tar.$(2)
61 GIT_TAG = git tag -a v$(VERSION_SHORT) -s -m "$(VERSION_SHORT) release"
62 GIT_LOG = git shortlog -n $(shell $(GIT_LAST_TAG))..HEAD
63 GIT_REM = git ls-files -o | xargs rm -rf
64 GIT_PEOPLE = git log --no-merges $(shell $(GIT_LAST_TAG))..HEAD | grep Author: | cut -d: -f2 | \
65 cut -d\< -f1 | sort | uniq -c | sort -nr
66 GIT_VERSION = git describe --always
69 GPG_SIGN = gpg -a --output ../netsniff-ng-$(VERSION_SHORT).tar.$(1).sign --detach-sig \
70 ../netsniff-ng-$(VERSION_SHORT).tar.$(1)