cic-contracts/Makefile

60 lines
1.4 KiB
Makefile
Raw Permalink Normal View History

2020-12-11 07:48:54 +01:00
# Author: Louis Holbrook <dev@holbrook.no> 0826EDA1702D1E87C6E2875121D2E7BB88C2A746
# SPDX-License-Identifier: GPL-3.0-or-later
2020-12-31 22:29:40 +01:00
# File-version: 5
2020-12-11 07:48:54 +01:00
2021-04-29 08:37:41 +02:00
INPUTS = $(wildcard solidity/*.sol)
2021-04-28 13:55:53 +02:00
OUTPUTS_JSON = $(patsubst %.sol, %.json, $(INPUTS))
OUTPUTS_INTERFACE = $(patsubst %.sol, %.interface, $(INPUTS))
2021-04-29 08:37:41 +02:00
OUTPUTS = $(OUTPUTS_JSON) $(OUTPUTS_INTERFACE)
PREFIX = $(DESTDIR)/usr/local/share/cic/solidity/abi
2020-12-11 07:48:54 +01:00
2020-12-31 22:29:40 +01:00
#%.abi.json: $(wildcard *.sol)
# install -vDm0644 $@ $(PREFIX)/$@
2020-12-11 07:48:54 +01:00
2021-04-28 13:55:53 +02:00
.SUFFIXES: .sol .json .interface
2020-12-11 11:30:10 +01:00
2020-12-31 22:29:40 +01:00
.sol.json:
solc $(basename $@).sol --abi | awk 'NR>3' > $@
2020-12-11 11:30:10 +01:00
2021-04-28 13:55:53 +02:00
.sol.interface:
bash to_interface.sh $(basename $@).sol > $@
2021-04-28 13:55:53 +02:00
all: outs doc
outs: $(OUTPUTS)
2021-04-29 08:37:41 +02:00
echo $(OUTPUTS)
2020-12-31 22:29:40 +01:00
install-code: $(OUTPUTS)
2020-12-31 22:29:40 +01:00
install -vDm0644 -t $(PREFIX) $?
2020-12-11 07:48:54 +01:00
install-doc:
bash texify.sh
install: outs install-code install-doc doc
2020-12-11 07:48:54 +01:00
clean:
2021-04-29 08:37:41 +02:00
rm -vf solidity/*.json
rm -vf solidity/*.interface
2020-12-11 07:48:54 +01:00
doc:
bash texify.sh
make -C doc/texinfo
readme:
make -C doc/texinfo readme
pandoc -f docbook -t gfm doc/texinfo/build/docbook.xml > README.md
2023-06-08 09:34:12 +02:00
cp -v README.md python/README.md
python-contract: outs
mkdir -vp python-contract-interfaces/cic_contracts/data
cp -v solidity/*.interface python-contract-interfaces/cic_contracts/data
cp -v solidity/*.json python-contract-interfaces/cic_contracts/data
make -C python-contract-interfaces
python-cic: python
python setup.py sdist
python: python-cic python-contract
2020-12-11 11:30:10 +01:00
.PHONY: clean install