Skip to content

Commit 0003603

Browse files
committed
Clean-up includes, rename variables, fix too many files bug, and fix lint errors
1 parent 0c6c0b7 commit 0003603

47 files changed

Lines changed: 585 additions & 372 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

Makefile

Lines changed: 28 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -14,66 +14,71 @@ else
1414
endif
1515

1616
# Determine the filename:
17-
THIS_FILE := $(lastword $(MAKEFILE_LIST))
17+
this_file := $(lastword $(MAKEFILE_LIST))
1818

1919
# Determine the absolute path of the Makefile (see http://blog.jgc.org/2007/01/what-makefile-am-i-in.html):
20-
THIS_DIR := $(dir $(CURDIR)/$(word $(words $(MAKEFILE_LIST)),$(MAKEFILE_LIST)))
20+
this_dir := $(dir $(CURDIR)/$(word $(words $(MAKEFILE_LIST)),$(MAKEFILE_LIST)))
2121

2222
# Remove the trailing slash:
23-
THIS_DIR := $(patsubst %/,%,$(THIS_DIR))
23+
this_dir := $(patsubst %/,%,$(this_dir))
2424

2525
# Define the root project directory:
26-
ROOT ?= $(THIS_DIR)
26+
ROOT_DIR ?= $(this_dir)
2727

2828
# Define the root tools directory:
29-
TOOLS_DIR ?= $(ROOT)/tools
29+
TOOLS_DIR ?= $(ROOT_DIR)/tools
3030

31-
# Define the directory containing Makefile dependencies:
31+
# Define the directory containing the entry point for Makefile dependencies:
3232
TOOLS_MAKE_DIR ?= $(TOOLS_DIR)/make
3333

34+
# Define the subdirectory containing Makefile dependencies:
35+
TOOLS_MAKE_LIB_DIR ?= $(TOOLS_MAKE_DIR)/lib
36+
3437
# Define the root build directory:
35-
BUILD_DIR ?= $(ROOT)/build
38+
BUILD_DIR ?= $(ROOT_DIR)/build
3639

3740
# Define the root configuration directory:
38-
CONFIG_DIR ?= $(ROOT)/etc
41+
CONFIG_DIR ?= $(ROOT_DIR)/etc
3942

4043
# Define the directory for writing reports, including code coverage:
41-
REPORTS_DIR ?= $(ROOT)/reports
44+
REPORTS_DIR ?= $(ROOT_DIR)/reports
4245
COVERAGE_DIR ?= $(REPORTS_DIR)/coverage
4346

4447
# Define the directory for documentation:
45-
DOCS_DIR ?= $(ROOT)/docs
48+
DOCS_DIR ?= $(ROOT_DIR)/docs
4649

4750
# Define the top-level directory containing executables:
48-
BIN_DIR ?= $(ROOT)/bin
51+
LOCAL_BIN_DIR ?= $(ROOT_DIR)/bin
4952

5053
# Define the top-level directory containing node module dependencies:
51-
NODE_MODULES ?= $(ROOT)/node_modules
54+
NODE_MODULES ?= $(ROOT_DIR)/node_modules
5255

5356
# Define the top-level directory containing node module executables:
54-
BIN ?= $(NODE_MODULES)/.bin
57+
BIN_DIR ?= $(NODE_MODULES)/.bin
5558

56-
# Define the top-level directory containing source files:
57-
SOURCE_DIR ?= lib
59+
# Define the top-level folder name containing source files:
60+
SOURCE_FOLDER ?= lib
5861

59-
# Define the directory name for test files:
60-
TESTS_DIR ?= test
62+
# Define the folder name for test files:
63+
TESTS_FOLDER ?= test
6164

62-
# Define the directory name for test fixtures:
63-
TESTS_FIXTURES_DIR ?= test/fixtures
65+
# Define the folder name for test fixtures:
66+
TESTS_FIXTURES_FOLDER ?= test/fixtures
6467

65-
# Define the directory name for examples files:
66-
EXAMPLES_DIR ?= examples
68+
# Define the folder name for examples files:
69+
EXAMPLES_FOLDER ?= examples
6770

6871
# Define whether delete operations should be safe (i.e., deleted items are sent to trash, rather than permanently deleted):
6972
SAFE_DELETE ?= false
7073

7174
# Define the delete command:
7275
ifeq ($(SAFE_DELETE), true)
7376
# FIXME: -rm -rf
74-
DELETE_CMD := -rm -rf
77+
DELETE := -rm
78+
DELETE_FLAGS := rf
7579
else
76-
DELETE_CMD ?= -rm -rf
80+
DELETE ?= -rm -rf
81+
DELETE_FLAGS ?= -rf
7782
endif
7883

7984

tools/make/Makefile

Lines changed: 20 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,8 @@ NPM ?= npm
88
NODE ?= node
99

