File: Makefile.defs

package info (click to toggle)
node-http-signature 1.3.6-2
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, forky, sid, trixie
  • size: 396 kB
  • sloc: javascript: 2,556; makefile: 41
file content (43 lines) | stat: -rw-r--r-- 1,502 bytes parent folder | download | duplicates (6)
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
# -*- mode: makefile -*-
#
# Copyright (c) 2012, Joyent, Inc. All rights reserved.
#
# Makefile.defs: common defines.
#
# NOTE: This makefile comes from the "eng" repo. It's designed to be dropped
# into other repos as-is without requiring any modifications. If you find
# yourself changing this file, you should instead update the original copy in
# eng.git and then update your repo to use the new version.
#
# This makefile defines some useful defines. Include it at the top of
# your Makefile.
#
# Definitions in this Makefile:
#
#	TOP 		The absolute path to the project directory. The top dir.
#	BRANCH 		The current git branch.
#	TIMESTAMP	The timestamp for the build. This can be set via
#			the TIMESTAMP envvar (used by MG-based builds).
#	STAMP		A build stamp to use in built package names.
#

TOP := $(shell pwd)

#
# Mountain Gorilla-spec'd versioning.
# See "Package Versioning" in MG's README.md:
# <https://mo.joyent.com/mountain-gorilla/blob/master/README.md#L139-200>
#
# Need GNU awk for multi-char arg to "-F".
_AWK := $(shell (which gawk >/dev/null && echo gawk) \
	|| (which nawk >/dev/null && echo nawk) \
	|| echo awk)
BRANCH := $(shell git symbolic-ref HEAD | $(_AWK) -F/ '{print $$3}')
ifeq ($(TIMESTAMP),)
	TIMESTAMP := $(shell date -u "+%Y%m%dT%H%M%SZ")
endif
_GITDESCRIBE := g$(shell git describe --all --long --dirty | $(_AWK) -F'-g' '{print $$NF}')
STAMP := $(BRANCH)-$(TIMESTAMP)-$(_GITDESCRIBE)

# node-gyp will print build info useful for debugging with V=1
export V=1