Skip to content

Commit 080456e

Browse files
committed
Merge branch 'develop' of https://github.com/stdlib-js/stdlib into develop
2 parents a394964 + 961a9fe commit 080456e

File tree

40 files changed

+137
-88
lines changed

40 files changed

+137
-88
lines changed

README.md

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,8 @@ Running stdlib **requires** the following prerequisites:
6464

6565
Most functionality in stdlib is implemented exclusively in JavaScript; however, some implementations try to capture performance benefits by using [native bindings][node-js-add-ons] and/or [WebAssembly][webassembly]. While **not** required to run stdlib, as **every** stdlib implementation has a JavaScript fallback, the following dependencies are **required** for building native add-ons, including linking to BLAS and LAPACK libraries:
6666

67-
- [GNU make][gnu-make]: development utility and task runner
67+
- [GNU make][make]: development utility and task runner
68+
- [GNU bash][bash]: an sh-compatible shell
6869
- [gcc & g++][gcc] or [Clang][clang]: C/C++ compilation and linking (g++ version `>= 4.8`; clang version `>= 3.5`, Xcode version `>=8.3.1` on OS X)
6970
- [gfortran][gfortran]: Fortran compilation and linking (version `>= 4.8`)
7071

@@ -228,7 +229,9 @@ Copyright © 2016-2017. The Stdlib [Authors][stdlib-authors].
228229

229230
[chat-url]: https://gitter.im/stdlib-js/stdlib/
230231

231-
[gnu-make]: https://www.gnu.org/software/make
232+
[make]: https://www.gnu.org/software/make
233+
234+
[bash]: https://www.gnu.org/software/bash/
232235

233236
[curl]: http://curl.haxx.se/
234237

docs/development.md

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

77
We are super excited that you have decided to develop stdlib, and we welcome you to the stdlib developer community. We have done our best to provide a complete environment for testing, benchmarking, documenting, and developing project code. And if you have any ideas as to how we can make it better, let us know!
88

9-
Before we begin, developing stdlib requires some setup and configuration. What follows is an overview of environment requirements and a sequence of steps for getting up and running with stdlib. We use [Git][git] for version control, and for most tasks, we use [GNU make][gnu-make] (the original task runner) to help us get things done quickly and effectively. For the most part, the project is able to internally manage dependencies for testing, benchmarking, and linting, so, once you follow the steps below, you should be ready to start developing!
9+
Before we begin, developing stdlib requires some setup and configuration. What follows is an overview of environment requirements and a sequence of steps for getting up and running with stdlib. We use [Git][git] for version control, and for most tasks, we use [GNU make][make] (the original task runner) to help us get things done quickly and effectively. For the most part, the project is able to internally manage dependencies for testing, benchmarking, and linting, so, once you follow the steps below, you should be ready to start developing!
1010

1111
So, without further ado, let's get you started!
1212

@@ -15,7 +15,8 @@ So, without further ado, let's get you started!
1515
Developing and running stdlib **requires** the following prerequisites:
1616

1717
- [Git][git]: version control
18-
- [GNU make][gnu-make]: development utility and task runner
18+
- [GNU make][make]: development utility and task runner
19+
- [GNU bash][bash]: an sh-compatible shell
1920
- [curl][curl], [wget][wget], or [fetch][fetch] (FreeBSD): utilities for downloading remote resources
2021
- [Node.js][node-js]: JavaScript runtime (version `>= 0.10`)
2122
- [npm][npm]: package manager (version `> 2.7.0`; if Node `< 1.0.0`, version `> 2.7.0` and `< 4.0.0`)
@@ -281,7 +282,9 @@ For contribution guidelines, see the [contributing guide][stdlib-contributing].
281282

282283
[git]: http://git-scm.com/
283284

284-
[gnu-make]: https://www.gnu.org/software/make
285+
[make]: https://www.gnu.org/software/make
286+
287+
[bash]: https://www.gnu.org/software/bash/
285288

286289
[curl]: http://curl.haxx.se/
287290

