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