1010
# Define the command for removing files and directories:
11-
DELETE_CMD ?= -rm -rf
11+
DELETE ?= -rm
12+
DELETE_FLAGS ?= -rf
1213

1314
# Determine the host kernel:
1415
KERNEL ?= $(shell uname -s)
@@ -19,25 +20,26 @@ ifeq ($(KERNEL), Darwin)
1920
else
2021
OPEN ?= xdg-open
2122
endif
23+
# TODO: add Windows command
2224

2325

2426
# DEPENDENCIES #
2527

26-
include $(TOOLS_MAKE_DIR)/lib/help/Makefile
27-
include $(TOOLS_MAKE_DIR)/lib/repl/Makefile
28-
include $(TOOLS_MAKE_DIR)/lib/find/Makefile
29-
include $(TOOLS_MAKE_DIR)/lib/lint/Makefile
30-
include $(TOOLS_MAKE_DIR)/lib/deps/Makefile
31-
include $(TOOLS_MAKE_DIR)/lib/notes/Makefile
32-
include $(TOOLS_MAKE_DIR)/lib/install/Makefile
33-
include $(TOOLS_MAKE_DIR)/lib/test/Makefile
34-
include $(TOOLS_MAKE_DIR)/lib/test-cov/Makefile
35-
include $(TOOLS_MAKE_DIR)/lib/test-browsers/Makefile
36-
include $(TOOLS_MAKE_DIR)/lib/test-ci/Makefile
37-
include $(TOOLS_MAKE_DIR)/lib/coverage-service/Makefile
38-
include $(TOOLS_MAKE_DIR)/lib/examples/Makefile
39-
include $(TOOLS_MAKE_DIR)/lib/docs/Makefile
40-
include $(TOOLS_MAKE_DIR)/lib/debug/Makefile
28+
include $(TOOLS_MAKE_LIB_DIR)/help/Makefile
29+
include $(TOOLS_MAKE_LIB_DIR)/repl/Makefile
30+
include $(TOOLS_MAKE_LIB_DIR)/find/Makefile
31+
include $(TOOLS_MAKE_LIB_DIR)/lint/Makefile
32+
include $(TOOLS_MAKE_LIB_DIR)/deps/Makefile
33+
include $(TOOLS_MAKE_LIB_DIR)/notes/Makefile
34+
include $(TOOLS_MAKE_LIB_DIR)/install/Makefile
35+
include $(TOOLS_MAKE_LIB_DIR)/test/Makefile
36+
include $(TOOLS_MAKE_LIB_DIR)/test-cov/Makefile
37+
include $(TOOLS_MAKE_LIB_DIR)/test-browsers/Makefile
38+
include $(TOOLS_MAKE_LIB_DIR)/test-ci/Makefile
39+
include $(TOOLS_MAKE_LIB_DIR)/coverage-service/Makefile
40+
include $(TOOLS_MAKE_LIB_DIR)/examples/Makefile
41+
include $(TOOLS_MAKE_LIB_DIR)/docs/Makefile
42+
include $(TOOLS_MAKE_LIB_DIR)/debug/Makefile
4143

4244

4345
# TARGETS #
@@ -47,8 +49,7 @@ include $(TOOLS_MAKE_DIR)/lib/debug/Makefile
4749
# This target runs the project's cleanup sequence.
4850

4951
clean: clean-node clean-cov clean-docs
50-
$(DELETE_CMD) $(BUILD_DIR)
51-
$(DELETE_CMD) $(REPORTS_DIR)
52-
52+
$(DELETE) $(DELETE_FLAGS) $(BUILD_DIR)
53+
$(DELETE) $(DELETE_FLAGS) $(REPORTS_DIR)
5354

5455
.PHONY: clean

tools/make/README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -147,21 +147,21 @@ $ make TESTS_FILTER=.*/utils/fs/.* list-tests
147147
To list all test fixture files,
148148

149149
``` bash
150-
$ make list-test-fixtures
150+
$ make list-tests-fixtures
151151
```
152152

153153
To filter based on a file name or pattern,
154154

155155
``` bash
156156
# List only the Julia test fixtures...
157-
$ make TESTS_FIXTURES_PATTERN=*.jl list-test-fixtures
157+
$ make TESTS_FIXTURES_PATTERN=*.jl list-tests-fixtures
158158
```
159159

160160
To filter based on a file path,
161161

162162
``` bash
163163
# List only test fixture files in the base math directory for special functions...
164-
$ make TESTS_FIXTURES_FILTER=.*/math/special/.* list-test-fixtures
164+
$ make TESTS_FIXTURES_FILTER=.*/math/special/.* list-tests-fixtures
165165
```
166166

167167
##### Examples

tools/make/lib/coverage-service/Makefile

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,13 @@
55
COVERAGE_SERVICE ?= codecov
66

