override RTS_OPTIONS += -L100
override TEST_OPTIONS += --color always --size-cutoff 1000000 $(addprefix -p ,$t)
-override GHC_PROF_OPTIONS += -fprof-auto -fprof-auto-calls
+override GHC_PROF_OPTIONS += -eventlog -fprof-auto -fprof-auto-calls
override BENCHMARK_OPTIONS += --output benchmarks/html/$(version).html --match glob $b
override REPL_OPTIONS += -ignore-dot-ghci
all: build
build:
- cabal build
+ cabal build $(CABAL_BUILD_FLAGS)
clean c:
cabal clean
repl:
- cabal repl $(project)
+ cabal repl $(CABAL_REPL_FLAGS) $(project)
ghcid:
- ghcid -c 'cabal repl $(project) --repl-options "$(REPL_OPTIONS)"' --reverse-errors
+ ghcid -c 'cabal repl $(CABAL_REPL_FLAGS) $(project) --repl-options "$(REPL_OPTIONS)"' --reverse-errors
.PHONY: parsers
parsers:
- cabal build $(project):parsers
+ cabal build $(CABAL_BUILD_FLAGS) $(project):parsers
parsers/repl:
- cabal repl $(project):parsers
+ cabal repl $(CABAL_REPL_FLAGS) $(project):parsers
parsers/ghcid:
- ghcid -c 'cabal repl $(project):parsers --repl-options "$(REPL_OPTIONS)"' --reverse-errors
+ ghcid -c 'cabal repl $(CABAL_REPL_FLAGS) $(project):parsers --repl-options "$(REPL_OPTIONS)"' --reverse-errors
parsers/prof-th:
cabal v2-build lib:$(project) --enable-profiling $(GHC_PROF_OPTIONS) --write-ghc-environment-files=always
- cabal build $(project):parsers $(CABAL_BUILD_FLAGS) \
+ cabal build $(CABAL_BUILD_FLAGS) $(project):parsers \
--enable-profiling $(GHC_PROF_OPTIONS) \
--ghc-options "$(addprefix -opti,+RTS $(RTS_OPTIONS))"
.PHONY: tests
-tests:
+t tests:
cabal test $(CABAL_TEST_FLAGS) \
--test-show-details always --test-options "$(TEST_OPTIONS)"
tests/prof-time: $(project)-test.eventlog.json
--enable-profiling $(GHC_PROF_OPTIONS) \
--ghc-options "$(addprefix -opti,+RTS $(RTS_OPTIONS))"
tests/repl:
- cabal repl --enable-tests $(project)-test
+ cabal repl $(CABAL_REPL_FLAGS) --enable-tests $(project)-test
+tests/ghcid:
+ ghcid -c 'cabal repl $(CABAL_REPL_FLAGS) $(project):tests --test-options "$(TEST_OPTIONS)"' --reverse-errors
%/accept: TEST_OPTIONS += --accept
%/accept: %
mkdir -p benchmarks/html
cabal bench $(CABAL_BENCH_FLAGS) --benchmark-options "$(BENCHMARK_OPTIONS)"
benchmarks/repl:
- cabal repl --enable-benchmarks $(project)-benchmark
+ cabal repl $(CABAL_REPL_FLAGS) --enable-benchmarks $(project)-benchmark
benchmarks/prof-time: $(project)-benchmark.eventlog.json
benchmarks/prof-heap: $(project)-benchmark.eventlog.html
.PHONY: $(project)-benchmark.eventlog
nix-relock:
nix flake update --recreate-lock-file
nix-repl:
- nix -L develop --command cabal repl
+ nix -L develop --command cabal repl $(CABAL_REPL_FLAGS)
nix-shell:
nix -L develop
-
-.PHONY: debug-ppr
-debug-ppr: debug-ppr/PprSplice.hs debug-ppr/AutoSplice.hs
-debug-ppr/PprSplice.hs.ppr: parsers/Parsers/Brainfuck/SymanticParser/PprSplice.hs.ppr Makefile
- mkdir -p $(@D)
- sed $< >$@ -e '1s/^/parser = /' -e 's/\x00//g'
-debug-ppr/AutoSplice.dump-splices: dist-newstyle/build/x86_64-linux/ghc-9.0.1/symantic-parser-$(version)/l/parsers/build/parsers/parsers/Parsers/Brainfuck/SymanticParser/AutoSplice.dump-splices Makefile
- mkdir -p $(@D)
- sed $< >$@ -e '1,/^ ======>/d;' -e '4s/^/parser = /' -e 's/\x00//g'
-%.hs: %.hs.ppr
- ormolu -m stdout >$@ -o -XBangPatterns -o -XUnboxedTuples -o -XMagicHash -o -XTypeApplications -o -XUnboxedTuples <$<
- #sed -i $@ -e 'N;s/\n\s*#)/ #)/;P;D'
-%.hs: %.dump-splices
- ormolu -m stdout >$@ -o -XBangPatterns -o -XUnboxedTuples -o -XMagicHash -o -XTypeApplications -o -XUnboxedTuples <$<
- #sed -i $@ -e 'N;s/\n\s*#)/ #)/;P;D'