This repository has been archived on 2020-01-20. You can view files and clone it, but cannot push or open issues or pull requests.
node-spearhead/tools/mk/Makefile.defs

52 lines
1.6 KiB
Makefile
Raw Permalink Normal View History

2014-02-07 23:21:24 +02:00
# -*- mode: makefile -*-
#
2016-01-10 21:49:06 +02:00
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
#
#
# Copyright (c) 2014, Joyent, Inc.
#
2014-02-07 23:21:24 +02:00
#
# 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