Makefile 792 B

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. .POSIX:
  2. DLTOOL = wget -nv --show-progress -O-
  3. LISTS = \
  4. darkfi_token_list \
  5. bitcoin_token_list \
  6. erc20_token_list \
  7. solana_token_list
  8. LISTS_JSON = $(LISTS:=.json)
  9. LISTS_MIN = $(LISTS:=.min.json)
  10. ERC20 = https://tokens.coingecko.com/uniswap/all.json
  11. SOL = https://github.com/solana-labs/token-list/raw/main/src/tokens/solana.tokenlist.json
  12. all: $(LISTS_MIN)
  13. .json.min.json:
  14. jq -r -c < $< > $@
  15. darkfi_token_list.json:
  16. git checkout -- $@
  17. bitcoin_token_list.json:
  18. git checkout -- $@
  19. erc20_token_list.json:
  20. $(DLTOOL) $(ERC20) | jq -r > $@
  21. solana_token_list.json:
  22. $(DLTOOL) $(SOL) | sed \
  23. -e 's@"symbol": "BTC"@"symbol": "SBTC"@' \
  24. -e 's@"symbol": "ETH"@"symbol": "SETH"@' \
  25. | jq -r > $@
  26. clean:
  27. rm -f $(LISTS_JSON) $(LISTS_MIN)
  28. .SUFFIXES: .json .min.json
  29. .PHONY: all