-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add Makefile target for building AGC binary for running tests
Add a Makefile target that calls `make autonity` in the autonity repository to build the AGC binary.
- Loading branch information
Showing
2 changed files
with
25 additions
and
8 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,7 +1,8 @@ | ||
VERSION := $(shell cat AUTONITY_VERSION) | ||
AUTONITY := build/autonity | ||
ABIDIR := $(AUTONITY)/params/generated | ||
SRCDIR := $(AUTONITY)/autonity/solidity/contracts | ||
AUTONITY_DIR := build/autonity | ||
AUTONITY_BIN := $(AUTONITY_DIR)/build/bin/autonity | ||
ABIDIR := $(AUTONITY_DIR)/params/generated | ||
SRCDIR := $(AUTONITY_DIR)/autonity/solidity/contracts | ||
OUTDIR := autonity/contracts | ||
|
||
abigen = hatch run generate:pyabigen \ | ||
|
@@ -10,6 +11,7 @@ abigen = hatch run generate:pyabigen \ | |
--devdoc $(word 2,$(1)) \ | ||
--userdoc $(word 3,$(1)) \ | ||
$(word 4,$(1)) | ||
|
||
gentargets = $(shell find $(SRCDIR) -name $(1).sol) \ | ||
$(addprefix $(ABIDIR)/$(1),.docdev .docuser .abi) \ | ||
pyproject.toml | ||
|
@@ -55,16 +57,24 @@ $(OUTDIR)/supply_control.py: $(call gentargets,SupplyControl) | |
$(OUTDIR)/upgrade_manager.py: $(call gentargets,UpgradeManager) | ||
$(call abigen,$^) --exclude setOperator >$@ | ||
|
||
$(ABIDIR)/%.abi $(ABIDIR)/%.docdev $(ABIDIR)/%.docuser: $(AUTONITY) AUTONITY_VERSION | ||
$(ABIDIR)/%.abi $(ABIDIR)/%.docdev $(ABIDIR)/%.docuser: $(AUTONITY_DIR) AUTONITY_VERSION | ||
cd $< && \ | ||
git fetch origin && \ | ||
git checkout $(VERSION) && \ | ||
git checkout -d $(VERSION) && \ | ||
make contracts | ||
|
||
$(AUTONITY): | ||
$(AUTONITY_BIN): $(AUTONITY_DIR) AUTONITY_VERSION | ||
cd $< && \ | ||
git fetch origin && \ | ||
git checkout -d $(VERSION) && \ | ||
make autonity | ||
|
||
$(AUTONITY_DIR): | ||
git clone [email protected]:autonity/autonity.git $@ | ||
|
||
autonity: $(AUTONITY_BIN) | ||
|
||
clean: | ||
rm -rf $(AUTONITY) | ||
rm -rf $(AUTONITY_DIR) | ||
|
||
.PHONY = clean | ||
.PHONY = autonity clean |
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