Makefile 726 B

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