Skip to content

Commit

Permalink
Add help to Makefile
Browse files Browse the repository at this point in the history
  • Loading branch information
LivInTheLookingGlass committed Jul 11, 2024
1 parent aa76777 commit 2b6e2e6
Show file tree
Hide file tree
Showing 6 changed files with 78 additions and 3 deletions.
36 changes: 33 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,7 +1,37 @@
PY?=python3
PROXY?=

html dirhtml singlehtml htmlhelp qthelp devhelp epub applehelp latex man texinfo text gettext doctest linkcheck xml pseudoxml:
BLUE=\033[0;34m
NC=\033[0m # No Color

help:
@echo "This project has a number of recipes that are delegated to other Makefiles. The following jobs are available with no prefix"
@echo " $(BLUE)clean$(NC)"
@echo " $(BLUE)html$(NC)"
@echo " $(BLUE)dirhtml$(NC)"
@echo " $(BLUE)singlehtml$(NC)"
@echo " $(BLUE)epub$(NC)"
@echo " $(BLUE)latex$(NC)"
@echo
@echo "The following jobs are available under the docs_ prefix"
@$(MAKE) docs_help $(MFLAGS) --no-print-directory
@echo
@echo "The following jobs are available under the c_ prefix"
@$(MAKE) c_help $(MFLAGS) --no-print-directory
@echo
@echo "The following jobs are available under the cs_ prefix"
@$(MAKE) cs_help $(MFLAGS) --no-print-directory
@echo
@echo "The following jobs are available under the js_ prefix"
@$(MAKE) js_help $(MFLAGS) --no-print-directory
@echo
@echo "The following jobs are available under the py_ prefix"
@$(MAKE) py_help $(MFLAGS) --no-print-directory
@echo
@echo "The following jobs are available under the rs_ prefix"
@$(MAKE) rs_help $(MFLAGS) --no-print-directory


html dirhtml singlehtml epub latex:
@$(MAKE) docs_$@ $(MFLAGS)

clean: cs_clean c_clean js_clean py_clean rs_clean docs_clean
Expand All @@ -25,4 +55,4 @@ rs_%:
@cd rust && $(MAKE) $* $(MFLAGS)

%:
@$(MAKE) {c,cs,js,py,rs}_$* $(MFLAGS)
@$(MAKE) c_$* cs_$* js_$* py_$* rs_$* $(MFLAGS)
10 changes: 10 additions & 0 deletions c/Makefile
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
PY?=python3
USER_FLAG?=--user
PIP?=$(PY) -m pip
BLUE=\033[0;34m
NC=\033[0m # No Color

ifneq ($(https_proxy), )
PROXY_ARG=--proxy=$(https_proxy)
Expand All @@ -12,6 +14,14 @@ PROXY_ARG=
endif
endif

help:
@echo " $(BLUE)test$(NC) run through all tests in sequence. Utilizes the Python test runner infrastructure"
@echo " $(BLUE)test_*$(NC) run through all tests in parallel with the given number of threads. Use auto to allow the test runner to determine it. Utilizes the Python test runner infrastructure"
@echo " $(BLUE)dependencies$(NC) initialize submodules and install any Python dependencies"
@echo " $(BLUE)lint$(NC) run clang-tidy across each of the .c and .h files"
@echo " $(BLUE)native$(NC) build a test binary utilizing the Unity test framework"
@echo " $(BLUE)clean$(NC) clean up any stray files"

test_%: dependencies
cd ../python; $(MAKE) dependencies $(MFLAGS)
$(PY) -m pytest -vl -n$* test_euler.py --cov
Expand Down
10 changes: 10 additions & 0 deletions csharp/Makefile
Original file line number Diff line number Diff line change
@@ -1,3 +1,13 @@
BLUE=\033[0;34m
NC=\033[0m # No Color

help:
@echo " $(BLUE)test$(NC) run through all tests in sequence. Utilizes the Xunit framework"
@echo " $(BLUE)test_*$(NC) run through all tests in parallel with the given number of threads. Use auto to allow the test runner to determine it. Utilizes the Xunit framework"
@echo " $(BLUE)dependencies$(NC) runs dotnet restore"
@echo " $(BLUE)lint$(NC) runs dotnet format --verify-no-changes"
@echo " $(BLUE)clean$(NC) clean up any stray files"

clean:
dotnet clean || rm ./*/{bin,obj,TestResults} || echo

Expand Down
9 changes: 9 additions & 0 deletions javascript/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,15 @@ MOCHA=istanbul cover ./node_modules/mocha/bin/_mocha
else
MOCHA=npx mocha
endif
BLUE=\033[0;34m
NC=\033[0m # No Color

help:
@echo " $(BLUE)test$(NC) run through all tests in sequence. Utilizes the Mocha test runner"
@echo " $(BLUE)test_*$(NC) run through all tests in parallel with the given number of threads. Use auto to allow the test runner to determine it. Utilizes the Mocha test runner"
@echo " $(BLUE)dependencies$(NC) runs npm install"
@echo " $(BLUE)lint$(NC) runs eslint"
@echo " $(BLUE)clean$(NC) clean up any stray files"

test: dependencies
$(MOCHA)
Expand Down
8 changes: 8 additions & 0 deletions python/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,14 @@ else
PROXY_ARG=
endif
endif
BLUE=\033[0;34m
NC=\033[0m # No Color

help:
@echo " $(BLUE)test$(NC) run through all tests in sequence. Utilizes the pytest test runner infrastructure"
@echo " $(BLUE)test_*$(NC) run through all tests in parallel with the given number of threads. Use auto to allow the test runner to determine it. Utilizes the pytest runner"
@echo " $(BLUE)dependencies$(NC) grabs all dependencies through pip"
@echo " $(BLUE)clean$(NC) clean up any stray files"

test: dependencies _test
$(PY) -m pytest $(pytest_args) $(benchmark_flags)
Expand Down
8 changes: 8 additions & 0 deletions rust/Makefile
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
BLUE=\033[0;34m
NC=\033[0m # No Color

help:
@echo " $(BLUE)test$(NC) run through all tests in sequence."
@echo " $(BLUE)test_*$(NC) run through all tests in parallel with the given number of threads. Use auto to allow the test runner to determine it"
@echo " $(BLUE)clean$(NC) clean up any stray files"

test:
cargo test

Expand Down

0 comments on commit 2b6e2e6

Please sign in to comment.