forked from yaml/yaml-spec
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.common.mk
55 lines (45 loc) · 1.05 KB
/
.common.mk
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
SHELL := bash
TTY := $(shell [ -t 0 ] && echo 1)
UID := $(shell id -u)
GID := $(shell id -g)
ifneq ($(wildcard /.dockerenv),)
IN_DOCKER := true
endif
ifdef IN_DOCKER
export ROOT := /host
else
export ROOT := $(shell git rev-parse --show-toplevel)
endif
ifdef TEX_LOG
export TEX_LOG
endif
SPEC12 := $(ROOT)/1.2
SPEC := $(ROOT)/spec/1.2.2
DOC := $(ROOT)/doc
GRAMMAR := $(ROOT)/grammar
RFC := $(ROOT)/rfc
STORY := $(ROOT)/story
TOOL := $(ROOT)/tool
WWW := $(ROOT)/www
export PATH := $(ROOT)/bin:$(PATH)
ifeq ($(YAML_SPEC_DIR),)
base := $(shell dirname $(abspath $(firstword $(MAKEFILE_LIST))))
override YAML_SPEC_DIR := $(base:$(ROOT)%=%)
override YAML_SPEC_DIR := $(YAML_SPEC_DIR:/%=%)
endif
export YAML_SPEC_DIR
export RUN_OR_DOCKER_WORKDIR := $(YAML_SPEC_DIR)
# Make sure Mac uses coreutils where needed:
TOUCH := touch
ostype := $(shell uname -s)
ifeq ($(ostype),Darwin)
ifeq ($(shell command -v gtouch),)
$(info Need coreutils for Mac)
$(info Try 'brew install coreutils')
$(error)
endif
TOUCH := gtouch
endif
.SECONDEXPANSION:
.DELETE_ON_ERROR:
default: