Skip to content

Commit

Permalink
More Makefile compression
Browse files Browse the repository at this point in the history
  • Loading branch information
LivInTheLookingGlass committed Sep 26, 2024
1 parent 15d09b2 commit b29a707
Show file tree
Hide file tree
Showing 8 changed files with 27 additions and 52 deletions.
7 changes: 3 additions & 4 deletions c/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ PIP?=$(PY) -m pip
BLUE=\033[0;34m
NC=\033[0m # No Color
O?=2
COV?=false

ifneq ($(https_proxy), )
PROXY_ARG=--proxy=$(https_proxy)
Expand All @@ -15,11 +16,9 @@ PROXY_ARG=
endif
endif

COV?=false
ifneq ($(COV),false)
pytest_args= -vl --benchmark-sort=fullname --benchmark-group-by=fullfunc --benchmark-verbose --cov
else
pytest_args= -vl --benchmark-sort=fullname --benchmark-group-by=fullfunc --benchmark-verbose
ifneq ($(COV),false)
pytest_args+= --cov
endif

.PHONY: help
Expand Down
7 changes: 2 additions & 5 deletions cplusplus/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,12 @@ PIP?=$(PY) -m pip
BLUE=\033[0;34m
NC=\033[0m # No Color
O?=2
PROXY_ARG=

ifneq ($(https_proxy), )
PROXY_ARG=--proxy=$(https_proxy)
else
ifneq ($(http_proxy), )
else ifneq ($(http_proxy), )
PROXY_ARG=--proxy=$(http_proxy)
else
PROXY_ARG=
endif
endif

.PHONY: help
Expand Down
4 changes: 2 additions & 2 deletions csharp/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@ NOT_TERMUX?=$(shell command -v termux-setup-storage > /dev/null 2>&1 ; echo $$?)
BLUE=\033[0;34m
NC=\033[0m # No Color
COV?=false
cov_args=

ifeq ($(COV),true)
cov_args= --collect:"XPlat Code Coverage" -- DataCollectionRunSettings.DataCollectors.DataCollector.Configuration.IncludeTestAssembly=true
else
cov_args=
endif

.PHONY: help
Expand Down
14 changes: 3 additions & 11 deletions docs/Makefile
Original file line number Diff line number Diff line change
@@ -1,26 +1,18 @@
# Minimal makefile for Sphinx documentation
#

# You can set these variables from the command line, and also
# from the environment for the first two.
SPHINXOPTS ?= -j auto
SPHINXBUILD ?= sphinx-build
SOURCEDIR = .
BUILDDIR = _build
PY?=python3
USER_FLAG?=--user
PIP?=$(PY) -m pip
PROXY_ARG=

ifneq ($(https_proxy), )
PROXY_ARG=--proxy=$(https_proxy)
else
ifneq ($(http_proxy), )
else ifneq ($(http_proxy), )
PROXY_ARG=--proxy=$(http_proxy)
else
PROXY_ARG=
endif
endif

# Put it first so that "make" without argument is like "make help".
.PHONY: help
help:
@$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
Expand Down
5 changes: 2 additions & 3 deletions fortran/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,10 @@ else
opt_args = -Wall -Werror -march=native -flto -J$(BUILD_DIR)
endif

cov_args=
ifneq ($(COV),false)
cov_args= -fprofile-arcs -ftest-coverage -O0
else ifeq ($(FC),lfortran)
cov_args=
else
else ifneq ($(FC),lfortran)
cov_args= -O2
endif

Expand Down
10 changes: 4 additions & 6 deletions java/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -14,18 +14,16 @@ help:
clean:
@$(MVN) clean || echo

target/jacoco.exec: ../LICENSE
@$(MVN) $(MVN_FLAGS) test -Dtest.single

.PHONY: test
test: target/jacoco.exec
test:
@$(MVN) $(MVN_FLAGS) test -Dtest.single

test_auto: target/jacoco.exec
.PHONY: test_auto
test_auto:
@$(MVN) $(MVN_FLAGS) test -T 1C

.PHONY: test_%
test_%: target/jacoco.exec
test_%:
@$(MVN) $(MVN_FLAGS) test -T $*

.PHONY: lint
Expand Down
7 changes: 3 additions & 4 deletions javascript/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,13 @@ NOT_TERMUX?=$(shell command -v termux-setup-storage > /dev/null 2>&1 ; echo $$?)
HAS_NPM?=$(shell command -v npm > /dev/null 2>&1 ; echo $$?)
HAS_BUN?=$(shell command -v bun > /dev/null 2>&1 ; echo $$?)
COV?=false
BLUE=\033[0;34m
NC=\033[0m # No Color
MOCHA=npx mocha

ifeq ($(COV),true)
MOCHA=istanbul cover ./node_modules/mocha/bin/_mocha
else
MOCHA=npx mocha
endif
BLUE=\033[0;34m
NC=\033[0m # No Color

.PHONY: help
help:
Expand Down
25 changes: 8 additions & 17 deletions python/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -4,42 +4,34 @@ USER_FLAG?=--user
PIP?=$(PY) -m pip
MYPY?=true
COV?=false
BLUE=\033[0;34m
NC=\033[0m # No Color
benchmark_flags=--benchmark-min-time=0.05 --benchmark-sort=fullname --benchmark-group-by=fullfunc --benchmark-verbose

ifneq ($(MYPY),true)
LINT=less
endif

benchmark_flags=--benchmark-min-time=0.05 --benchmark-sort=fullname --benchmark-group-by=fullfunc --benchmark-verbose

ifeq ($(LINT),false)
pytest_args?= -vl
else
ifeq ($(LINT),true)
else ifeq ($(LINT),true)
pytest_args?= -vl --mypy --mypy-ignore-missing-imports --isort --flake8 -k 'not test_problem and not test_is_prime and not test_groupwise'
else
ifeq ($(LINT),less)
else ifeq ($(LINT),less)
pytest_args?= -vl --isort
else
pytest_args?= -vl --mypy --mypy-ignore-missing-imports --isort --flake8
endif
endif
endif

ifeq ($(COV),true)
pytest_args+= --cov
endif

PROXY_ARG=
ifneq ($(https_proxy), )
PROXY_ARG=--proxy=$(https_proxy)
else
ifneq ($(http_proxy), )
else ifneq ($(http_proxy), )
PROXY_ARG=--proxy=$(http_proxy)
else
PROXY_ARG=
endif
endif
BLUE=\033[0;34m
NC=\033[0m # No Color

.PHONY: help
help:
Expand All @@ -57,11 +49,10 @@ test_%: ../LICENSE dependencies
@$(PY) -m pytest $(pytest_args) -d -n$*

.PHONY: dependencies
ifeq ($(MYPY),true)
dependencies:
ifeq ($(MYPY),true)
@$(PIP) install -r requirements.txt $(USER_FLAG) $(PROXY_ARG)
else
dependencies:
@cat requirements.txt | grep -v "mypy" > .requirements.txt
@$(PIP) install -r .requirements.txt $(USER_FLAG) $(PROXY_ARG)
endif
Expand Down

0 comments on commit b29a707

Please sign in to comment.