cabal.mk 829 B

123456789101112131415161718192021222324252627
  1. CABAL=cabal
  2. CABAL_VERSION := $(shell $(CABAL) --numeric-version | cut -d. -f1-2)
  3. # Amazing hack to do =< comparison (due to https://stackoverflow.com/questions/3437160).
  4. # Relies on there being no cabal 2.10.x or above.
  5. ifeq ("2.4","$(word 1,$(sort 2.4 $(CABAL_VERSION)))")
  6. CABAL_BUILD_CMD=v1-build
  7. CABAL_CLEAN_CMD=v1-clean
  8. CABAL_CONFIGURE_CMD=v1-configure
  9. CABAL_HADDOCK_CMD=v1-haddock
  10. CABAL_INSTALL_CMD=v1-install
  11. CABAL_OLD_BUILD_CMD=$(CABAL_BUILD_CMD)
  12. CABAL_OLD_INSTALL_CMD=$(CABAL_INSTALL_CMD)
  13. CABAL_OLD_CONFIGURE_CMD=$(CABAL_CONFIGURE_CMD)
  14. else
  15. CABAL_BUILD_CMD=build
  16. CABAL_CLEAN_CMD=clean
  17. CABAL_CONFIGURE_CMD=configure
  18. CABAL_HADDOCK_CMD=haddock
  19. CABAL_INSTALL_CMD=install
  20. CABAL_OLD_BUILD_CMD=$(CABAL_BUILD_CMD)
  21. CABAL_OLD_INSTALL_CMD=$(CABAL_INSTALL_CMD)
  22. CABAL_OLD_CONFIGURE_CMD=$(CABAL_CONFIGURE_CMD)
  23. endif