cic-contracts/Makefile
2024-08-01 22:18:03 +01:00

60 lines
1.4 KiB
Makefile

# Author: Louis Holbrook <dev@holbrook.no> 0826EDA1702D1E87C6E2875121D2E7BB88C2A746
# SPDX-License-Identifier: GPL-3.0-or-later
# File-version: 5
INPUTS = $(wildcard solidity/*.sol)
OUTPUTS_JSON = $(patsubst %.sol, %.json, $(INPUTS))
OUTPUTS_INTERFACE = $(patsubst %.sol, %.interface, $(INPUTS))
OUTPUTS = $(OUTPUTS_JSON) $(OUTPUTS_INTERFACE)
PREFIX = $(DESTDIR)/usr/local/share/cic/solidity/abi
#%.abi.json: $(wildcard *.sol)
# install -vDm0644 $@ $(PREFIX)/$@
.SUFFIXES: .sol .json .interface
.sol.json:
solc $(basename $@).sol --abi | awk 'NR>3' > $@
.sol.interface:
bash to_interface.sh $(basename $@).sol > $@
all: outs doc
outs: $(OUTPUTS)
echo $(OUTPUTS)
install-code: $(OUTPUTS)
install -vDm0644 -t $(PREFIX) $?
install-doc:
bash texify.sh
install: outs install-code install-doc doc
clean:
rm -vf solidity/*.json
rm -vf solidity/*.interface
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
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
.PHONY: clean install