Makefile.sandbox 726 B

12345678910111213141516171819202122232425262728293031323334
  1. default:
  2. cabal build
  3. test:
  4. define add-cabal-package-source-once
  5. ifeq ($(findstring $(1) ,$(CABAL_PACKAGE_SOURCES) ),)
  6. CABAL_PACKAGE_SOURCES += $(1)
  7. -include $(1)/Makefile.deps
  8. endif
  9. endef
  10. add-cabal-package-source = $(foreach package,$(1),$(eval $(call add-cabal-package-source-once,$(package))))
  11. include Makefile.deps
  12. create-sandbox:
  13. cabal sandbox init
  14. echo "tests: True" >> cabal.sandbox.config
  15. ifneq ($(strip $(CABAL_PACKAGE_SOURCES)),)
  16. cabal sandbox add-source $(CABAL_PACKAGE_SOURCES)
  17. endif
  18. cabal install --dependencies-only
  19. clean:
  20. distclean: clean
  21. -rm -rf dist
  22. clean-sandbox: distclean
  23. -rm -rf cabal.sandbox.config
  24. -rm -rf .cabal-sandbox
  25. .PHONY: default test create-sandbox clean distclean clean-sandbox