build: travis: Pass on CC environment variable to make
[netsniff-ng.git] / Cmds
blob247a9728ffae297eadc0d8a9f54ed2f470f521bc
1 # Be quite 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 # GCC related stuff
8 LD = $(Q)echo -e "  LD\t$@" && $(CCACHE) $(CROSS_COMPILE)gcc
9 CCNQ = $(CCACHE) $(CROSS_COMPILE)gcc
10 CC = $(Q)echo -e "  CC\t$<" && $(CCNQ)
11 ifeq ($(DEBUG), 1)
12   STRIP = $(Q)true
13 else
14   STRIP = $(Q)echo -e "  STRIP\t$@" && $(CROSS_COMPILE)strip
15 endif
17 # sparse related
18 ifeq ($(C), 1)
19   CHECK = $(Q)echo -e "  CHECK\t$<" && sparse
20 else
21   CHECK = $(Q)true
22 endif
24 # Flex/bison related
25 LEX = $(Q)echo -e "  LEX\t$<" && flex
26 YAAC = $(Q)echo -e "  YAAC\t$<" && bison
28 # Installation related
29 INST = echo -e "  INST\t$(1)" && install -d $(2) && \
30         install --mode=644 -DC $(1) $(2)/$(shell basename $(1))
32 ifeq ("$(origin PREFIX)", "command line")
33   INSTX = echo -e "  INST\t$(1)" && install -d $(2) && \
34         install -C $(1) $(2)/$(shell basename $(1))
35 else
36   INSTX = echo -e "  INST\t$(1)" && install -C $(1) $(2)/$(shell basename $(1))
37 endif
39 MKDIR = echo -e  "  MKDIR\t$(1)" && mkdir -p $(1)
41 RM = echo -e "  RM\t$(1)" && rm -rf $(1)
42 RMDIR = echo -e "  RM\t$(1)" && rmdir --ignore-fail-on-non-empty $(1) 2> /dev/null || true
44 GZIP = gzip --best -c
46 # Git related
47 GIT_LAST_TAG = git describe --abbrev=0 v$(VERSION_SHORT)^
48 GIT_ARCHIVE = git archive --prefix=netsniff-ng-$(VERSION_SHORT)/ v$(VERSION_SHORT) | \
49               $(1) > ../netsniff-ng-$(VERSION_SHORT).tar.$(2)
50 GIT_TAG = git tag -a v$(VERSION_SHORT) -s -m "$(VERSION_SHORT) release"
51 GIT_LOG = git shortlog -n $(shell $(GIT_LAST_TAG))..HEAD
52 GIT_REM = git ls-files -o | xargs rm -rf
53 GIT_PEOPLE = git log --no-merges $(shell $(GIT_LAST_TAG))..HEAD | grep Author: | cut -d: -f2 | \
54              cut -d\< -f1 | sort | uniq -c | sort -nr
55 GIT_VERSION = git describe --always
57 # GPG related
58 GPG_SIGN = gpg -a --output ../netsniff-ng-$(VERSION_SHORT).tar.$(1).sign --detach-sig \
59                 ../netsniff-ng-$(VERSION_SHORT).tar.$(1)