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-11 16:09:35 +01:00
|
|
|
# File-version: 4
|
2020-12-11 07:48:54 +01:00
|
|
|
|
|
|
|
INPUTS = $(wildcard *.sol)
|
2020-12-11 11:30:10 +01:00
|
|
|
PREFIX = /usr/local/share/cic/solidity/abi
|
2020-12-11 07:48:54 +01:00
|
|
|
|
2020-12-11 16:09:35 +01:00
|
|
|
%.abi.json: $(wildcard *.sol)
|
2020-12-11 11:30:10 +01:00
|
|
|
install -vDm0644 $@ $(PREFIX)/$@
|
2020-12-11 07:48:54 +01:00
|
|
|
|
2020-12-11 11:30:10 +01:00
|
|
|
%.sol:
|
2020-12-11 16:09:35 +01:00
|
|
|
solc $@ --abi | awk 'NR>3' > $(basename $@).abi.json
|
2020-12-11 11:30:10 +01:00
|
|
|
|
|
|
|
# TODO: improve, does not detect changes in sol files (I suck at writing makefiles)
|
|
|
|
all: $(INPUTS)
|
|
|
|
|
2020-12-11 16:09:35 +01:00
|
|
|
install: $(wildcard *.abi.json)
|
2020-12-11 07:48:54 +01:00
|
|
|
|
|
|
|
clean:
|
2020-12-11 16:09:35 +01:00
|
|
|
rm -vf *.abi.json
|
2020-12-11 07:48:54 +01:00
|
|
|
|
2020-12-11 11:30:10 +01:00
|
|
|
.PHONY: clean install
|