docs/links/database.json

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3065,6 +3065,16 @@
30653065
"build"
30663066
]
30673067
},
3068+
"https://www.gnu.org/software/bash/": {
3069+
"id": "bash",
3070+
"description": "The official site of GNU bash, an sh-compatible shell.",
3071+
"short_url": "",
3072+
"keywords": [
3073+
"bash",
3074+
"gnu",
3075+
"shell"
3076+
]
3077+
},
30683078
"https://www.gnu.org/software/make/": {
30693079
"id": "make",
30703080
"description": "A development utility which controls the generation of executables and other non-source files of a program from the program's source files.",

docs/style-guides/bash/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,3 +8,4 @@ TODO
88
- [Google shell guide](https://google.github.io/styleguide/shell.xml)
99
- [bash pitfalls](http://mywiki.wooledge.org/BashPitfalls)
1010
- [limitations of usual tools](https://www.gnu.org/savannah-checkouts/gnu/autoconf/manual/autoconf-2.69/html_node/Limitations-of-Usual-Tools.html#Limitations-of-Usual-Tools)
11+
- [autoconf](https://www.gnu.org/software/autoconf/manual/autoconf.html#Portable-Shell)

tools/links/create/lib/async.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ function create( options, clbk ) {
106106

107107
debug( 'Writing updated database to file...' );
108108
out = JSON.stringify( out, null, 2 );
109-
writeFile( opts.database, out, fopts, onWrite );
109+
writeFile( opts.database, out+'\n', fopts, onWrite );
110110
} // end FUNCTION entry()
111111

112112
/**

tools/links/create/lib/sync.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ function create( options ) {
7878

7979
debug( 'Writing updated database to file...' );
8080
out = JSON.stringify( out, null, 2 );
81-
writeFile( opts.database, out, fopts );
81+
writeFile( opts.database, out+'\n', fopts );
8282
debug( 'Successfully wrote database to file.' );
8383

8484
debug( 'Finished.' );

tools/make/Makefile

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,52 @@
11

2+
# VARIABLES #
3+
4+
# Instruct make to warn us when we use an undefined variable (e.g., misspellings).
5+
MAKEFLAGS += --warn-undefined-variables
6+
7+
# Define the default target:
8+
.DEFAULT_GOAL := all
9+
10+
# Define the `SHELL` variable to avoid issues on systems where the variable may be inherited from the environment.
11+
#
12+
# ## Notes
13+
#
14+
# * We use `bash` so that we can use `pipefail`.
15+
#
16+
#
17+
# [1]: https://www.gnu.org/prep/standards/html_node/Makefile-Basics.html#Makefile-Basics
18+
# [2]: http://clarkgrubb.com/makefile-style-guide
19+
SHELL := bash
20+
21+
# Define shell flags.
22+
#
23+
# ## Notes
24+
#
25+
# * `.SHELLFLAGS` was introduced in GNU Make 3.82 and has no effect on the version of GNU Make installed on Mac OS X, which is 3.81.
26+
# * The `-e` flag causes `bash` to exit immediately if a `bash` executed command fails.
27+
# * The `-u` flag causes `bash` to exit with an error message if a variable is accessed without being defined.
28+
# * The `pipefail` option specifies that, if any of the commands in a pipeline fail, the entire pipeline fails. Otherwise the return value of a pipeline is the return value of the last command.
29+
# * The `-c` flag is in the default value of `.SHELLFLAGS`, which must be preserved, as this is how `make` passes the script to be executed to `bash`.
30+
#
31+
.SHELLFLAGS := -eu -o pipefail -c
32+
33+
# Remove targets if its recipe fails.
34+
#
35+
# ## Notes
36+
#
37+
# * Mentioning this target anywhere in a Makefile prevents a user from re-running make and using an incomplete or invalid target.
38+
# * When debugging, it may be necessary to comment this line out so the incomplete or invalid target can be inspected.
39+
#
40+
# [1]: https://www.gnu.org/software/make/manual/html_node/Special-Targets.html
41+
.DELETE_ON_ERROR:
42+
43+
# Remove all the default suffixes, preferring to define all rules explicitly.
44+
#
45+
# [1]: https://www.gnu.org/software/make/manual/html_node/Suffix-Rules.html#Suffix-Rules
46+
# [2]: https://www.gnu.org/software/make/manual/html_node/Suffix-Rules.html#Suffix-Rules
47+
.SUFFIXES:
48+
49+
250
# DEPENDENCIES #
351

452
# Order is important:

tools/make/common.mk

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,8 @@ endif
3939
endif
4040

4141
# Define whether the make commands are running on a hosted continuous integration service:
42+
TRAVIS ?=
43+
APPVEYOR ?=
4244
ifeq ($(TRAVIS), true)
4345
CI_SERVICE ?= travis
4446
else

tools/make/lib/addons/Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ endif
2929
# This target installs native add-ons. If unable to install a native add-on, the target prints an error message and proceeds to try installing the next add-on.
3030

3131
install-addons: clean-addons
32-
$(QUIET) set -o pipefail ; $(MAKE) -f $(this_file) list-pkgs-addons | while read -r pkg; do \
32+
$(QUIET) $(MAKE) -f $(this_file) list-pkgs-addons | while read -r pkg; do \
3333
if echo "$$pkg" | grep -v '^\/.*\|^[a-zA-Z]:.*' >/dev/null; then \
3434
continue; \
3535
fi; \
@@ -49,7 +49,7 @@ install-addons: clean-addons
4949
# This target removes all compiled and generated files for native add-ons.
5050

5151
clean-addons:
52-
$(QUIET) set -o pipefail ; $(MAKE) -f $(this_file) list-pkgs-addons | while read -r pkg; do \
52+
$(QUIET) $(MAKE) -f $(this_file) list-pkgs-addons | while read -r pkg; do \
5353
if echo "$$pkg" | grep -v '^\/.*\|^[a-zA-Z]:.*' >/dev/null; then \
5454
continue; \
5555
fi; \

tools/make/lib/benchmark/c.mk

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
# This target runs a list of C benchmarks consecutively.
77

88
benchmark-c:
9-
$(QUIET) set -o pipefail ; $(FIND_C_BENCHMARKS_CMD) | grep '^[\/]\|^[a-zA-Z]:[/\]' | while read -r file; do \
9+
$(QUIET) $(FIND_C_BENCHMARKS_CMD) | grep '^[\/]\|^[a-zA-Z]:[/\]' | while read -r file; do \
1010
echo ""; \
1111
echo "Running benchmark: $$file"; \
1212
cd `dirname $$file` && \

0 commit comments

Comments
 (0)