packages feed

factory-0.1.0.0: makefile

# Copyright (C) 2011 Dr. Alistair Ward
# 
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
# 
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
# 
# You should have received a copy of the GNU General Public License
# along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
.PHONY: all build check clean configure copy haddock help hlint install prof sdist

all: install

install: build haddock
	@[ -z "$$CABAL_INSTALL_OPTIONS" ] || echo "INFO: CABAL_INSTALL_OPTIONS='$$CABAL_INSTALL_OPTIONS'"
	runhaskell Setup.hs $@ $$CABAL_INSTALL_OPTIONS

prof:
	CABAL_CONFIGURE_OPTIONS="--enable-library-profiling --enable-executable-profiling $$CABAL_CONFIGURE_OPTIONS" make install

copy: build
	@[ -z "$$CABAL_COPY_OPTIONS" ] || echo "INFO: CABAL_COPY_OPTIONS='$$CABAL_COPY_OPTIONS'"
	runhaskell Setup.hs $@ $$CABAL_COPY_OPTIONS

build: configure
	@[ -z "$$CABAL_BUILD_OPTIONS" ] || echo "INFO: CABAL_BUILD_OPTIONS='$$CABAL_BUILD_OPTIONS'"
	runhaskell Setup.hs $@ $$CABAL_BUILD_OPTIONS

configure: factory.cabal Setup.hs
	@[ -z "$$CABAL_CONFIGURE_OPTIONS" ] || echo "INFO: CABAL_CONFIGURE_OPTIONS='$$CABAL_CONFIGURE_OPTIONS'"
	runhaskell Setup.hs $@ $$CABAL_CONFIGURE_OPTIONS	#--user

haddock: configure
	PATH=~/.cabal/bin:$$PATH runhaskell Setup.hs $@ --hyperlink-source	#Amend path to find 'HsColour', as required for 'hyperlink-source'.

hlint:
	@$@ src/

sdist: configure
	runhaskell Setup.hs $@

check: sdist
	cabal upload --check --verbose=3 dist/*.tar.gz;

clean:
	runhaskell Setup.hs $@
	find src -type f \( -name '*.o' -o -name '*.hi' \) -delete

help:
	@grep '^[a-zA-Z].*:' makefile | sed -e 's/:.*//'