This repository has been archived by the owner on Aug 3, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 239
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Makefile: Rework for use by haddock developers
Previously the Makefile was present only for GHC's old make-based build system. Now since the make-based build system is gone we can use it for more useful ends.
- Loading branch information
Showing
1 changed file
with
37 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,37 @@ | ||
# ----------------------------------------------------------------------------- | ||
# | ||
# (c) 2009 The University of Glasgow | ||
# | ||
# This file is part of the GHC build system. | ||
# | ||
# To understand how the build system works and how to modify it, see | ||
# http://ghc.haskell.org/trac/ghc/wiki/Building/Architecture | ||
# http://ghc.haskell.org/trac/ghc/wiki/Building/Modifying | ||
# | ||
# ----------------------------------------------------------------------------- | ||
|
||
dir = utils/haddock | ||
TOP = ../.. | ||
include $(TOP)/mk/sub-makefile.mk | ||
clean: ## Remove compilation artifacts | ||
@cabal clean | ||
|
||
repl: ## Start a REPL | ||
@cabal repl | ||
|
||
test: ## Run the test suite | ||
@cabal test | ||
|
||
lint: ## Run the code linter (HLint) | ||
@find driver haddock-api haddock-library haddock-test hoogle-test hypsrc-test latex-test \ | ||
-name "*.hs" | xargs -P $(PROCS) -I {} hlint --refactor-options="-i" --refactor {} | ||
|
||
style: ## Run the code styler (fourmolu and cabal-fmt) | ||
@cabal-fmt -i **/*.cabal | ||
@fourmolu -q --mode inplace driver haddock-api haddock-library | ||
|
||
style-check: ## Check the code's style (fourmolu and cabal-fmt) | ||
@cabal-fmt -i **/*.cabal | ||
@fourmolu -q --mode check driver haddock-api haddock-library | ||
|
||
style-quick: ## Run the code styler on modified files | ||
@cabal-fmt -i **/*.cabal | ||
@git diff origin --name-only driver haddock-api haddock-library | xargs -P $(PROCS) -I {} fourmolu -q -i {} | ||
|
||
tags: ## Generate ctags and etags for the source code (ghc-tags) | ||
@ghc-tags -e -c | ||
|
||
help: ## Display this help message | ||
@grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | awk 'BEGIN {FS = ":.* ?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}' | ||
|
||
PROCS := $(shell nproc) | ||
|
||
.PHONY: all $(MAKECMDGOALS) | ||
|
||
.DEFAULT_GOAL := help | ||
|