Makefile 862 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  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. monero_token_list
  9. LISTS_JSON = $(LISTS:=.json)
  10. LISTS_MIN = $(LISTS:=.min.json)
  11. ERC20 = https://tokens.coingecko.com/uniswap/all.json
  12. SOL = https://github.com/solana-labs/token-list/raw/main/src/tokens/solana.tokenlist.json
  13. all: $(LISTS_MIN)
  14. .json.min.json:
  15. jq -r -c '.' < $< > $@
  16. darkfi_token_list.json:
  17. git checkout -- $@
  18. bitcoin_token_list.json:
  19. git checkout -- $@
  20. monero_token_list.json:
  21. git checkout -- $@
  22. erc20_token_list.json:
  23. $(DLTOOL) $(ERC20) | jq -r > $@
  24. solana_token_list.json:
  25. $(DLTOOL) $(SOL) | sed \
  26. -e 's@"symbol": "BTC"@"symbol": "SBTC"@' \
  27. -e 's@"symbol": "ETH"@"symbol": "SETH"@' \
  28. | jq -r > $@
  29. clean:
  30. rm -f $(LISTS_JSON) $(LISTS_MIN)
  31. .SUFFIXES: .json .min.json
  32. .PHONY: all