77
# Define the path of the `lcov.info` file which will be sent to the coverage service:
8-
LCOV_INFO_PATH ?= $(COVERAGE_DIR)/lcov.info
8+
LCOV_INFO ?= $(COVERAGE_DIR)/lcov.info
99

1010

1111
# DEPENDENCIES #
1212

1313
ifeq ($(COVERAGE_SERVICE), codecov)
14-
include $(TOOLS_MAKE_DIR)/lib/coverage-service/codecov.mk
14+
include $(TOOLS_MAKE_LIB_DIR)/coverage-service/codecov.mk
1515
endif
1616

1717

@@ -23,8 +23,7 @@ endif
2323

2424
coverage:
2525
ifeq ($(COVERAGE_SERVICE), codecov)
26-
@$(MAKE) -f $(THIS_FILE) coverage-codecov
26+
@$(MAKE) -f $(this_file) coverage-codecov
2727
endif
2828

29-
3029
.PHONY: coverage

tools/make/lib/coverage-service/codecov.mk

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,12 @@
11

22
# VARIABLES #
33

4+
# Define the command for `cat`:
45
CAT ?= cat
6+
CAT_FLAGS ?=
57

68
# Define the path to the Codecov executable:
7-
CODECOV ?= $(BIN)/codecov
9+
CODECOV ?= $(BIN_DIR)/codecov
810

911

1012
# TARGETS #
@@ -20,6 +22,6 @@ CODECOV ?= $(BIN)/codecov
2022

2123
coverage-codecov:
2224
$(NPM) install codecov
23-
$(CAT) $(LCOV_INFO_PATH) | $(CODECOV)
25+
$(CAT) $(CAT_FLAGS) $(LCOV_INFO) | $(CODECOV)
2426

2527
.PHONY: coverage-codecov

tools/make/lib/debug/Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
# Print variable value.
55
#
6-
# This target prints the runtime value of any variable via `print-VARIABLE_NAME`.
6+
# This target prints the runtime value of any variable via `inspect.VARIABLE_NAME`.
77

8-
print-%:
8+
inspect.%:
99
@echo '$*=$($*)'

tools/make/lib/deps/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11

22
# DEPENDENCIES #
33

4-
include $(TOOLS_MAKE_DIR)/lib/deps/check.mk
4+
include $(TOOLS_MAKE_LIB_DIR)/deps/check.mk
55

tools/make/lib/deps/check.mk

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11

22
# DEPENDENCIES #
33

4-
include $(TOOLS_MAKE_DIR)/lib/deps/david.mk
4+
include $(TOOLS_MAKE_LIB_DIR)/deps/david.mk
55

66

77
# TARGETS #
@@ -12,6 +12,5 @@ include $(TOOLS_MAKE_DIR)/lib/deps/david.mk
1212

1313
check-deps: check-javascript-deps
1414

15-
1615
.PHONY: check-deps
1716

tools/make/lib/deps/david.mk

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,10 @@
88
#
99
# [1]: https://www.npmjs.com/package/david
1010

11-
DAVID_BIN ?= $(BIN)/david
11+
DAVID_BIN ?= $(BIN_DIR)/david
1212

1313
# Define the path to the root `package.json`:
14-
ROOT_PACKAGE_JSON ?= $(ROOT)/package.json
14+
ROOT_PACKAGE_JSON ?= $(ROOT_DIR)/package.json
1515

1616
# Define the command-line options to use when invoking the david executable:
1717
DAVID_FLAGS ?= --package $(ROOT_PACKAGE_JSON)
@@ -23,8 +23,7 @@ DAVID_FLAGS ?= --package $(ROOT_PACKAGE_JSON)
2323
#
2424
# This target checks JavaScript dependencies for updates and security vulnerabilities.
2525

26-
check-javascript-deps:
26+
check-javascript-deps: $(NODE_MODULES)
2727
$(DAVID_BIN) $(DAVID_FLAGS)
2828

29-
3029
.PHONY: check-javascript-deps

tools/make/lib/docs/Makefile

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11

22
# DEPENDENCIES #
33

4-
include $(TOOLS_MAKE_DIR)/lib/docs/src.mk
4+
include $(TOOLS_MAKE_LIB_DIR)/docs/src.mk
55

66

77
# TARGETS #
@@ -12,12 +12,13 @@ include $(TOOLS_MAKE_DIR)/lib/docs/src.mk
1212

1313
docs: src-docs
1414

15+
.PHONY: docs
16+
1517

1618
# Remove generated documentation.
1719
#
1820
# This target cleans generated documentation by removing it entirely.
1921

2022
clean-docs: clean-src-docs
2123

22-
23-
.PHONY: docs clean-docs
24+
.PHONY: clean-docs

0 commit comments

Comments
 (0)