A lot better makefile

This commit is contained in:
nolash
2020-12-11 18:04:32 +01:00
parent 69bafdadcf
commit 75561cebfa
20 changed files with 12 additions and 17 deletions

View File

@@ -3,20 +3,23 @@
# File-version: 4
INPUTS = $(wildcard *.sol)
OUTPUTS = $(patsubst %.sol, %.json, $(INPUTS))
PREFIX = /usr/local/share/cic/solidity/abi
%.abi.json: $(wildcard *.sol)
install -vDm0644 $@ $(PREFIX)/$@
#%.abi.json: $(wildcard *.sol)
# install -vDm0644 $@ $(PREFIX)/$@
%.sol:
solc $@ --abi | awk 'NR>3' > $(basename $@).abi.json
.SUFFIXES: .sol .json
# TODO: improve, does not detect changes in sol files (I suck at writing makefiles)
all: $(INPUTS)
.sol.json:
solc $@ --abi | awk 'NR>3' > $(basename $@).json
install: $(wildcard *.abi.json)
all: $(OUTPUTS)
install: $(OUTPUTS)
install -vDm0644 -t $(PREFIX) $?
clean:
rm -vf *.abi.json
rm -vf *.json
.PHONY: clean install