forked from sipcapture/homer
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile.in
67 lines (55 loc) · 2.15 KB
/
Makefile.in
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
# Initial Version Copyright (C) 2010 eZuce, Inc., All Rights Reserved.
# Licensed to the User under the LGPL license.
#
#
# Copyright (C) Homer Project 2012-2015 (http://www.sipcapture.org).
# Licensed to the User under the GPL license.
#
#
BUILDDIR = $(abspath @builddir@)
SRC = $(abspath @srcdir@)
PACKAGE_VERSION = @PACKAGE_VERSION@
PACKAGE_REVISION = @PACKAGE_REVISION@
DISTRO=@DISTRO@
DISTRO_OS = $(word 1,$(subst -, ,$(DISTRO)))
DISTRO_VER = $(word 2,$(subst -, ,$(DISTRO)))
DISTRO_ARCH = $(word 3,$(subst -, ,$(DISTRO)))
DISTRO_RESULTS_DIR = $(strip \
$(DISTRO_OS)/$(DISTRO_VER))
# utility
empty :=
space := $(empty) $(empty)
lowercase = $(shell echo $(1) | tr '[:upper:]' '[:lower:]')
# for each @PACKAGE_NAME@-% target, define a variable for the corresponding project directory
PROJ = $(filter $(all),$(subst ., ,$@))
proj = $(call lowercase,$(PROJ))
PROJ_REVISION = $(shell cd $(SRC)/$(PROJ) && ./config/revision-gen @PACKAGE_VERSION@)
default-first-target : help-basics;
@PACKAGE_NAME@.% :
$(MAKE) $(foreach P,$(project),$(P).$*)
help.@[email protected] = List all project subprojects considered in this build system. To add or remove, edit .modules-include or .modules-exclude
@[email protected] : %.list :
@echo $($*)
include $(sort $(wildcard mak/*.mk))
help.help = Show this help screen plus more information on more targets and important make variables.
.PHONY: help help-basics
help : help-basics
@echo -e "\nADDITIONAL TARGETS\n==================="
@$(MAKE) --no-print-directory -s help-more.print
@echo -e "\nSPECIAL VARIABLES\n==================="
@$(MAKE) --no-print-directory -s help-var.print
help-basics:
@echo -e "\nTARGETS\n==================="
@$(MAKE) --no-print-directory -s help.print
help.print help-more.print help-var.print: %.print :
@$(foreach H,$(filter $*.%,$(sort $(.VARIABLES))), \
echo "$$format_help" | Label="$(H:$*.%=%)" Text="$($(H))" bash;)
define format_help
MARGIN=18
WIDTH=`tput cols`
HELP_WIDTH=`echo $$[$${WIDTH} - $${MARGIN}]`
export TEXT=`echo "$${Text}" | fold -s -w $${HELP_WIDTH} | sed -e "2,10s|^| |g"`
export LABEL="$${Label}"
printf "%-26s - %s\n" "$${LABEL}" "$${TEXT}"
endef
export format_help