netsniff-ng: ring: Fix build if tp_vlan_tpid is not available in kernel header
[netsniff-ng.git] / Cmds
blobfdb80ea6ca8a96db4a638f46b4eb8d933c9851ce
1 # Be quiet and do not echo the cmd
2 Q = @
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
8 LDQ = $(Q)echo -e "  LD\t$@" && $(CCACHE) $(CC)
9 CCNQ = $(CCACHE) $(CC)
10 CCQ = $(Q)echo -e "  CC\t$<" && $(CCNQ)
11 ifeq ($(DEBUG), 1)
12   STRIPQ = $(Q)true
13 else
14   STRIPQ = $(Q)echo -e "  STRIP\t$@" && $(STRIP)
15 endif
17 # sparse related
18 C =
19 ifeq ($(C), 1)
20   CHECK = $(Q)echo -e "  CHECK\t$<" && sparse
21 else
22   CHECK = $(Q)true
23 endif
25 # Flex/bison related
26 LEX = $(Q)echo -e "  LEX\t$<" && flex
27 YAAC = $(Q)echo -e "  YAAC\t$<" && bison
29 # Installation related
30 INST = echo -e "  INST\t$(1)" && install -d $(2) && \
31         install --mode=644 -DC $(1) $(2)/$(shell basename $(1))
33 ifeq ("$(origin PREFIX)", "command line")
34   INSTX = echo -e "  INST\t$(1)" && install -d $(2) && \
35         install -C $(1) $(2)/$(shell basename $(1))
36 else
37   INSTX = echo -e "  INST\t$(1)" && install -C $(1) $(2)/$(shell basename $(1))
38 endif
40 MKDIR = echo -e  "  MKDIR\t$(1)" && mkdir -p $(1)
42 RM = echo -e "  RM\t$(1)" && rm -rf $(1)
43 RMDIR = echo -e "  RM\t$(1)" && rmdir --ignore-fail-on-non-empty $(1) 2> /dev/null || true
45 GZIP = gzip --best -c
47 # Git related
48 GIT_LAST_TAG = git describe --abbrev=0 v$(VERSION_SHORT)^
49 GIT_ARCHIVE = git archive --prefix=netsniff-ng-$(VERSION_SHORT)/ v$(VERSION_SHORT) | \
50               $(1) > ../netsniff-ng-$(VERSION_SHORT).tar.$(2)
51 GIT_TAG = git tag -a v$(VERSION_SHORT) -s -m "$(VERSION_SHORT) release"
52 GIT_LOG = git shortlog -n $(shell $(GIT_LAST_TAG))..HEAD
53 GIT_REM = git ls-files -o | xargs rm -rf
54 GIT_PEOPLE = git log --no-merges $(shell $(GIT_LAST_TAG))..HEAD | grep Author: | cut -d: -f2 | \
55              cut -d\< -f1 | sort | uniq -c | sort -nr
56 GIT_VERSION = git describe --always
58 # GPG related
59 GPG_SIGN = gpg -a --output ../netsniff-ng-$(VERSION_SHORT).tar.$(1).sign --detach-sig \
60                 ../netsniff-ng-$(VERSION_SHORT).tar.$(1)