Skip to content

Commit

Permalink
make produces less extraneous output now
Browse files Browse the repository at this point in the history
  • Loading branch information
LivInTheLookingGlass committed Aug 11, 2024
1 parent 4339692 commit f514856
Show file tree
Hide file tree
Showing 10 changed files with 111 additions and 136 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/javascript.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,15 +49,15 @@ jobs:
cache-dependency-path: 'javascript/package-lock.json'

- name: Install dependencies
run: make js_dependencies
run: make js_dependencies COV=true

- name: Run tests (serially)
if: ${{ matrix.version == 22 && matrix.os == 'ubuntu-latest' }}
run: make js_test COV=true
run: make js_test COV=true HAS_NPM=0

- name: Run tests (in parallel)
if: ${{ !(matrix.version == 22 && matrix.os == 'ubuntu-latest') }}
run: make js_test_auto COV=true
run: make js_test_auto COV=true HAS_NPM=0

- name: Upload coverage reports to Codecov
uses: codecov/[email protected]
Expand Down
20 changes: 10 additions & 10 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -42,39 +42,39 @@ html dirhtml singlehtml epub latex: LICENSE
@$(MAKE) docs_$@ $(MFLAGS)

.PHONY: clean
clean: LICENSE cs_clean cp_clean c_clean ja_clean js_clean py_clean rs_clean docs_clean
clean: cs_clean cp_clean c_clean ja_clean js_clean py_clean rs_clean docs_clean

.PHONY: cs_%
cs_%: LICENSE
@cd csharp && $(MAKE) $* $(MFLAGS)
@cd csharp && $(MAKE) $* $(MFLAGS) --no-print-directory

.PHONY: cp_%
cp_%: LICENSE
@cd cplusplus && $(MAKE) $* $(MFLAGS)
@cd cplusplus && $(MAKE) $* $(MFLAGS) --no-print-directory

.PHONY: c_%
c_%: LICENSE
@cd c && $(MAKE) $* $(MFLAGS)
@cd c && $(MAKE) $* $(MFLAGS) --no-print-directory

.PHONY: docs_%
docs_%: LICENSE
@cd docs && $(MAKE) $* $(MFLAGS)
@cd docs && $(MAKE) $* $(MFLAGS) --no-print-directory

.PHONY: ja_%
ja_%: LICENSE
@cd java && $(MAKE) $* $(MFLAGS)
@cd java && $(MAKE) $* $(MFLAGS) --no-print-directory

.PHONY: js_%
js_%: LICENSE
@cd javascript && $(MAKE) $* $(MFLAGS)
@cd javascript && $(MAKE) $* $(MFLAGS) --no-print-directory

.PHONY: py_%
py_%: LICENSE
@cd python && $(MAKE) $* $(MFLAGS)
@cd python && $(MAKE) $* $(MFLAGS) --no-print-directory

.PHONY: rs_%
rs_%: LICENSE
@cd rust && $(MAKE) $* $(MFLAGS)
@cd rust && $(MAKE) $* $(MFLAGS) --no-print-directory

%:
@$(MAKE) c_$* cp_$* cs_$* ja_$* js_$* py_$* rs_$* $(MFLAGS)
@$(MAKE) c_$* cp_$* cs_$* ja_$* js_$* py_$* rs_$* $(MFLAGS) --no-print-directory
24 changes: 12 additions & 12 deletions c/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -25,40 +25,40 @@ help:

.PHONY: test_%
test_%: ../LICENSE submodules dependencies
cd ../python; $(MAKE) dependencies $(MFLAGS)
$(PY) -m pytest -dvl -n$* test_euler.py --cov
@cd ../python; $(MAKE) dependencies $(MFLAGS)
@$(PY) -m pytest -dvl -n$* test_euler.py --cov

.PHONY: test
test: ../LICENSE submodules dependencies
$(PY) -m pytest -vl --benchmark-sort=fullname --benchmark-group-by=fullfunc --benchmark-verbose test_euler.py --cov
@$(PY) -m pytest -vl --benchmark-sort=fullname --benchmark-group-by=fullfunc --benchmark-verbose test_euler.py --cov

.PHONY: submodules
submodules:
git submodule init
git submodule update
@git submodule init
@git submodule update

