Skip to content

Commit

Permalink
chore: use sentinel files in Makefile (#1125)
Browse files Browse the repository at this point in the history
  • Loading branch information
fubhy authored Oct 12, 2023
1 parent 3f40c0b commit d91720e
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ help: ## Describe useful make targets
> grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "%-30s %s\n", $$1, $$2}'

.PHONY: all
all: install format build ## Run install, format & build (default)
all: install build ## Run install & build (default)

.PHONY: install
install: ## Install all dependencies
Expand All @@ -45,10 +45,10 @@ install: ## Install all dependencies
build: artifacts interfaces ## Build all contract artifacts & interfaces

.PHONY: artifacts
artifacts: $(ARTIFACTS_DIR)/ ## Build all contract artifacts
artifacts: $(ARTIFACTS_DIR)/.sentinel ## Build all contract artifacts

.PHONY: interfaces
interfaces: $(INTERFACES_DIR)/ ## Generate interfaces for all contracts listed in interfaces.txt
interfaces: $(INTERFACES_DIR)/.sentinel ## Generate interfaces for all contracts listed in interfaces.txt

.PHONY: test
test: ## Run the entire test suite
Expand All @@ -68,14 +68,14 @@ clean: ## Remove all untracked files and directories and bust any caches
> $(GIT) clean -dfX --exclude !**/.env* --exclude !**/deployments --exclude !**/cache
> $(FORGE) clean

$(ARTIFACTS_DIR)/: Makefile $(shell find $(CONTRACTS_DIR) -type f -name "*.sol")
$(ARTIFACTS_DIR)/.sentinel: $(shell find $(CONTRACTS_DIR) -type f -name "*.sol")
> mkdir -p $(@D)
> # Remove this once the `forge build` command supports a more capable version of the `--skip` option.
> export FOUNDRY_TEST=this-directory-does-not-exist
> $(FORGE) build --sizes --extra-output-files abi
> touch $@

$(INTERFACES_DIR)/: Makefile $(INTERFACES_FILE) $(ARTIFACTS_DIR)/
$(INTERFACES_DIR)/.sentinel: $(INTERFACES_FILE) $(ARTIFACTS_DIR)/.sentinel
> mkdir -p $(@D)
>
> # Remove all existing interfaces and abis.
Expand Down

0 comments on commit d91720e

Please sign in to comment.