Skip to content

Commit

Permalink
Merge pull request #3801 from JacquesCarette/fixDebugTarget
Browse files Browse the repository at this point in the history
Makefile: Permit per-example debugging
  • Loading branch information
JacquesCarette authored Jun 14, 2024
2 parents 3b2ff09 + 2bc05fb commit 5feb1c6
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions code/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ STABILIZE_E_SUFFIX = _stabilize
BC_E_SUFFIX = _build_clean
TRACE_GRAPH_SUFFIX = _trace_graph
INSTALL_E_SUFFIX = _install
DEBUG_E_SUFFIX = _debug

# add example names with the appropriate suffixes to create per-example targets
GEN_EXAMPLES = $(addsuffix $(GEN_E_SUFFIX), $(EXAMPLES))
Expand All @@ -86,6 +87,7 @@ STABILIZE_EXAMPLES = $(addsuffix $(STABILIZE_E_SUFFIX), $(EXAMPLES))
BC_EXAMPLES = $(addsuffix $(BC_E_SUFFIX), $(EXAMPLES))
TRACE_GRAPH_EXAMPLES = $(addsuffix $(TRACE_GRAPH_SUFFIX), $(EXAMPLES))
INSTALL_EXAMPLES = $(addsuffix $(INSTALL_E_SUFFIX), $(EXAMPLES))
DEBUG_EXAMPLES = $(addsuffix $(DEBUG_E_SUFFIX), $(EXAMPLES))

# Website names with appropriate suffixes.
TEST_WEBSITE = $(addsuffix $(TEST_E_SUFFIX), $(WEBSITE_FOLDER_NAME))
Expand Down Expand Up @@ -183,11 +185,14 @@ all: test test_website ##@Examples Run examples and test against stable.
install: ##@Examples Install all example project binaries into your local binary path (see $(stack path) for local-bin-path).
stack install $(stackArgs)

debug: stackArgs += $(PROFALL)
debug: STACK_EXEC += $(PROFEXEC)
debug: export DEBUG_ENV=1
%debug: stackArgs += $(PROFALL)
%debug: STACK_EXEC += $(PROFEXEC)
%debug: export DEBUG_ENV=1
debug: test ##@Examples Run test target with better debugging tools.

# Debugging individual examples
$(DEBUG_EXAMPLES): %$(DEBUG_E_SUFFIX): %$(TEST_E_SUFFIX)

pr_ready: all hot_hlint ##@General Check if your current work is ready to for a PR via `all` and `hot_hlint`.
- echo "Your build/ and stable/ match, and your code currently passes HLint tests."
- echo "Feel free to create a PR for your code if you feel it's ready."
Expand Down Expand Up @@ -525,6 +530,7 @@ help: ##@Help Show this help.
@echo "Example-specific targets where X is the example. Run \"make help_examples\" to see a list of possible examples:"
@echo " X$(GEN_E_SUFFIX) Generate individual example in HTML and LaTeX format."
@echo " X$(TEST_E_SUFFIX) Generate individual example and create a comparison against stable in the log folder."
@echo " X$(DEBUG_E_SUFFIX) $(TEST_E_SUFFIX), but in debug mode."
@echo " X$(INSTALL_E_SUFFIX) Install individual example executable(s) into your local binary path."
@echo " X$(STABILIZE_E_SUFFIX) Generate individual example and overwrite the contents of stable with the new version."
@echo " X$(TEX_E_SUFFIX) Generate individual example as a PDF (from LaTeX files)."
Expand Down

0 comments on commit 5feb1c6

Please sign in to comment.