flowtop: Move & refactor walk_processes() to proc.c
[netsniff-ng.git] / Cmds
blobd7fb40c76d15f2178a02c35a7d1ed896bdcf9601
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)
12 # sparse related
13 C =
14 ifeq ($(C), 1)
15   CHECK = $(Q)echo -e "  CHECK\t$<" && sparse
16 else
17   CHECK = @true
18 endif
20 # Flex/bison related
21 LEX = $(Q)echo -e "  LEX\t$<" && flex
22 YAAC = $(Q)echo -e "  YAAC\t$<" && bison
24 # Installation related
25 INST = echo -e "  INST\t$(1)" && install -d $(2) && \
26         install --mode=644 -DC $(1) $(2)/$(shell basename $(1))
28 # Determine wheter origin of PREFIX is "file" or "command line"
29 ifeq ("$(origin PREFIX)", "$(filter $(origin PREFIX), file command line)")
30   INSTX = echo -e "  INST\t$(1)" && install -d $(2) && \
31         install -C $(1) $(2)/$(shell basename $(1))
32 else
33   INSTX = echo -e "  INST\t$(1)" && install -C $(1) $(2)/$(shell basename $(1))
34 endif
36 MKDIR = echo -e  "  MKDIR\t$(1)" && mkdir -p $(1)
38 RM = echo -e "  RM\t$(1)" && rm -rf $(1)
39 RMDIR = echo -e "  RM\t$(1)" && rmdir --ignore-fail-on-non-empty $(1) 2> /dev/null || true
41 GZIP = gzip -9 -c
43 # Git related
44 GIT_LAST_TAG = git describe --abbrev=0 v$(VERSION_SHORT)^
45 GIT_ARCHIVE = git archive --prefix=netsniff-ng-$(VERSION_SHORT)/ v$(VERSION_SHORT) | \
46               $(1) > ../netsniff-ng-$(VERSION_SHORT).tar.$(2)
47 GIT_TAG = git tag -a v$(VERSION_SHORT) -s -m "$(VERSION_SHORT) release"
48 GIT_LOG = git shortlog -n $(shell $(GIT_LAST_TAG))..HEAD
49 GIT_REM = git ls-files -o | xargs rm -rf
50 GIT_PEOPLE = git log --no-merges $(shell $(GIT_LAST_TAG))..HEAD | grep Author: | cut -d: -f2 | \
51              cut -d\< -f1 | sort | uniq -c | sort -nr
52 GIT_VERSION = git describe --always
54 # GPG related
55 GPG_SIGN = gpg -a --output ../netsniff-ng-$(VERSION_SHORT).tar.$(1).sign --detach-sig \
56                 ../netsniff-ng-$(VERSION_SHORT).tar.$(1)