regexchar-0.9.0.10: makefile
# Copyright (C) 2010 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 clobber configure copy deb haddock help hlint install lintian prof rpm rpmlint sdist
PACKAGE_NAME=regexchar
all: install
install: build haddock
@[ -z "$$CABAL_INSTALL_OPTIONS" ] || echo "INFO: CABAL_INSTALL_OPTIONS='$$CABAL_INSTALL_OPTIONS'"
runhaskell Setup $@ $$CABAL_INSTALL_OPTIONS
prof:
CABAL_CONFIGURE_OPTIONS="--enable-library-profiling --enable-executable-profiling $$CABAL_CONFIGURE_OPTIONS" make build
copy: build
@[ -z "$$CABAL_COPY_OPTIONS" ] || echo "INFO: CABAL_COPY_OPTIONS='$$CABAL_COPY_OPTIONS'"
runhaskell Setup $@ $$CABAL_COPY_OPTIONS
build: configure
@[ -z "$$CABAL_BUILD_OPTIONS" ] || echo "INFO: CABAL_BUILD_OPTIONS='$$CABAL_BUILD_OPTIONS'"
runhaskell Setup $@ $$CABAL_BUILD_OPTIONS
configure: $(PACKAGE_NAME).cabal Setup.hs
@[ -z "$$CABAL_CONFIGURE_OPTIONS" ] || echo "INFO: CABAL_CONFIGURE_OPTIONS='$$CABAL_CONFIGURE_OPTIONS'"
runhaskell Setup $@ $$CABAL_CONFIGURE_OPTIONS #--user
haddock: configure
PATH=~/.cabal/bin:$$PATH runhaskell Setup $@ --hyperlink-source --executables #Amend path to find 'HsColour', as required for 'hyperlink-source'.
hlint:
@$@ -i 'Use ||' src/
sdist:
runhaskell Setup $@
check:
cabal upload --check --verbose=3 dist/*.tar.gz;
rpm: $(PACKAGE_NAME).spec
rpmbuild -bb --nodeps -- $^
mv -- `find /usr/src/packages/ -type f -name '$(PACKAGE_NAME)*.rpm' -mtime 0 -print` ./
rpmlint: $(PACKAGE_NAME).spec
@$@ $^
deb: build
mkdir -p debian/usr/bin/ && strip --strip-all dist/build/grecce/grecce && mv dist/build/grecce/grecce debian/usr/bin/
mkdir -p 'debian/usr/share/doc/$(PACKAGE_NAME)/' && cp changelog changelog.Debian copyright LICENSE 'debian/usr/share/doc/$(PACKAGE_NAME)/' && cd 'debian/usr/share/doc/$(PACKAGE_NAME)/' && gzip --best -f changelog changelog.Debian LICENSE
cp 'copyright' 'debian/usr/share/doc/$(PACKAGE_NAME)/'
mkdir -p 'debian/usr/share/$(PACKAGE_NAME)/' && cp -R data/ 'debian/usr/share/$(PACKAGE_NAME)/'
mkdir -p debian/usr/share/ && cp -R man/ debian/usr/share/ && gzip --best -f debian/usr/share/man/man1/*.1
cd 'debian' && md5sum `find usr -type f -print` >'DEBIAN/md5sums'
fakeroot dpkg-deb --build debian .
lintian:
lintian -v *.deb
clean:
runhaskell Setup $@
rm -rf 'debian/usr/' 'debian/DEBIAN/md5sums'
find src -type f \( -name '*.hc' -o -name '*.hcr' -o -name '*.hi' -o -name '*.o' \) -delete
clobber: clean
rm -f -- *.rpm *.deb
help:
@grep '^[a-zA-Z].*:' makefile | sed -e 's/:.*//'