.PHONY: dependencies
dependencies: submodules
$(PIP) install -r requirements.txt -r ../python/requirements.txt $(USER_FLAG) $(PROXY_ARG)
@$(PIP) install -r requirements.txt -r ../python/requirements.txt $(USER_FLAG) $(PROXY_ARG)

.PHONY: lint
lint:
if test -z "$(clang-tidy src/p0000_template.c -warnings-as-errors=* 2>&1 | grep "Unknown command line argument")"; then \
@if test -z "$(clang-tidy src/p0000_template.c -warnings-as-errors=* 2>&1 | grep "Unknown command line argument")"; then \
clang-tidy src/*.c -warnings-as-errors=-clang-analyzer-security.insecureAPI.DeprecatedOrUnsafeBufferHandling; \
else \
clang-tidy src/*.c; \
fi

.PHONY: native
native: ../LICENSE submodules
$(CC) test.c Unity/src/unity.c -O2 -lm -lc -Wall -Werror -march=native -flto -DAMD_COMPILER=0
@$(CC) test.c Unity/src/unity.c -O2 -lm -lc -Wall -Werror -march=native -flto -DAMD_COMPILER=0

.PHONY: clean
clean:
rm -r build ./{*,*/*}{.pyc,__pycache__,.mypy_cache} || echo
@rm -rf build {.,*,*/*}/{*.pyc,__pycache__,.mypy_cache,.pytest_cache,.benchmarks} || echo

.PHONY: wasm
wasm: ../LICENSE submodules
wget https://github.com/jedisct1/libclang_rt.builtins-wasm32.a -O wasm32.a
mkdir -p build
clang -DUNITY_END --target=wasm32-unknown-wasi --sysroot /tmp/wasi-libc -nostartfiles -Wl,--import-memory -Wl,--no-entry -Wl,--export-all -o build/c.wasm test.c
@wget https://github.com/jedisct1/libclang_rt.builtins-wasm32.a -O wasm32.a
@mkdir -p build
@clang -DUNITY_END --target=wasm32-unknown-wasi --sysroot /tmp/wasi-libc -nostartfiles -Wl,--import-memory -Wl,--no-entry -Wl,--export-all -o build/c.wasm test.c
18 changes: 9 additions & 9 deletions cplusplus/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -24,34 +24,34 @@ help:

.PHONY: test_%
test_%: ../LICENSE dependencies
cd ../python; $(MAKE) dependencies $(MFLAGS)
$(PY) -m pytest -dvl -n$* test_euler.py --cov
@cd ../python; $(MAKE) dependencies $(MFLAGS)
@$(PY) -m pytest -dvl -n$* test_euler.py --cov

.PHONY: test
test: ../LICENSE dependencies
$(PY) -m pytest -vl --benchmark-sort=fullname --benchmark-group-by=fullfunc --benchmark-verbose test_euler.py --cov
@$(PY) -m pytest -vl --benchmark-sort=fullname --benchmark-group-by=fullfunc --benchmark-verbose test_euler.py --cov

.PHONY: submodules
submodules:
git submodule init
git submodule update
@git submodule init
@git submodule update

.PHONY: dependencies
dependencies:
$(PIP) install -r requirements.txt -r ../python/requirements.txt $(USER_FLAG) $(PROXY_ARG)
@$(PIP) install -r requirements.txt -r ../python/requirements.txt $(USER_FLAG) $(PROXY_ARG)

.PHONY: lint
lint:
if test -z "$(clang-tidy src/p0000_template.cpp -warnings-as-errors=* 2>&1 | grep "Unknown command line argument")"; then \
@if test -z "$(clang-tidy src/p0000_template.cpp -warnings-as-errors=* 2>&1 | grep "Unknown command line argument")"; then \
clang-tidy src/*.cpp -warnings-as-errors=-clang-analyzer-security.insecureAPI.DeprecatedOrUnsafeBufferHandling; \
else \
clang-tidy src/*.cpp; \
fi

.PHONY: native
native: ../LICENSE submodules
$(CXX) test.cpp Unity/src/unity.c -O2 -lm -Wall -Werror -std=c++11 -march=native -flto -DAMD_COMPILER=0 -Wno-deprecated
@$(CXX) test.cpp Unity/src/unity.c -O2 -lm -Wall -Werror -std=c++11 -march=native -flto -DAMD_COMPILER=0 -Wno-deprecated

.PHONY: clean
clean:
rm -r build ./{*,*/*}{.pyc,__pycache__,.mypy_cache} || echo
@rm -rf build {.,*,*/*}/{*.pyc,__pycache__,.mypy_cache,.pytest_cache,.benchmarks} || echo
12 changes: 6 additions & 6 deletions csharp/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -18,26 +18,26 @@ help:

.PHONY: clean
clean:
dotnet clean || rm ./*/{bin,obj,TestResults} || echo
@dotnet clean || rm -rf ./*/{bin,obj,TestResults} || echo

.PHONY: test
test: ../LICENSE
ifneq ($(NOT_TERMUX),0)
dotnet test --nologo $(cov_args)
@dotnet test --nologo $(cov_args)
endif

.PHONY: test_%
test_%: ../LICENSE
$(MAKE) test $(MFLAGS)
test_%:
@$(MAKE) test $(MFLAGS) --no-print-directory

.PHONY: dependencies
dependencies:
ifneq ($(NOT_TERMUX),0)
dotnet restore
@dotnet restore
endif

.PHONY: lint
lint:
ifneq ($(NOT_TERMUX),0)
dotnet format --verify-no-changes
@dotnet format --verify-no-changes
endif
46 changes: 11 additions & 35 deletions docs/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -27,50 +27,26 @@ help:

.PHONY: clean
clean:
rm -r _build _static/dist || echo
@rm -rf _build _static/dist || echo

.PHONY: dependencies
dependencies:
$(PIP) install -r requirements.txt -r ../c/requirements.txt -r ../python/requirements.txt --upgrade $(USER_FLAG) $(PROXY_ARG)
npm install -g jsdoc

_static/test-c.html:
cd ../c && $(MAKE) webpack $(MFLAGS)
mkdir -p _static/dist
cp ../c/dist/bundle-c.js _static/dist/bundle-c.js
cat _static/test-js.html | sed s#_static/bundle-js.js#_static/bundle-c.js > _static/test-c.html

_static/test-cp.html:
cd ../cplusplus && $(MAKE) webpack $(MFLAGS)
mkdir -p _static/dist
cp ../cplusplus/dist/bundle-cp.js _static/dist/bundle-cp.js
cat _static/test-js.html | sed s#_static/bundle-js.js#_static/bundle-cp.js > _static/test-cp.html

_static/test-cs.html:
cd ../csharp && $(MAKE) webpack $(MFLAGS)
mkdir -p _static/dist
cp ../csharp/dist/bundle-cs.js _static/dist/bundle-cs.js
cat _static/dist/test-js.html | sed s#_static/bundle-js.js#_static/bundle-cs.js > _static/test-cs.html
@$(PIP) install -r requirements.txt -r ../c/requirements.txt -r ../python/requirements.txt --upgrade $(USER_FLAG) $(PROXY_ARG)
@npm install -g jsdoc

_static/dist/bundle.js:
cd ../javascript && $(MAKE) webpack $(MFLAGS)
mkdir -p _static/dist
cp ../javascript/dist/bundle-js.js _static/dist/bundle-js.js
@cd ../javascript && $(MAKE) webpack $(MFLAGS)
@mkdir -p _static/dist
@cp ../javascript/dist/bundle-js.js _static/dist/bundle-js.js

_static/dist/python.tar.gz:
cd ../python && $(MAKE) webpack $(MFLAGS)

_static/test-rs.html:
cd ../rust && $(MAKE) webpack $(MFLAGS)
mkdir -p _static/dist
cp ../rust/dist/bundle-rs.js _static/dist/bundle-rs.js
cat _static/dist/test-js.html | sed s#_static/bundle-js.js#_static/bundle-rs.js > _static/test-rs.html
@cd ../python && $(MAKE) webpack $(MFLAGS)

.PHONY: html
html: ../LICENSE _static/dist/bundle.js _static/dist/python.tar.gz
$(SPHINXBUILD) -M html "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
html: _static/dist/bundle.js _static/dist/python.tar.gz
@$(SPHINXBUILD) -M html "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)

# Catch-all target: route all unknown targets to Sphinx using the new
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
%: ../LICENSE
$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
%:
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
10 changes: 5 additions & 5 deletions java/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -11,19 +11,19 @@ help:

.PHONY: clean
clean:
$(MVN) clean || echo "Maven not installed"
@$(MVN) clean || echo "Maven not installed"

.PHONY: test
test: ../LICENSE
$(MVN) -e test -Dtest.single
@$(MVN) -e test -Dtest.single

test_auto: ../LICENSE
$(MVN) -e test -T 1C
@$(MVN) -e test -T 1C

.PHONY: test_%
test_%: ../LICENSE
$(MVN) -e test -T $*
@$(MVN) -e test -T $*

.PHONY: lint
lint:
$(MVN) formatter:format
@$(MVN) formatter:format
63 changes: 34 additions & 29 deletions javascript/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -22,75 +22,80 @@ help:
@echo " $(BLUE)clean$(NC) clean up any stray files"

.PHONY: test
test: ../LICENSE dependencies
$(MOCHA) euler.test.js
test: ../LICENSE dependencies bun_test
@$(MOCHA) euler.test.js

test_auto: dependencies
$(MOCHA) --parallel euler.test.js
test_auto: dependencies bun_test
@$(MOCHA) --parallel euler.test.js

.PHONY: test_%
test_%: ../LICENSE dependencies
$(MOCHA) --parallel -j $* euler.test.js
test_%: ../LICENSE dependencies bun_test
@$(MOCHA) --parallel -j $* euler.test.js

.PHONY: bun_dependencies
bun_dependencies:
if ! command -v bun; then npm -g install bun; fi
bun install
ifeq ($(NOT_TERMUX),1)
ifneq ($(HAS_NPM),0)
@if ! command -v bun; then npm -g install bun; fi
endif
@bun install
endif

.PHONY: bun_test
bun_test: ../LICENSE bun_dependencies
ifeq ($(NOT_TERMUX),1)
ifeq ($(COV),true)
bun test --coverage --coverage-reporter lcov
@bun test --coverage --coverage-reporter lcov
else
bun test
@bun test
endif
endif

.PHONY: dependencies
ifneq ($(HAS_NPM),0)
ifeq ($(OS),Windows_NT) # if no NPM and Windows
dependencies:
1>&2 echo "Windows not yet supported"
exit /b -1
@1>&2 echo "Windows not yet supported"
@exit /b -1
else
ifeq ($(NOT_TERMUX),0) # if no NPM and Termux
dependencies:
pkg install -y nodejs;
$(MAKE) _dependencies $(MFLAGS)
@pkg install -y nodejs;
@$(MAKE) node_modules $(MFLAGS)
else # if no NPM and not Termux
dependencies:
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.34.0/install.sh | bash \
export NVM_DIR="$$HOME/.nvm"; \
[ -s "$$NVM_DIR/nvm.sh" ] && \. "$$NVM_DIR/nvm.sh" \
nvm install --lts
$(MAKE) _dependencies $(MFLAGS)
@curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.34.0/install.sh | bash \
@export NVM_DIR="$$HOME/.nvm"; \
@[ -s "$$NVM_DIR/nvm.sh" ] && \. "$$NVM_DIR/nvm.sh" \
@nvm install --lts
@$(MAKE) node_modules $(MFLAGS)
endif
endif
else # has NPM
dependencies: _dependencies
dependencies: node_modules
endif

.PHONY: _dependencies
_dependencies:
node_modules:
ifeq ($(COV),true)
npm install -g istanbul
@npm install -g istanbul
endif
npm install --include=dev
@npm install --include=dev

.PHONY: lint
lint: dependencies
npx eslint *.js src/*.js src/lib/*.js --ignore-pattern "dist/*"
@npx eslint *.js src/*.js src/lib/*.js --ignore-pattern "dist/*"

.PHONY: clean
clean:
rm -r node_modules dist src/lib/fallbacks || echo
@rm -rf node_modules dist src/lib/fallbacks || echo

.PHONY: webpack
webpack: ../LICENSE dependencies
mkdir -p src/lib/fallbacks
for f in ../_data/*; do \
@mkdir -p src/lib/fallbacks
@for f in ../_data/*; do \
bf=$$(echo $$f | sed "s/.*\///"); \
echo -n "exports.value = '" > ./src/lib/fallbacks/$$bf.js; \
base64 -w0 $$f | head --bytes -1 >> ./src/lib/fallbacks/$$bf.js; \
echo "';" >> ./src/lib/fallbacks/$$bf.js; \
done
npx webpack
@npx webpack
Loading

0 comments on commit f514856

Please sign in to comment.