Skip to content

Commit 4e5dda2

Browse files
committed
Resolve absolute paths and remove ability to call Travis script
1 parent 9efd4db commit 4e5dda2

1 file changed

Lines changed: 22 additions & 20 deletions

File tree

Makefile

Lines changed: 22 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
# NOTE: this file should be located in the top-level application directory.
2+
13
.PHONY: help
24

35
help:
@@ -26,14 +28,20 @@ help:
2628
#############
2729
# VARIABLES #
2830

29-
# Determine the Makefile's path:
31+
# Determine the Makefile filename:
3032
THIS_FILE := $(lastword $(MAKEFILE_LIST))
3133

34+
# Determine the absolute path of the Makefile (see http://blog.jgc.org/2007/01/what-makefile-am-i-in.html):
35+
THIS_DIR := $(dir $(CURDIR)/$(word $(words $(MAKEFILE_LIST)),$(MAKEFILE_LIST)))
36+
37+
# Remove the trailing slash:
38+
THIS_DIR := $(patsubst %/,%,$(THIS_DIR))
39+
3240
GREP ?= grep
3341
NPM ?= npm
3442
NODE ?= node
3543
NODE_ENV ?= test
36-
NODE_MODULES ?= ./node_modules
44+
NODE_MODULES ?= $(THIS_DIR)/node_modules
3745
TRAVIS ?= false
3846

3947
KERNEL ?= $(shell uname -s)
@@ -52,13 +60,13 @@ NOTES ?= 'TODO|FIXME|WARNING|HACK|NOTE|OPTIMIZE'
5260
# TAPE #
5361

5462
TAPE ?= $(NODE_MODULES)/.bin/tape
55-
TAP_REPORTER ?= $(NODE_MODULES)/.bin/tap-spec
63+
TAP_REPORTER ?= $(NODE_MODULES)/.bin/tap-spec
5664
TAP_SUMMARY ?= $(NODE_MODULES)/.bin/tap-summary
5765

5866

5967
# ISTANBUL #
6068

61-
REPORTS_DIR ?= ./reports
69+
REPORTS_DIR ?= $(THIS_DIR)/reports
6270
ISTANBUL ?= $(NODE_MODULES)/.bin/istanbul
6371
ISTANBUL_OUT ?= $(REPORTS_DIR)/coverage
6472
ISTANBUL_REPORT ?= lcov
@@ -80,12 +88,7 @@ BROWSERIFY_PROXYQUIRE ?= $(NODE_MODULES)/proxyquire-universal
8088
# TESTLING #
8189

8290
TESTLING ?= $(NODE_MODULES)/.bin/testling
83-
TESTLING_DIR ?= ./
84-
85-
86-
# TRAVIS #
87-
88-
TRAVIS_CI ?= ./tools/ci/travis.sh
91+
TESTLING_DIR ?= $(THIS_DIR)/
8992

9093

9194
# JSHINT #
@@ -96,7 +99,7 @@ JSHINT_REPORTER ?= $(NODE_MODULES)/jshint-stylish
9699

97100
# FILES #
98101

99-
SOURCE_DIR ?= .
102+
SOURCE_DIR ?= $(THIS_DIR)
100103
TESTS_DIR ?= test
101104
EXAMPLES_DIR ?= examples
102105

@@ -111,7 +114,7 @@ ifeq ($(KERNEL), Darwin)
111114
-name '*.js' \
112115
-regex "$(SOURCES_FILTER)" \
113116
-not -name 'test*.js' \
114-
-not -path '$(NODE_MODULES)/*' \
117+
-not -path "$(NODE_MODULES)/*" \
115118
-not -path "**/$(EXAMPLES_DIR)/*" \
116119
-not -path "$(REPORTS_DIR)/*" \
117120
)
@@ -134,7 +137,7 @@ else
134137
-regextype posix-extended \
135138
-regex "$(SOURCES_FILTER)" \
136139
-not -name 'test*.js' \
137-
-not -path '$(NODE_MODULES)/*' \
140+
-not -path "$(NODE_MODULES)/*" \
138141
-not -path "**/$(EXAMPLES_DIR)/*" \
139142
-not -path "$(REPORTS_DIR)/*" \
140143
)
@@ -168,9 +171,9 @@ endif
168171
notes:
169172
$(GREP) -Ern $(NOTES) $(SOURCE_DIR) \
170173
--exclude-dir "$(NODE_MODULES)/*" \
171-
--exclude $(THIS_FILE) \
172-
--exclude './.*' \
173-
--exclude '$(REPORTS_DIR)/*' \
174+
--exclude "$(THIS_FILE)" \
175+
--exclude "$(THIS_DIR)/.*" \
176+
--exclude "$(REPORTS_DIR)/*" \
174177
--exclude TODO.md
175178

176179

@@ -292,9 +295,8 @@ view-istanbul-report:
292295
.PHONY: test-ci test-ci-browsers
293296
.PHONY: coverage coverage-codecov
294297

295-
test-ci: node_modules
296-
chmod 755 $(TRAVIS_CI)
297-
$(TRAVIS_CI)
298+
# test-ci: test-local test-ci-browsers
299+
test-ci: test-local
298300

299301
test-ci-browsers: node_modules
300302
xvfb-run make -f $(THIS_FILE) test-browsers
@@ -315,7 +317,7 @@ lint: lint-jshint
315317
lint-jshint: node_modules
316318
$(JSHINT) \
317319
--reporter $(JSHINT_REPORTER) \
318-
./
320+
$(SOURCE_DIR)/
319321

320322

321323
# NODE #

0 commit comments

Comments
 (0)