forked from stdlib-js/stdlib
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
117 lines (87 loc) · 3.11 KB
/
Makefile
File metadata and controls
117 lines (87 loc) · 3.11 KB
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
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
# VARIABLES #
# Define whether the make commands are running on a hosted continuous integration service:
ifeq ($(TRAVIS), true)
CI_SERVICE ?= travis
else ifeq ($(APPVEYOR), true)
CI_SERVICE ?= appveyor
else
CI_SERVICE ?= none
endif
# Determine the filename:
this_file := $(lastword $(MAKEFILE_LIST))
# Determine the absolute path of the Makefile (see http://blog.jgc.org/2007/01/what-makefile-am-i-in.html):
this_dir := $(dir $(CURDIR)/$(word $(words $(MAKEFILE_LIST)),$(MAKEFILE_LIST)))
# Remove the trailing slash:
this_dir := $(patsubst %/,%,$(this_dir))
# Define the root project directory:
ROOT_DIR ?= $(this_dir)
# Define the root tools directory:
TOOLS_DIR ?= $(ROOT_DIR)/tools
# Define the directory containing the entry point for Makefile dependencies:
TOOLS_MAKE_DIR ?= $(TOOLS_DIR)/make
# Define the subdirectory containing Makefile dependencies:
TOOLS_MAKE_LIB_DIR ?= $(TOOLS_MAKE_DIR)/lib
# Define the root build directory:
BUILD_DIR ?= $(ROOT_DIR)/build
# Define the root configuration directory:
CONFIG_DIR ?= $(ROOT_DIR)/etc
# Define the directory for writing reports, including code coverage:
REPORTS_DIR ?= $(ROOT_DIR)/reports
COVERAGE_DIR ?= $(REPORTS_DIR)/coverage
COMPLEXITY_DIR ?= $(REPORTS_DIR)/complexity
# Define the directory for workshops:
WORKSHOPS_DIR ?= $(ROOT_DIR)/workshops
# Define the directory for documentation:
DOCS_DIR ?= $(ROOT_DIR)/docs
# Define the directory for generated source code documentation:
SRC_DOCS_DIR ?= $(BUILD_DIR)/docs
# Define the top-level directory containing executables:
LOCAL_BIN_DIR ?= $(ROOT_DIR)/bin
# Define the top-level directory containing node module dependencies:
NODE_MODULES ?= $(ROOT_DIR)/node_modules
# Define the top-level directory containing node module executables:
BIN_DIR ?= $(NODE_MODULES)/.bin
# Define the top-level folder name containing source files:
SOURCE_FOLDER ?= lib
# Define the folder name convention for test files:
TESTS_FOLDER ?= test
# Define the folder name convention for test fixtures:
TESTS_FIXTURES_FOLDER ?= test/fixtures
# Define the folder name convention for examples files:
EXAMPLES_FOLDER ?= examples
# Define the folder name convention for benchmark files:
BENCHMARKS_FOLDER ?= benchmark
# Define Node paths:
NODE_PATH ?= $(ROOT_DIR)/lib/node_modules
NODE_PATH_BENCHMARK ?= $(NODE_PATH)
NODE_PATH_EXAMPLES ?= $(NODE_PATH)
NODE_PATH_REPL ?= $(NODE_PATH)
NODE_PATH_TEST ?= $(NODE_PATH)
NODE_PATH_WORKSHOPS ?= $(NODE_PATH)
# Define Node environments:
ifdef ($(NODE_ENV))
NODE_ENV_BENCHMARK := $(NODE_ENV)
NODE_ENV_EXAMPLES := $(NODE_ENV)
NODE_ENV_REPL := $(NODE_ENV)
NODE_ENV_TEST := $(NODE_ENV)
NODE_ENV_WORKSHOPS := $(NODE_ENV)
else
NODE_ENV_BENCHMARK ?= benchmark
NODE_ENV_EXAMPLES ?= examples
NODE_ENV_REPL ?= repl
NODE_ENV_TEST ?= test
NODE_ENV_WORKSHOPS ?= workshop
endif
# Define whether delete operations should be safe (i.e., deleted items are sent to trash, rather than permanently deleted):
SAFE_DELETE ?= false
# Define the delete command:
ifeq ($(SAFE_DELETE), true)
# FIXME: -rm -rf
DELETE := -rm
DELETE_FLAGS := -rf
else
DELETE ?= -rm
DELETE_FLAGS ?= -rf
endif
# DEPENDENCIES #
include $(TOOLS_MAKE_DIR)/Makefile