2009-01-25 12:00:57 +03:00
# hledger project makefile
2008-12-10 21:43:14 +03:00
2014-08-01 04:49:04 +04:00
# GHC-compiled executables require a locale (and not just C) or they
2015-06-17 22:14:46 +03:00
# will die on encountering non-ascii data. Set LANG to something if not already set.
2014-08-01 04:49:04 +04:00
export LANG ?= en_US.UTF-8
2010-09-03 06:08:47 +04:00
2012-10-22 01:09:24 +04:00
# command to run during "make prof" and "make heap"
2014-07-06 21:16:56 +04:00
PROFCMD = bin/hledger-prof balance -f data/1000x1000x10.journal >/dev/null
2012-10-08 20:52:49 +04:00
#PROFRTSFLAGS=-p
PROFRTSFLAGS = -P
2009-05-29 23:26:09 +04:00
2009-06-04 05:33:31 +04:00
# command to run during "make coverage"
COVCMD = test
2013-03-31 18:58:04 +04:00
COVCMD = -f test-wf.csv print
2009-06-04 05:33:31 +04:00
2014-07-06 21:19:34 +04:00
# executables to run during "make simplebench"
2014-10-29 02:23:08 +03:00
BENCHEXES = hledger-0.23.3 hledger
2009-06-03 00:37:34 +04:00
2010-02-13 23:21:08 +03:00
# misc. tools
2014-10-29 02:23:08 +03:00
BROWSE = open
2011-06-13 23:50:10 +04:00
VIEWHTML = $( BROWSE)
VIEWPS = $( BROWSE)
VIEWPDF = $( BROWSE)
2010-02-13 23:21:08 +03:00
PRINT = lpr
2009-05-29 23:49:11 +04:00
2012-10-22 01:22:27 +04:00
GHC = ghc
2014-03-04 23:02:47 +04:00
GHCI = ghci
2014-10-18 21:19:00 +04:00
GHCPKG = ghc-pkg
2012-10-22 01:22:27 +04:00
HADDOCK = haddock
2014-04-19 23:02:20 +04:00
CABAL = cabal
CABALINSTALL = cabal install -w $( GHC)
2015-05-17 20:24:57 +03:00
TESTFRAMEWORKOPTS = -j16 --hide-successes
SHELLTEST = cabal exec -- shelltest --execdir -- $( TESTFRAMEWORKOPTS)
2012-10-22 01:22:27 +04:00
# used for make auto, http://joyful.com/repos/searchpath
SP = sp
2010-11-14 22:40:57 +03:00
PACKAGES = \
hledger-lib \
hledger \
2013-03-31 18:58:04 +04:00
hledger-web
2014-08-07 19:44:31 +04:00
2010-11-14 22:40:57 +03:00
INCLUDEPATHS = \
2012-10-13 23:47:16 +04:00
-ihledger-lib \
-ihledger \
2013-03-31 18:58:04 +04:00
-ihledger-web \
-ihledger-web/app
2014-08-07 19:44:31 +04:00
2014-10-26 21:29:17 +03:00
MAIN = hledger/app/hledger-cli.hs
2011-06-03 21:10:27 +04:00
2010-11-20 00:39:17 +03:00
# all source files in the project (plus a few strays like Setup.hs & hlint.hs)
2009-09-23 18:49:04 +04:00
SOURCEFILES := \
2010-09-10 02:54:34 +04:00
hledger/*hs \
2011-07-19 04:56:15 +04:00
hledger/Hledger/*hs \
2010-12-06 00:14:45 +03:00
hledger/Hledger/*/*hs \
2010-09-10 02:54:34 +04:00
hledger-*/*hs \
2010-09-24 06:06:58 +04:00
hledger-*/Hledger/*hs \
2012-11-17 05:26:08 +04:00
hledger-*/Hledger/*/*hs \
hledger-web/app/*.hs \
2012-11-20 01:48:19 +04:00
hledger-web/Handler/*.hs \
2013-04-20 01:55:36 +04:00
hledger-web/Hledger/*.hs \
2012-11-17 05:26:08 +04:00
hledger-web/Settings/*.hs
2011-06-03 21:10:27 +04:00
2014-07-08 22:52:06 +04:00
# # a more careful list suitable for for haddock-all
# HADDOCKSOURCEFILES:= \
# hledger-lib/Hledger.hs \
# hledger-lib/Hledger/*hs \
# hledger-lib/Hledger/*/*hs \
# hledger/Hledger/*hs \
# hledger/Hledger/*/*hs \
# hledger-web/Application.hs \
# hledger-web/Foundation.hs \
# hledger-web/Hledger/*hs \
# hledger-web/Hledger/*/*hs \
# hledger-web/Import.hs \
# hledger-web/Settings.hs \
# hledger-web/Settings/*hs \
# hledger-web/app/*hs \
2011-06-03 21:10:27 +04:00
2010-09-10 02:54:34 +04:00
CABALFILES := \
hledger/hledger.cabal \
hledger-*/*.cabal
2011-06-04 21:01:45 +04:00
WEBFILES := \
2014-10-29 02:23:08 +03:00
hledger-web/templates/* \
2011-09-13 02:45:02 +04:00
hledger-web/static/*.js \
hledger-web/static/*.css
2011-06-04 21:01:45 +04:00
2012-03-11 22:39:26 +04:00
DOCFILES := \
2014-01-12 09:22:53 +04:00
doc/*.md
2012-03-11 22:39:26 +04:00
2012-10-22 01:09:24 +04:00
# files which should be updated when the version changes
VERSIONSENSITIVEFILES = \
$( CABALFILES) \
2015-01-11 09:29:03 +03:00
doc/manual.md \
2012-10-22 01:09:24 +04:00
# file(s) which require recompilation for a build to have an up-to-date version string
VERSIONSOURCEFILE = hledger/Hledger/Cli/Version.hs
# master file defining the current release/build version
2014-01-12 09:29:24 +04:00
VERSIONFILE = .version
2012-10-22 01:09:24 +04:00
# two or three-part version string, whatever's in VERSION
VERSION := $( shell cat $( VERSIONFILE) )
2013-04-06 23:38:25 +04:00
# the number of commits since the last tag
2013-04-08 22:31:24 +04:00
PATCHLEVEL := $( shell git describe --long | awk -F - '{print $$2}' )
2013-04-06 23:38:25 +04:00
# the number of commits since the last_release tag
#PATCHLEVEL:=$(shell git rev-list last_release..HEAD | wc -l)
2012-10-22 01:09:24 +04:00
# build flags
2014-10-18 20:59:11 +04:00
# comment the below to see more warnings
WARNINGS := \
-Wall \
-fno-warn-unused-do-bind \
-fno-warn-name-shadowing \
-fno-warn-missing-signatures \
-fno-warn-orphans \
-fno-warn-type-defaults \
2013-06-05 05:23:55 +04:00
# For ghc-only dev builds of hledger-web: enable the language
# extensions specified in hledger-web.cabal, except for some which are
# not compatible with hledger-lib and hledger, or little-used; those
# are enabled with source file pragmas instead. Note: compilation
# warnings and errors might differ between ghc-only and cabal builds.
2012-11-16 22:49:00 +04:00
WEBLANGEXTS := \
-XCPP \
-XMultiParamTypeClasses \
2013-06-05 05:23:55 +04:00
-XQuasiQuotes \
-XRecordWildCards \
-XTemplateHaskell \
2015-05-25 18:44:42 +03:00
# -XOverloadedStrings \
2013-06-05 05:23:55 +04:00
# -XNoImplicitPrelude \
# -XTypeFamilies \
# -XGADTs \
# -XGeneralizedNewtypeDeriving \
# -XFlexibleContexts \
# -XEmptyDataDecls \
2012-11-24 00:49:17 +04:00
# -XNoMonomorphismRestriction
2013-06-05 05:23:55 +04:00
2010-07-09 06:11:12 +04:00
PREFERMACUSRLIBFLAGS = -L/usr/lib
2012-10-08 20:52:49 +04:00
GHCMEMFLAGS = #+RTS -M200m -RTS
2015-05-16 17:22:29 +03:00
# include the macro definitions generated by cabal build,
# from either dist or dist-sandbox (hopefully you don't have both)
CABALMACROSFLAGS = -optP-include -optP hledger/dist*/build/autogen/cabal_macros.h
2013-04-19 23:40:29 +04:00
BUILDFLAGS1 := -rtsopts $( WARNINGS) $( INCLUDEPATHS) $( PREFERMACUSRLIBFLAGS) $( GHCMEMFLAGS) $( CABALMACROSFLAGS) -DPATCHLEVEL= $( PATCHLEVEL) -DDEVELOPMENT
2015-04-08 05:28:57 +03:00
BUILDFLAGS := $( BUILDFLAGS1) -DVERSION= '"$(VERSION)dev"'
2012-10-22 01:09:24 +04:00
PROFBUILDFLAGS := -prof -fprof-auto -osuf hs_p
2013-04-04 05:22:14 +04:00
# sp needs different quoting:
2013-04-06 07:55:01 +04:00
AUTOBUILDFLAGS := $( BUILDFLAGS1) -DVERSION= '\"$(VERSION)dev\"' # $(PROFBUILDFLAGS)
2010-12-07 04:54:51 +03:00
LINUXRELEASEBUILDFLAGS := -DMAKE $( WARNINGS) $( INCLUDEPATHS) -O2 -static -optl-static -optl-pthread
2010-12-11 01:07:52 +03:00
MACRELEASEBUILDFLAGS := -DMAKE $( WARNINGS) $( INCLUDEPATHS) $( PREFERMACUSRLIBFLAGS) -O2 # -optl-L/usr/lib
2010-12-07 04:54:51 +03:00
#WINDOWSRELEASEBUILDFLAGS:=-DMAKE $(WARNINGS) $(INCLUDEPATHS)
2009-06-03 00:37:34 +04:00
2012-10-22 01:22:27 +04:00
AUTOBUILD = $( SP) --no-exts --no-default-map $( GHC) -O0 $( GHCMEMFLAGS)
2012-04-03 21:12:47 +04:00
2012-10-22 01:09:24 +04:00
# get an accurate binary filename for the current source and platform, slow but reliable. Avoid := here.
BINARYFILENAME = $( shell touch $( VERSIONSOURCEFILE) ; runhaskell -ihledger -ihledger-lib $( MAIN) --binary-filename)
# some other thing for linux binary filenames
RELEASEBINARYSUFFIX = $( shell echo " - $( VERSION) -`uname`-`arch` " | tr '[:upper:]' '[:lower:]' )
TIME := $( shell date +"%Y%m%d%H%M" )
2010-05-24 03:45:12 +04:00
2011-06-06 23:07:03 +04:00
2015-03-30 22:01:42 +03:00
# import the def-help function for documenting make rules.
# Standard usage:
# TARGET: PREREQUISITES \
# $(call def-help,TARGET,\
# HELP\
# )
# ACTIONS
#
# Also:
# $(call def-help-section,SECTION,\
# HELP\
# )
#
# Arguments to def-help etc. may not contain , so use eg ; instead.
# They should not contain ' as it breaks emacs font-lock.
# HELP is one or more lines, or can be blank.
#
i n c l u d e h e l p - s y s t e m . m k
default : help \
$( call def-help,help,\
list all documented rules in this makefile\
)
2010-12-11 01:00:42 +03:00
2009-05-29 12:29:04 +04:00
######################################################################
2014-08-14 04:48:24 +04:00
# SETUP
# work in progress
# Some rules use a sandbox, some don't, ideally we'll handle both cases.
# Initial dev setup involves:
# initialising a sandbox, probably
# cabal update, perhaps
# cabal clean in hledger packages, perhaps
# cabal install dependencies for hledger packages
# cabal install hledger-lib and hledger, perhaps hledger-web
# at least start cabal build in hledger packages, to make cabal include files (dist/build/{Paths_PKG.hs,cabal_macros.h}) (not working with a sandbox)
# When done we should be able to make install, repl-{lib,cli,web}, ghci[-web], check etc.
2015-03-30 22:02:48 +03:00
$( call def -help -section ,SETUP )
2014-08-14 04:48:24 +04:00
2015-03-30 22:02:48 +03:00
check : \
$( call def-help,check,\
developer environment checks\
)
@echo sanity-check developer environment:
@( $( SHELLTESTV) checks \
&& echo $@ PASSED) || echo $@ FAILED
2015-04-08 03:18:18 +03:00
i n c l u d e s a n d b o x . m k
2015-03-30 22:02:48 +03:00
2015-04-08 03:18:18 +03:00
# sandbox: .cabal-sandbox sandbox-links \
# $(call def-help,sandbox,\
# set up a cabal sandbox and some symlinks\
# )
# .cabal-sandbox: \
# $(call def-help,.cabal-sandbox,\
# initialise ./.cabal sandbox and add hledger packages as sources \
# )
# cabal sandbox init
# cabal sandbox add-source ./hledger-lib ./hledger ./hledger-web
2014-08-07 19:44:31 +04:00
2015-03-30 22:02:48 +03:00
sandbox-links : \
$( call def-help,sandbox-links,\
symlink sandbox build dirs to */dist/build so that make ghci[ -web] works\
)
2015-03-16 04:50:46 +03:00
-for p in hledger{ -lib,,-web} ; do ( cd $$ p/dist; ln -s dist-*/build) ; done
2015-03-30 22:02:48 +03:00
install : \
2015-04-08 03:18:18 +03:00
$( call def-help,install,\
2015-03-30 22:02:48 +03:00
cabal install the main hledger packages and all their dependencies\
in the sandbox if any; otherwise in the users package db\
)
2014-08-07 19:44:31 +04:00
$( CABALINSTALL) $( patsubst %,./%,$( PACKAGES) ) $( EXTRAINSTALLARGS) --enable-tests
2015-03-30 23:36:44 +03:00
install-force : \
2015-03-30 22:02:48 +03:00
$( call def-help,install-force,\
cabal install the main hledger packages and all their dependencies more forcibly\
( can break installed libs, requiring ghc-pkg-clean) \
)
2014-08-07 19:44:31 +04:00
$( CABALINSTALL) $( patsubst %,./%,$( PACKAGES) ) $( EXTRAINSTALLARGS) --enable-tests --allow-newer --force-reinstalls
2015-03-30 22:02:48 +03:00
installdeps : \
$( call def-help,installdeps,\
install all cabal dependencies for the main hledger packages\
)
2014-08-07 19:44:31 +04:00
$( CABALINSTALL) $( patsubst %,./%,$( PACKAGES) ) $( EXTRAINSTALLARGS) --enable-tests --only-dependencies
2015-03-30 22:02:48 +03:00
installdeps-force : \
$( call def-help,installdeps-force,\
install all cabal dependencies for the main hledger packages, more forcibly\
( may break installed libs, requiring ghc-pkg-clean) \
)
2014-08-07 19:44:31 +04:00
$( CABALINSTALL) $( patsubst %,./%,$( PACKAGES) ) $( EXTRAINSTALLARGS) --enable-tests --only-dependencies --allow-newer --force-reinstalls
2012-01-29 22:36:51 +04:00
2015-03-30 22:02:48 +03:00
uninstall : \
$( call def-help,uninstall,\
unregister all packages, assuming they are defined lowest-dependency first\
avoids some reinstall noise when repeatedly doing make install\
)
2014-10-18 21:19:00 +04:00
-for p in $( call reverse,$( PACKAGES) ) ; do $( GHCPKG) unregister $$ p; done
# utility function
reverse = $( if $( wordlist 2,2,$( 1) ) ,$( call reverse,$( wordlist 2,$( words $( 1) ) ,$( 1) ) ) $( firstword $( 1) ) ,$( 1) )
2015-03-30 22:02:48 +03:00
cabal% : \
$( call def-help,cabal%,\
run a cabal command in all hledger package dirs\
)
2012-03-05 11:23:35 +04:00
for p in $( PACKAGES) ; do ( echo doing cabal $* in $$ p; cd $$ p; cabal $* ; echo ) ; done
2012-01-29 22:36:51 +04:00
# # run a command in all hledger package dirs
# all%:
# for p in $(PACKAGES); do (echo doing $* in $$p; cd $$p; $*); done
2008-10-17 20:59:05 +04:00
2015-03-30 22:02:48 +03:00
Reset : \
$( call def-help,Reset,\
\
)
2014-08-14 04:48:24 +04:00
cabal sandbox delete
######################################################################
# BUILDING
2015-03-30 22:02:48 +03:00
$( call def -help -section ,BUILDING )
2014-08-14 04:48:24 +04:00
2015-03-30 22:02:48 +03:00
EXTRAINSTALLARGS =
2011-10-19 23:55:01 +04:00
2015-03-30 22:02:48 +03:00
auto : auto ---version \
$( call def-help,auto,\
auto-recompile and run ( something, eg --help or unit tests) whenever a module changes\
)
2012-05-14 23:24:03 +04:00
2015-03-30 22:02:48 +03:00
auto-% : sp \
$( call def-help,auto-%,\
\
)
2013-02-26 00:40:03 +04:00
$( AUTOBUILD) $( MAIN) -o bin/hledgerdev $( AUTOBUILDFLAGS) --run $*
2012-05-27 22:15:36 +04:00
2015-03-30 22:02:48 +03:00
autoweb : sp link -web -dirs \
$( call def-help,autoweb,\
\
)
2013-06-05 05:23:55 +04:00
$( AUTOBUILD) hledger-web/app/main.hs -o bin/hledger-webdev $( AUTOBUILDFLAGS) $( WEBLANGEXTS) --run -B --port 5001 --base-url http://localhost:5001 -f webtest.j
2012-11-16 22:49:00 +04:00
2015-03-30 22:02:48 +03:00
link-web-dirs : config messages static templates \
$( call def-help,link-web-dirs,\
\
)
2013-01-11 17:30:15 +04:00
2015-03-30 22:02:48 +03:00
config : \
$( call def-help,config,\
\
)
2013-01-11 17:30:15 +04:00
ln -sf hledger-web/$@
2015-03-30 22:02:48 +03:00
messages : \
$( call def-help,messages,\
\
)
2013-01-11 17:30:15 +04:00
ln -sf hledger-web/$@
2015-03-30 22:02:48 +03:00
static : \
$( call def-help,static,\
\
)
2013-01-11 17:30:15 +04:00
ln -sf hledger-web/$@
2015-03-30 22:02:48 +03:00
templates : \
$( call def-help,templates,\
\
)
2013-01-11 17:30:15 +04:00
ln -sf hledger-web/$@
2010-11-13 03:07:20 +03:00
2015-03-30 22:02:48 +03:00
sp : \
$( call def-help,sp,\
check for sp and explain how to get it if not found.\
)
2011-06-23 22:15:01 +04:00
@/usr/bin/env which sp >/dev/null || \
2012-03-12 00:16:45 +04:00
( echo '"sp" is required for auto-compilation. darcs get http://joyful.com/darcsden/simon/searchpath, make it (cabal install-ing any needed packages) and add it to your PATH' ; exit 1)
2011-06-23 22:15:01 +04:00
2012-10-21 22:23:23 +04:00
# force a compile even if binary exists, since we don't specify dependencies for these
2014-07-06 21:16:56 +04:00
.PHONY : bin /hledgerdev bin /hledger -prof bin /hledgeropt bin /hledger -webdev
2011-03-13 02:30:57 +03:00
2015-03-30 22:02:48 +03:00
bin/hledgerdev : \
$( call def-help,bin/hledgerdev,\
build hledger developer binary, ie as quickly as possible\
requires cabal macros, generated by doing a cabal build in hledger/\
)
2012-10-22 01:22:27 +04:00
$( GHC) $( MAIN) -o bin/hledgerdev $( BUILDFLAGS)
2010-11-29 04:15:08 +03:00
2015-03-30 22:02:48 +03:00
bin/hledgerdev.ghc-% : $( SOURCEFILES ) \
$( call def-help,bin/hledgerdev.ghc-%,\
build a GHC-version-specific hledger binary without disturbing with other GHC version builds\
)
2012-10-22 01:22:27 +04:00
ghc-$* $( MAIN) -o $@ $( BUILDFLAGS) -outputdir .ghc-$*
2012-03-26 22:18:18 +04:00
2012-10-21 22:23:23 +04:00
bin/hledgerdev.ghcall : \
bin/hledgerdev.ghc-7.6.1 \
bin/hledgerdev.ghc-7.4.1 \
bin/hledgerdev.ghc-7.2.2 \
bin/hledgerdev.ghc-7.0.4 \
2015-03-30 22:02:48 +03:00
$( call def-help,bin/hledgerdev.ghcall,\
build hledger with the main supported GHC versions\
)
2012-03-26 22:18:18 +04:00
2015-03-30 22:02:48 +03:00
bin/hledger : \
$( call def-help,bin/hledger,\
build the "production" optimised cabal build with profiling enabled. Assumes a cabal sandbox.\
)
2014-07-08 22:57:42 +04:00
rm -f bin/hledger
2015-06-17 22:14:46 +03:00
cabal install --disable-profiling ./hledger-lib ./hledger \
2014-07-08 22:57:42 +04:00
&& mv .cabal-sandbox/bin/hledger bin/hledger
2010-11-29 04:15:08 +03:00
2015-03-30 22:02:48 +03:00
bin/hledger-prof : \
$( call def-help,bin/hledger-prof,\
build the "production" cabal build with profiling enabled.\
)
2014-07-08 23:01:27 +04:00
rm -f bin/hledger-prof
2015-06-17 22:14:46 +03:00
cabal install --enable-profiling --ghc-options= -fprof-auto ./hledger-lib ./hledger \
2014-07-06 21:16:56 +04:00
&& mv .cabal-sandbox/bin/hledger bin/hledger-prof
# build the dev build with profiling enabled.
# not working with cabal sandbox
# bin/hledgerdev-prof:
# $(GHC) $(BUILDFLAGS) $(PROFBUILDFLAGS) $(MAIN) -o $@
2011-09-13 04:10:00 +04:00
2015-03-30 22:02:48 +03:00
hledgerhpc : \
$( call def-help,hledgerhpc,\
build the heap profiling binary for coverage reports and heap profiles.\
Keep these .o files separate from the regular ones.\
)
2012-10-22 01:22:27 +04:00
$( GHC) $( MAIN) -fhpc -o bin/hledgerhpc -outputdir .hledgerhpcobjs $( BUILDFLAGS)
2010-11-29 04:15:08 +03:00
2011-10-19 23:55:01 +04:00
# build other executables quickly
2010-09-10 02:54:34 +04:00
2015-03-30 22:02:48 +03:00
bin/hledger-webdev : link -web -dirs \
$( call def-help,bin/hledger-webdev,\
\
)
2012-11-20 03:18:22 +04:00
$( GHC) -o $@ $( BUILDFLAGS) $( WEBLANGEXTS) hledger-web/app/main.hs
2010-09-10 02:54:34 +04:00
2015-03-30 22:02:48 +03:00
bin/hledger-web-production : \
$( call def-help,bin/hledger-web-production,\
\
)
2012-11-20 03:18:22 +04:00
$( GHC) -o $@ $( BUILDFLAGS) $( WEBLANGEXTS) hledger-web/app/main.hs
2010-09-10 02:54:34 +04:00
2010-12-11 01:34:01 +03:00
linuxbinaries : linuxbinary -hledger \
2015-03-30 22:02:48 +03:00
linuxbinary-hledger-web \
$( call def-help,linuxbinaries,\
build portable releaseable binaries for gnu/linux\
)
2010-12-11 01:34:01 +03:00
@echo 'Please check the binaries look portable, then make compressbinaries:'
-file bin/*` arch`
2010-09-10 02:54:34 +04:00
2015-03-30 22:02:48 +03:00
linuxbinary-hledger : \
$( call def-help,linuxbinary-hledger,\
work around for inconsistently-named ( why ?) hledger/app/hledger-cli.hs\
)
2014-10-26 21:29:17 +03:00
$( GHC) hledger/app/hledger-cli.hs -o bin/$* $( RELEASEBINARYSUFFIX) $( LINUXRELEASEBUILDFLAGS)
2012-10-22 01:09:24 +04:00
2015-03-30 22:02:48 +03:00
linuxbinary-% : \
$( call def-help,linuxbinary-%,\
\
)
2012-10-22 01:22:27 +04:00
$( GHC) $* /$* .hs -o bin/$* $( RELEASEBINARYSUFFIX) $( LINUXRELEASEBUILDFLAGS)
2010-12-11 01:00:42 +03:00
2011-04-23 02:57:00 +04:00
macbinaries : macbinary -hledger \
2015-03-30 22:02:48 +03:00
macbinary-hledger-web \
$( call def-help,macbinaries,\
\
)
2011-04-23 02:57:00 +04:00
@echo 'Please check the binaries are portable, then make compressbinaries'
2010-12-11 01:34:01 +03:00
otool -L bin/*` arch`
2010-09-10 02:54:34 +04:00
2015-03-30 22:02:48 +03:00
macbinary-% : \
$( call def-help,macbinary-%,\
build a deployable mac binary for the specified hledger package, munging\
the link command to use only standard osx libs. Specifically we link\
without the non-standard GMP framework, which causes no apparent harm.\
Clunky, does the link twice.\
)
2011-04-23 02:57:00 +04:00
BINARY = ` echo $( BINARYFILENAME) | sed -e 's/hledger/$*/' ` ; \
2012-10-22 01:22:27 +04:00
LINKCMD = ` $( GHC) -v $* /$* .hs $( MACRELEASEBUILDFLAGS) -o bin/$$ BINARY 2>& 1 | egrep " bin/gcc.*bin/ $$ BINARY " ` ; \
2011-04-23 02:57:00 +04:00
PORTABLELINKCMD = ` echo $$ LINKCMD | sed -e 's/ -framework GMP//' ` ; \
echo $$ PORTABLELINKCMD; $$ PORTABLELINKCMD
2015-03-30 22:02:48 +03:00
windowsbinaries : install \
$( call def-help,windowsbinaries,\
Run this on a windows machine or in a wine session, and probably in a\
separate copy of the repo ( hledger-win) .\
Builds and gather deployable binaries for windows, if cygwin tools are\
present and all packages are buildable. Otherwise, cabal install each\
package and gather the binaries by hand.\
)
2010-09-10 02:54:34 +04:00
cp ~/.cabal/bin/hledger.exe bin/` echo $( BINARYFILENAME) | dos2unix`
2010-12-07 04:54:51 +03:00
-cp ~/.cabal/bin/hledger-web.exe bin/` echo $( BINARYFILENAME) | sed -e 's/hledger/hledger-web/' | dos2unix`
2011-04-23 02:57:00 +04:00
@echo 'Please check the binaries are portable, then make compressbinaries'
2010-12-07 04:54:51 +03:00
ls -l bin/*` arch`
2015-03-30 22:02:48 +03:00
wine-cmd : \
$( call def-help,wine-cmd,\
various ways of getting a wine shell\
command-line windows command prompt. Works eg in an emacs shell buffer.\
)
2014-04-19 22:58:55 +04:00
wine cmd
2015-03-30 22:02:48 +03:00
wine-cmd2 : \
$( call def-help,wine-cmd2,\
as above but try to cd somewhere useful ( doesnt work) , also ctrl-d exits quickly\
)
2014-04-19 22:58:55 +04:00
( echo c:; echo cd \\ mingw\\ msys\\ 1.0; cat) | wine cmd
2015-03-30 22:02:48 +03:00
wine-cmd-window : \
$( call def-help,wine-cmd-window,\
windows command prompt in a new window\
)
2014-04-19 22:58:55 +04:00
wineconsole cmd &
2015-03-30 22:02:48 +03:00
wine-mintty : \
$( call def-help,wine-mintty,\
msys bash shell in a mintty window\
)
2014-04-19 22:58:55 +04:00
wine c:/mingw/msys/1.0/bin/mintty - &
2011-09-27 00:51:09 +04:00
2015-03-30 22:02:48 +03:00
compressbinaries : \
$( call def-help,compressbinaries,\
\
)
2011-04-23 02:57:00 +04:00
cd bin; for f in *-windows-*.exe ; do echo zipping $$ f; rm -f $$ f.zip; zip $$ f.zip $$ f; done
# for f in bin/*-{linux,mac-}* ; do echo gzipping $$f; gzip -q $$f >$$f.gz; done
# gzip bin/*`arch`
2015-03-30 22:02:48 +03:00
tools/unittest : tools /unittest .hs \
$( call def-help,tools/unittest,\
build the standalone unit test runner. Requires test-framework, which\
may not work on windows.\
)
2012-10-22 01:22:27 +04:00
$( GHC) -threaded -O2 tools/unittest.hs
2011-10-19 23:55:01 +04:00
2015-03-30 22:02:48 +03:00
tools/doctest : tools /doctest .hs \
$( call def-help,tools/doctest,\
build the doctest runner\
)
2012-10-22 01:22:27 +04:00
$( GHC) tools/doctest.hs
2011-10-19 23:55:01 +04:00
2015-03-30 22:02:48 +03:00
tools/simplebench : tools /simplebench .hs \
$( call def-help,tools/simplebench,\
build the simple benchmark runner. Requires html and tabular.\
)
2012-10-22 01:22:27 +04:00
$( GHC) tools/simplebench.hs
2011-10-19 23:55:01 +04:00
2015-03-30 22:02:48 +03:00
tools/criterionbench : tools /criterionbench .hs \
$( call def-help,tools/criterionbench,\
build the criterion-based benchmark runner. Requires criterion.\
)
2012-10-22 01:22:27 +04:00
$( GHC) tools/criterionbench.hs
2011-10-19 23:55:01 +04:00
2015-03-30 22:02:48 +03:00
tools/progressionbench : tools /progressionbench .hs \
$( call def-help,tools/progressionbench,\
build the progression-based benchmark runner. Requires progression.\
)
2012-10-22 01:22:27 +04:00
$( GHC) tools/progressionbench.hs
2011-10-19 23:55:01 +04:00
2015-03-30 22:02:48 +03:00
tools/generatejournal : tools /generatejournal .hs \
$( call def-help,tools/generatejournal,\
build the generatejournal tool\
)
2012-10-22 01:22:27 +04:00
$( GHC) tools/generatejournal.hs
2011-10-19 23:55:01 +04:00
######################################################################
# TESTING
2015-03-30 22:02:48 +03:00
$( call def -help -section ,TESTING )
2011-10-19 23:55:01 +04:00
2015-03-30 22:02:48 +03:00
packdeps : \
$( call def-help,packdeps,\
run packdeps on each package to check for disallowed newer dependencies\
)
2014-08-14 02:44:11 +04:00
for p in $( PACKAGES) ; do packdeps $$ p/$$ p.cabal; done
2011-10-19 23:55:01 +04:00
2014-08-14 04:48:24 +04:00
######################################################################
# DOCUMENTATION
2011-10-19 23:55:01 +04:00
######################################################################
# RELEASING
# set up this repo copy for previewing a release:
# ensure download links work
2014-01-13 03:15:09 +04:00
# set-up-rc-repo:
# cd site/_site; ln -s ../download
2011-04-23 02:57:00 +04:00
2011-10-19 23:55:01 +04:00
######################################################################
# MISCELLANEOUS
######################################################################
# OLD PRE PKG SPLIT
######################################################################
2010-09-10 02:54:34 +04:00
######################################################################
# TESTING
2015-03-30 22:02:48 +03:00
test : codetest \
$( call def-help,test,\
\
)
2009-06-28 07:17:02 +04:00
2015-03-30 22:02:48 +03:00
codetest : unittest functest \
$( call def-help,codetest,\
quick code tests - run all the time\
)
2009-03-15 08:15:59 +03:00
2015-03-30 22:02:48 +03:00
committest : hlinttest unittest doctest functest haddocktest warningstest quickcabaltest \
$( call def-help,committest,\
moderate pre-commit tests - run before record or before send/push, your choice\
)
2009-06-28 07:17:02 +04:00
2015-03-30 22:02:48 +03:00
releasetest : Clean unittest functest fullcabaltest haddocktest #warningstest doctest \
$( call def-help,releasetest,\
thorough pre-release tests - run before release\
consider hiding dev-build symlinks in Hledger/ first\
)
2009-06-28 07:17:02 +04:00
2015-03-30 22:02:48 +03:00
hlinttest hlint : \
$( call def-help,hlinttest hlint,\
\
)
2009-09-23 21:56:15 +04:00
hlint --hint= hlint --report= hlint.html $( SOURCEFILES)
2009-06-28 07:17:02 +04:00
2015-03-30 22:02:48 +03:00
unittest : unittest -builtin \
$( call def-help,unittest,\
run unit tests\
)
2009-06-28 07:17:02 +04:00
2015-03-30 22:02:48 +03:00
unittest-builtin : bin /hledgerdev \
$( call def-help,unittest-builtin,\
\
)
2012-03-26 22:18:18 +04:00
@echo unit tests:
2012-10-21 22:23:23 +04:00
@( bin/hledgerdev test \
2010-09-06 03:24:34 +04:00
&& echo $@ PASSED) || echo $@ FAILED
2009-06-05 15:15:32 +04:00
2015-03-30 22:02:48 +03:00
unittest-% : bin /hledgerdev \
$( call def-help,unittest-%,\
\
)
2013-01-11 17:32:27 +04:00
@echo unit tests:
@( bin/hledgerdev test $* \
&& echo $@ PASSED) || echo $@ FAILED
2015-03-30 22:02:48 +03:00
unittest-standalone : tools /unittest \
$( call def-help,unittest-standalone,\
v v X X X d o e s n t r e b u i l d o n h l e d g e r s o u r c e c h a n g e s \
)
2012-03-26 22:18:18 +04:00
@echo unit tests ( standalone) :
2009-06-28 07:17:02 +04:00
@( tools/unittest \
2010-09-06 03:24:34 +04:00
&& echo $@ PASSED) || echo $@ FAILED
2009-06-05 15:15:32 +04:00
2015-03-30 22:02:48 +03:00
unittest-interpreted : \
$( call def-help,unittest-interpreted,\
run unit tests without waiting for compilation\
)
2012-10-22 01:22:27 +04:00
@echo "unit tests (interpreted)" :
@( run$( GHC) $( MAIN) test \
2010-09-06 03:24:34 +04:00
&& echo $@ PASSED) || echo $@ FAILED
2008-12-05 12:28:24 +03:00
2015-03-30 22:02:48 +03:00
functest : bin /hledgerdev tests /addons /hledger -addon \
$( call def-help,functest,\
run functional tests, requires shelltestrunner >= 0.9 from hackage\
16 threads sometimes gives "commitAndReleaseBuffer: resource vanished (Broken pipe)" here but seems harmless\
)
2012-03-26 22:18:18 +04:00
@echo functional tests:
2015-05-17 20:24:57 +03:00
@( COLUMNS = 80 PATH = ` pwd ` /bin:$( PATH) $( SHELLTEST) tests \
2010-09-06 03:24:34 +04:00
&& echo $@ PASSED) || echo $@ FAILED
2009-06-27 12:15:00 +04:00
2014-05-07 08:00:49 +04:00
ADDONEXTS = pl py rb sh hs lhs rkt exe com bat
2015-03-30 22:02:48 +03:00
tests/addons/hledger-addon : \
$( call def-help,tests/addons/hledger-addon,\
generate dummy add-ons for testing ( hledger-addon the rest) \
)
2014-05-07 08:00:49 +04:00
rm -rf tests/addons/hledger-*
2015-05-17 20:24:57 +03:00
printf '#!/bin/sh\necho add-on: $$0\necho args: $$*\n' >tests/addons/hledger-addon
2014-05-07 08:00:49 +04:00
for E in '' $( ADDONEXTS) ; do \
2015-05-17 20:24:57 +03:00
cp tests/addons/hledger-addon tests/addons/hledger-addon.$$ E; done
2014-05-07 08:00:49 +04:00
for F in addon. addon2 addon2.hs addon3.exe addon3.lhs addon4.exe add reg; do \
2015-05-17 20:24:57 +03:00
cp tests/addons/hledger-addon tests/addons/hledger-$$ F; done
mkdir tests/addons/hledger-addondir
chmod +x tests/addons/hledger-*
2014-05-07 08:00:49 +04:00
2015-03-30 22:02:48 +03:00
test-ghc-% : # bin/hledgerdev.ghc-$* \
$( call def-help,test-ghc-%,\
run unit and functional tests with a specific GHC version\
some functional tests ( add, include, read-csv..) have bin/hledgerdev hard coded - might need to symlink it\
)
2012-03-28 22:16:46 +04:00
@echo; echo testing hledger built with ghc-$*
2012-03-26 22:18:18 +04:00
@( echo unit tests: \
2012-10-21 22:23:23 +04:00
&& bin/hledgerdev.ghc-$* test \
2012-03-26 22:18:18 +04:00
&& echo functional tests: \
2015-03-17 03:55:19 +03:00
&& $( SHELLTEST) tests -w bin/hledgerdev.ghc-$* \
2012-03-26 22:18:18 +04:00
&& echo $@ PASSED) || echo $@ FAILED
2012-10-21 22:23:23 +04:00
test-ghcall : bin /hledgerdev .ghcall \
2012-10-08 20:52:49 +04:00
test-ghc-7.6.1 \
2012-03-30 00:41:47 +04:00
test-ghc-7.4.1 \
test-ghc-7.2.2 \
test-ghc-7.0.4 \
2015-03-30 22:02:48 +03:00
$( call def-help,test-ghcall,\
run unit and functional tests with main supported GHC versions\
)
2012-03-26 22:18:18 +04:00
2010-09-10 02:54:34 +04:00
DOCTESTFILES = \
hledger/Hledger/Cli/Tests.hs
2015-03-30 22:02:48 +03:00
doctest : tools /doctest \
$( call def-help,doctest,\
run doc tests\
)
2010-09-10 02:54:34 +04:00
@for f in $( DOCTESTFILES) ; do \
( tools/doctest $$ f && echo $@ PASSED) || echo $@ FAILED ; done
2009-03-15 11:47:23 +03:00
2015-03-30 22:02:48 +03:00
haddocktest : \
$( call def-help,haddocktest,\
make sure we have no haddock errors\
)
2011-08-19 23:58:56 +04:00
@( make --quiet haddock \
2010-09-06 03:24:34 +04:00
&& echo $@ PASSED) || echo $@ FAILED
2009-06-05 15:15:32 +04:00
2015-03-30 22:02:48 +03:00
warningstest : \
$( call def-help,warningstest,\
make sure the normal build has no warnings XXX needs updating\
)
2009-06-05 15:15:32 +04:00
@( make -s clean \
&& make --no-print-directory -s hledgernowarnings \
2010-09-06 03:24:34 +04:00
&& echo $@ PASSED) || echo $@ FAILED
2009-06-05 15:15:32 +04:00
2015-03-30 22:02:48 +03:00
quickcabaltest : \
$( call def-help,quickcabaltest,\
make sure cabal is reasonably happy\
)
2014-10-18 22:16:50 +04:00
@( make --no-print-directory cabalclean cabalcheck cabalconfigure \
2011-04-18 11:26:58 +04:00
&& echo $@ PASSED) || echo $@ FAILED
2010-12-11 01:09:32 +03:00
2015-03-30 22:02:48 +03:00
fullcabaltest : \
$( call def-help,fullcabaltest,\
make sure cabal is happy in all possible ways\
)
2014-01-09 03:23:10 +04:00
( for p in $( PACKAGES) ; do ( \
printf " \ntesting $$ p package\n " \
&& cd $$ p \
&& cabal clean \
&& cabal check \
2014-04-19 23:02:20 +04:00
&& $( CABALINSTALL) \
2014-01-09 03:23:10 +04:00
&& cabal sdist \
) ; done \
2011-04-18 11:26:58 +04:00
&& echo $@ PASSED) || echo $@ FAILED
2014-01-09 03:23:10 +04:00
# && cabal upload dist/$$p-$(VERSION).tar.gz --check -v3 \
2009-03-15 08:15:59 +03:00
2015-03-30 22:02:48 +03:00
quickbench : samplejournals tests /bench .tests tools /simplebench \
$( call def-help,quickbench,\
run simple performance benchmarks without saving results\
Requires some commands defined in tests/bench.tests and some BENCHEXES defined above.\
)
2014-01-12 09:53:06 +04:00
tools/simplebench -v -ftests/bench.tests $( BENCHEXES)
2010-05-23 01:24:07 +04:00
@rm -f benchresults.*
2015-03-30 22:02:48 +03:00
bench : samplejournals tests /bench .tests tools /simplebench \
$( call def-help,bench,\
run simple performance benchmarks and archive results\
Requires some commands defined in tests/bench.tests and some BENCHEXES defined above.\
)
2014-11-01 02:24:58 +03:00
tools/simplebench -v -ftests/bench.tests $( BENCHEXES) | tee doc/profs/$( TIME) .bench
2009-06-03 00:37:34 +04:00
@rm -f benchresults.*
2014-11-01 02:24:58 +03:00
@( cd doc/profs; rm -f latest.bench; ln -s $( TIME) .bench latest.bench)
2008-12-10 23:46:18 +03:00
2015-03-30 22:02:48 +03:00
criterionbench : samplejournals tools /criterionbench \
$( call def-help,criterionbench,\
run criterion benchmark tests and save graphical results\
)
2010-02-13 21:39:49 +03:00
tools/criterionbench -t png -k png
2015-03-30 22:02:48 +03:00
progressionbench : samplejournals tools /progressionbench \
$( call def-help,progressionbench,\
run progression benchmark tests and save graphical results\
)
2010-02-13 21:39:49 +03:00
tools/progressionbench -- -t png -k png
2015-03-30 22:02:48 +03:00
prof : samplejournals \
$( call def-help,prof,\
generate and archive an execution profile\
) #bin/hledger-prof
2010-05-22 04:46:32 +04:00
@echo " Profiling: $( PROFCMD) "
2012-10-08 20:52:49 +04:00
-$( PROFCMD) +RTS $( PROFRTSFLAGS) -RTS
2014-11-01 02:24:58 +03:00
mv hledger-prof.prof doc/profs/$( TIME) .prof
( cd doc/profs; rm -f latest*.prof; ln -s $( TIME) .prof latest.prof)
2010-11-20 01:04:20 +03:00
2015-03-30 22:02:48 +03:00
viewprof : prof \
$( call def-help,viewprof,\
generate, archive, simplify and display an execution profile\
)
2014-11-01 02:24:58 +03:00
tools/simplifyprof.hs doc/profs/latest.prof
2009-06-04 05:33:31 +04:00
2015-03-30 22:02:48 +03:00
quickprof : samplejournals \
$( call def-help,quickprof,\
generate and display an execution profile, dont save or simplify\
) #bin/hledger-prof
2010-05-22 04:46:32 +04:00
@echo " Profiling: $( PROFCMD) "
2012-10-08 20:52:49 +04:00
-$( PROFCMD) +RTS $( PROFRTSFLAGS) -RTS
2014-07-06 21:16:56 +04:00
echo; cat hledger-prof.prof
2010-05-22 04:46:32 +04:00
2015-03-30 22:02:48 +03:00
heap : samplejournals \
$( call def-help,heap,\
generate and archive a graphical heap profile\
) #bin/hledger-prof
2010-05-22 04:46:32 +04:00
@echo " Profiling heap with: $( PROFCMD) "
$( PROFCMD) +RTS -hc -RTS
2014-11-01 02:24:58 +03:00
mv hledger-prof.hp doc/profs/$( TIME) .hp
( cd doc/profs; rm -f latest.hp; ln -s $( TIME) .hp latest.hp; \
2009-05-30 00:42:42 +04:00
hp2ps $( TIME) .hp; rm -f latest.ps; ln -s $( TIME) .ps latest.ps; rm -f *.aux)
2010-11-20 01:04:20 +03:00
2015-03-30 22:02:48 +03:00
viewheap : heap \
$( call def-help,viewheap,\
\
)
2014-11-01 02:24:58 +03:00
$( VIEWPS) doc/profs/latest.ps
2009-06-04 05:33:31 +04:00
2015-03-30 22:02:48 +03:00
quickheap : samplejournals \
$( call def-help,quickheap,\
generate and display a graphical heap profile, dont save\
) #bin/hledger-prof
2010-05-22 04:46:32 +04:00
@echo " Profiling heap with: $( PROFCMD) "
$( PROFCMD) +RTS -hc -RTS
2014-07-06 21:16:56 +04:00
hp2ps hledger-prof.hp
2010-05-22 04:46:32 +04:00
$( VIEWPS) hledger.ps
2015-03-30 22:02:48 +03:00
quickcoverage : hledgerhpc \
$( call def-help,quickcoverage,\
display a code coverage text report from running hledger COVCMD\
)
2011-04-22 22:47:12 +04:00
@echo " Generating code coverage text report for hledger command: $( COVCMD) "
tools/runhledgerhpc "report" $( COVCMD)
2015-03-30 22:02:48 +03:00
coverage : samplejournals hledgerhpc \
$( call def-help,coverage,\
generate a code coverage html report from running hledger COVCMD\
)
2011-04-22 22:47:12 +04:00
@echo " Generating code coverage html report for hledger command: $( COVCMD) "
2014-11-01 02:24:58 +03:00
tools/runhledgerhpc "markup --destdir=doc/profs/coverage" $( COVCMD)
cd doc/profs/coverage; rm -f index.html; ln -s hpc_index.html index.html
2010-11-20 01:04:20 +03:00
2015-03-30 22:02:48 +03:00
viewcoverage : \
$( call def-help,viewcoverage,\
view the last html code coverage report\
)
2014-11-01 02:24:58 +03:00
$( VIEWHTML) doc/profs/coverage/index.html
2009-06-04 05:33:31 +04:00
2015-04-08 03:18:18 +03:00
# XXX with a sandbox, use sandbox-repl-* instead
repl-lib : \
$( call def-help,repl-lib, start a cabal REPL and load the hledger-lib package)
2014-07-06 21:47:45 +04:00
( cd hledger-lib; cabal repl)
2015-04-08 03:18:18 +03:00
repl-cli : \
$( call def-help,repl-cli, start a cabal REPL and load the hledger package)
2014-07-06 21:47:45 +04:00
( cd hledger; cabal repl exe:hledger)
2015-04-08 03:18:18 +03:00
repl-web : \
$( call def-help,repl-web, start a cabal REPL and load the hledger-web package)
2014-07-06 21:47:45 +04:00
( cd hledger-web; cabal repl exe:hledger-web)
2015-03-30 22:02:48 +03:00
ghci : \
2015-04-08 03:18:18 +03:00
$( call def-help,ghci, start a sandbox-aware GHCI REPL and load the hledger-lib and hledger packages)
2015-04-08 04:36:28 +03:00
cabal exec $( GHCI) -- $( BUILDFLAGS) hledger/Hledger/Cli/Main.hs
2014-10-18 21:20:32 +04:00
2015-03-30 22:02:48 +03:00
ghci-web : \
2015-04-08 03:18:18 +03:00
$( call def-help,ghci-web, start a sandbox-aware GHCI REPL and load the hledger-lib, hledger and hledger-web packages)
2015-04-08 04:36:28 +03:00
cabal exec $( GHCI) -- $( BUILDFLAGS) hledger-web/app/main.hs
2014-10-18 21:20:32 +04:00
2015-03-30 22:02:48 +03:00
samplejournals : data /sample .journal data /100x 100x 10.journal data /1000x 1000x 10.journal data /1000x 10000x 10.journal data /10000x 1000x 10.journal data /10000x 10000x 10.journal data /100000x 1000x 10.journal \
$( call def-help,samplejournals,\
generate standard sample journals\
)
2009-05-29 12:29:04 +04:00
2015-03-30 22:02:48 +03:00
data/sample.journal : \
$( call def-help,data/sample.journal,\
\
)
2009-05-29 12:29:04 +04:00
true # XXX should probably regenerate this
2015-03-30 22:02:48 +03:00
data/100x100x10.journal : tools /generatejournal \
$( call def-help,data/100x100x10.journal,\
\
)
2010-07-13 10:30:06 +04:00
tools/generatejournal 100 100 10 >$@
2009-05-29 12:29:04 +04:00
2015-03-30 22:02:48 +03:00
data/1000x1000x10.journal : tools /generatejournal \
$( call def-help,data/1000x1000x10.journal,\
\
)
2010-07-13 10:30:06 +04:00
tools/generatejournal 1000 1000 10 >$@
2008-11-26 22:00:55 +03:00
2015-03-30 22:02:48 +03:00
data/1000x10000x10.journal : tools /generatejournal \
$( call def-help,data/1000x10000x10.journal,\
\
)
2012-10-13 23:47:39 +04:00
tools/generatejournal 1000 10000 10 >$@
2015-03-30 22:02:48 +03:00
data/10000x1000x10.journal : tools /generatejournal \
$( call def-help,data/10000x1000x10.journal,\
\
)
2010-07-13 10:30:06 +04:00
tools/generatejournal 10000 1000 10 >$@
2009-05-17 18:13:06 +04:00
2015-03-30 22:02:48 +03:00
data/10000x10000x10.journal : tools /generatejournal \
$( call def-help,data/10000x10000x10.journal,\
\
)
2012-10-13 23:47:39 +04:00
tools/generatejournal 10000 10000 10 >$@
2015-03-30 22:02:48 +03:00
data/100000x1000x10.journal : tools /generatejournal \
$( call def-help,data/100000x1000x10.journal,\
\
)
2010-07-13 10:30:06 +04:00
tools/generatejournal 100000 1000 10 >$@
2009-05-29 12:29:04 +04:00
######################################################################
2009-06-02 23:54:45 +04:00
# DOCUMENTATION
2009-01-25 10:48:41 +03:00
2015-03-30 22:02:48 +03:00
$( call def -help -section ,DOCUMENTATION )
docs : site codedocs \
$( call def-help,docs,\
rebuild all docs\
)
2010-05-17 18:33:05 +04:00
2015-03-30 22:02:48 +03:00
cleandocs : site -clean \
$( call def-help,cleandocs,\
\
)
2014-01-13 03:15:09 +04:00
2015-03-30 22:02:48 +03:00
site-build site : \
$( call def-help,site-build site,\
build some additional static bits of the hledger.org website\
Requires hakyll-std, a generic hakyll site builder\
) #olddocs
2014-11-01 00:59:04 +03:00
-cd doc/site; hakyll build
2014-01-12 09:46:04 +04:00
2015-03-30 22:02:48 +03:00
site-clean : \
$( call def-help,site-clean,\
\
) #cleanolddocs
2014-11-01 00:59:04 +03:00
-cd doc/site; hakyll clean
# rm -rf doc/site/_site/*
2010-05-17 18:33:05 +04:00
2015-03-30 22:02:48 +03:00
site-preview : \
$( call def-help,site-preview,\
\
) #doc/site/site
2014-11-01 00:59:04 +03:00
cd doc/site; hakyll preview
2010-05-31 05:23:30 +04:00
2015-03-30 22:02:48 +03:00
site-view : site \
$( call def-help,site-view,\
\
)
2014-11-01 00:59:04 +03:00
$( VIEWHTML) doc/site/_site/index.html
2010-05-17 18:33:05 +04:00
2014-11-01 00:59:04 +03:00
# site-auto:
# cd doc/site; $(AUTOBUILD) site.hs -o site $(PREFERMACUSRLIBFLAGS) --run preview
2010-07-18 03:09:24 +04:00
2013-04-06 23:39:35 +04:00
# ensure some old doc versions are in place:
2014-12-02 22:53:12 +03:00
#olddocs: doc/0.22 doc/0.21
2013-09-10 03:10:43 +04:00
2014-01-13 03:15:09 +04:00
#doc/0.23:
# (cd doc; git archive --prefix doc/0.23/ tags/0.23 'doc/MANUAL.md') | tar xf -
2014-01-12 09:27:36 +04:00
2014-12-02 22:53:12 +03:00
# doc/0.22:
# git archive --prefix doc/0.22/ tags/0.22 'MANUAL.md' | tar xf -
2013-12-14 07:19:17 +04:00
2014-12-02 22:53:12 +03:00
# doc/0.21:
# git archive --prefix doc/0.21/ tags/0.21.3 'MANUAL.md' | tar xf -
2013-03-31 18:58:04 +04:00
2014-12-02 22:53:12 +03:00
# cleanolddocs:
# cd doc; rm -rf 0.22 0.21
2009-06-02 10:58:43 +04:00
2010-02-26 03:23:44 +03:00
2015-03-30 22:02:48 +03:00
pdf : codepdf \
$( call def-help,pdf,\
\
) #docspdf
2009-06-14 01:37:06 +04:00
2009-06-02 23:54:45 +04:00
# generate pdf versions of main docs
2010-09-10 02:54:34 +04:00
# docspdf:
# -for d in $(DOCFILES); do (cd site && ln -sf ../$$d && pandoc $$d -w pdf && rm -f $$d); done
2010-02-13 23:21:08 +03:00
2014-01-13 03:15:09 +04:00
# # format all code as a pdf for offline reading
# ENSCRIPT=enscript -q --header='$$n|$$D{%+}|Page $$% of $$=' --highlight=haskell --line-numbers --font=Courier6 --color -o-
# codepdf:
# $(ENSCRIPT) --pretty-print=makefile hledger.cabal >cabal.ps
# $(ENSCRIPT) --pretty-print=makefile Makefile >make.ps
# $(ENSCRIPT) --pretty-print=haskell $(SOURCEFILES) >haskell.ps
# cat cabal.ps make.ps haskell.ps | ps2pdf - >code.pdf
2010-02-13 23:21:08 +03:00
2014-01-13 03:15:09 +04:00
# # view all docs and code as pdf
2014-04-21 18:31:13 +04:00
# PDFS=site/{README,README2,MANUAL,CHANGES,CONTRIBUTORS}.pdf code.pdf
2014-01-13 03:15:09 +04:00
# viewall: pdf
# $(VIEWPDF) $(PDFS)
2010-02-13 23:21:08 +03:00
2014-01-13 03:15:09 +04:00
# # print all docs and code for offline reading
# printall: pdf
# $(PRINT) $(PDFS)
2010-02-13 23:21:08 +03:00
2015-03-30 22:02:48 +03:00
pushdocs : push \
$( call def-help,pushdocs,\
push latest docs etc. and update the hledger.org site\
)
2010-07-19 02:22:11 +04:00
ssh simon@joyful.com 'make -C/repos/hledger docs'
2009-05-29 12:29:04 +04:00
2012-10-13 23:47:16 +04:00
EXES = hledger hledger-vty hledger-web
2015-03-30 22:02:48 +03:00
savehelp : \
$( call def-help,savehelp,\
dump all executables command line help into files for review\
)
2011-04-22 20:16:31 +04:00
for e in $( EXES) ; do $$ e --help >.HELP_$$ e; done
2015-03-30 22:02:48 +03:00
codedocs : haddock hscolour coverage \
$( call def-help,codedocs,\
generate api & other code docs\
) #sourcegraph #hoogle
2010-11-20 00:39:17 +03:00
2014-07-08 22:52:06 +04:00
# cf http://www.haskell.org/haddock/doc/html/invoking.html
# --ghc-options=-optP-P is a workaround for http://trac.haskell.org/haddock/ticket/284
HADDOCKFLAGS = \
--haddock-options= '--no-warnings' \
--ghc-options= '-optP-P' \
2015-03-30 22:02:48 +03:00
haddock : haddock -lib haddock -cli haddock -web \
$( call def-help,haddock,\
build per-package haddocks using cabal\
)
2014-07-08 22:52:06 +04:00
2015-03-30 22:02:48 +03:00
haddock-lib : \
$( call def-help,haddock-lib,\
\
)
2014-07-08 22:52:06 +04:00
( cd hledger-lib; cabal haddock $( HADDOCKFLAGS) )
2015-03-30 22:02:48 +03:00
haddock-cli : \
$( call def-help,haddock-cli,\
\
)
2014-07-08 22:52:06 +04:00
( cd hledger; cabal haddock $( HADDOCKFLAGS) )
2015-03-30 22:02:48 +03:00
haddock-web : \
$( call def-help,haddock-web,\
\
)
2014-07-08 22:52:06 +04:00
( cd hledger-web; cabal haddock $( HADDOCKFLAGS) )
2015-03-30 22:02:48 +03:00
view-haddock-cli : \
$( call def-help,view-haddock-cli,\
view-haddock-cli\
)
2014-07-08 22:52:06 +04:00
$( VIEWHTML) hledger/dist/doc/html/hledger/index.html
2015-03-30 22:02:48 +03:00
view-haddock-% : \
$( call def-help,view-haddock-%,\
view-haddock-lib, view-haddock-web\
)
2014-07-08 22:52:06 +04:00
$( VIEWHTML) hledger-$* /dist/doc/html/hledger-$* /index.html
# HADDOCKALLFLAGS= \
# --no-warnings \
# --prologue .haddockallprologue \
# --optghc='-optP-include' \
# --optghc='-optPhledger/dist/build/autogen/cabal_macros.h'
# # --optghc='-XCPP'
# # --optghc="$(WEBLANGEXTS)"
# # --optghc='-hide-package monads-tf'
2010-11-20 00:39:17 +03:00
#$(subst -D,--optghc=-D,$(DEFINEFLAGS))
2014-07-08 22:52:06 +04:00
#
# # .haddockallsynopsis: hledger/hledger.cabal
# # grep synopsis $< | sed -e 's/synopsis: *//' >$@
#
# .haddockallprologue: hledger/hledger.cabal
# cat $< | perl -ne 'print if (/^description:/../^$$/)' | sed -e 's/^description: *//' >$@
# printf "\nThis haddock covers all hledger-* packages, for individual package haddocks see hackage.\n" >>$@
#
# # build haddock docs for the whole project
# haddock-all: .haddockallprologue
# $(HADDOCK) \
# $(HADDOCKALLFLAGS) \
# --title "hledger-* API docs" \
# -o site/api \
# --html \
# --source-module=src/%{MODULE/./-}.html \
# --source-entity=src/%{MODULE/./-}.html#%N \
# $(HADDOCKSOURCEFILES)
#
# # browse the whole-project haddock
# view-haddock-all:
# $(VIEWHTML) site/api/frames.html
2011-08-30 17:48:24 +04:00
2011-06-03 21:10:27 +04:00
# http://www.cs.york.ac.uk/fp/darcs/hscolour/
HSCOLOUR = HsColour -css
2015-03-30 22:02:48 +03:00
hscolour : doc /site /api /src doc /site /api /src /hscolour .css \
$( call def-help,hscolour,\
\
)
2011-08-19 22:39:13 +04:00
for f in $( HADDOCKSOURCEFILES) ; do \
2014-11-01 00:59:04 +03:00
$( HSCOLOUR) -anchor $$ f -odoc/site/api/src/` echo $$ f | sed -e's%[^/]*/%%' | sed -e's%/%-%g' | sed -e's%\.hs$$%.html%' ` ; \
2010-11-20 00:39:17 +03:00
done
2009-05-29 12:29:04 +04:00
2015-03-30 22:02:48 +03:00
doc/site/api/src/hscolour.css : doc /site /api /src \
$( call def-help,doc/site/api/src/hscolour.css,\
\
)
2014-11-01 00:59:04 +03:00
$( HSCOLOUR) -print-css >doc/site/api/src/hscolour.css
2011-06-06 23:06:26 +04:00
2015-03-30 22:02:48 +03:00
doc/site/api/src : \
$( call def-help,doc/site/api/src,\
\
)
2014-11-01 00:59:04 +03:00
mkdir -p doc/site/api/src
2011-06-06 23:06:26 +04:00
2015-03-30 22:02:48 +03:00
sourcegraph : \
$( call def-help,sourcegraph,\
\
)
2010-11-20 00:39:17 +03:00
for p in $( PACKAGES) ; do ( cd $$ p; SourceGraph $$ p.cabal) ; done
2015-03-30 22:02:48 +03:00
patchdeps : \
$( call def-help,patchdeps,\
\
)
2012-05-14 23:24:03 +04:00
darcs2dot > patchdeps.dot && dot -Tpng -O patchdeps.dot
2010-11-20 00:39:17 +03:00
# # generate external api docs for each package
2014-10-18 22:16:50 +04:00
# allhaddock: cabalhaddock\ --hyperlink-source\ --executables
2010-11-20 00:39:17 +03:00
# # generate internal code docs for each package
2014-10-18 22:16:50 +04:00
# allhaddockinternal: cabalhaddock\ --hyperlink-source\ --executables\ --internal
2010-11-20 00:39:17 +03:00
# # generate hoogle indices for each package
2014-10-18 22:16:50 +04:00
# allhoogle: cabalhaddock\ --hoogle\ --executables
2010-04-07 03:44:51 +04:00
2009-05-29 12:29:04 +04:00
#set up the hoogle web interface
2010-11-20 00:39:17 +03:00
## We munge haddock and hoogle into a rough but useful framed layout.
## For this to work the hoogle cgi must be built with base target "main".
## XXX move the framed index building into haddock: ?
2011-09-02 02:18:59 +04:00
# sed -i -e 's%^></HEAD%><base target="main"></HEAD%' site/api/modules-index.html ; \
# cp site/api-frames.html site/api/index.html ; \
# # cp site/hoogle-small.html site/api
2010-11-20 00:39:17 +03:00
#
2009-05-29 12:29:04 +04:00
#uses a hoogle source tree configured with --datadir=., patched to fix haddock urls/target frame
2010-11-20 00:39:17 +03:00
# HOOGLESRC=/usr/local/src/hoogle
# HOOGLE=$(HOOGLESRC)/dist/build/hoogle/hoogle
# HOOGLEVER=`$(HOOGLE) --version |tail -n 1 | sed -e 's/Version /hoogle-/'`
# hoogle: hoogleindex
# if test -f $(HOOGLE) ; then \
2011-09-02 02:18:59 +04:00
# cd site/api && \
2010-11-20 00:39:17 +03:00
# rm -f $(HOOGLEVER) && \
# ln -s . $(HOOGLEVER) && \
# cp -r $(HOOGLESRC)/src/res/ . && \
# cp -p $(HOOGLE) index.cgi && \
# touch log.txt && chmod 666 log.txt ; \
# else \
# echo "Could not find $(HOOGLE) in the hoogle source tree" ; \
# fi
#
2009-05-29 12:29:04 +04:00
#generate a hoogle index
2010-11-20 00:39:17 +03:00
# hoogleindex:
2012-10-22 01:22:27 +04:00
# $(HADDOCK) $(HADDOCKFLAGS) -o site/api --hoogle $(MAIN) && \
2011-09-02 02:18:59 +04:00
# cd site/api && \
2010-11-20 00:39:17 +03:00
# hoogle --convert=main.txt --output=default.hoo
2009-05-29 12:29:04 +04:00
######################################################################
# RELEASING
2009-01-25 11:09:09 +03:00
2015-03-30 22:02:48 +03:00
$( call def -help -section ,RELEASING )
2014-01-12 09:29:24 +04:00
# Version numbering. See also .version and Version.hs.
2009-12-11 01:43:23 +03:00
#
# hledger's version number appears in:
2009-02-26 20:37:46 +03:00
# hledger --version
2009-02-27 05:55:54 +03:00
# hledger's cabal file
# darcs tags
# hackage tarball filenames
# hackage pages
2009-02-26 20:37:46 +03:00
#
2009-12-11 01:43:23 +03:00
# Some old version numbering goals:
2009-02-26 20:37:46 +03:00
# 1 automation, robustness, simplicity, platform independence
# 2 cabal versions must be all-numeric
2009-02-27 05:55:54 +03:00
# 3 release versions can be concise (without extra .0's)
2009-02-26 20:37:46 +03:00
# 4 releases should have a corresponding darcs tag
# 5 development builds should have a precise version appearing in --version
# 6 development builds should generate cabal packages with non-confusing versions
2009-02-27 05:55:54 +03:00
# 7 there should be a way to mark builds/releases as alpha or beta
# 8 it should be easy to darcs get the .0 release even after bugfix releases
# 9 avoid unnecessary compiling and linking
# 10 minimise rcs noise and syncing issues (commits, unrecorded changes)
2009-02-26 20:37:46 +03:00
#
2009-12-11 01:43:23 +03:00
# Current policy:
#
# - We follow http://haskell.org/haskellwiki/Package_versioning_policy
#
# - The full release version is ma.jor.minor, where minor is 0 for a
# normal release or 1..n for bugfix releases.
#
# - The elided release version is ma.jor when minor is 0. We use it for
# hackage releases when possible, trusting it doesn't cause trouble..
#
# - The build version is ma.jor.minor+patches, where patches is the number
# of patches applied in the current repo since the last release tag.
#
# - The release tag in the repo is the full release version.
#
# - hledger --version shows the release version or build version as
# appropriate.
#
2014-01-12 09:29:24 +04:00
# - The .version file must be updated manually before a release.
2009-12-12 05:35:09 +03:00
#
2010-02-13 21:39:49 +03:00
# - "make simplebench" depends on version numbers in BENCHEXES, these also
2009-12-12 05:35:09 +03:00
# must be updated manually.
#
# - "make" updates the version in most other places, and defines PATCHES.
# Note "cabal build" should also do this but doesn't yet.
#
# - "make release" additionally records the main version number-affected
# files, and tags the repo with the release tag.
2009-12-12 05:55:59 +03:00
2015-03-30 22:02:48 +03:00
release : releasetest setandrecordversion tagrelease \
$( call def-help,release,\
Build a release, tag the repo, prepare a cabal package\
First update .version. Eg:\
a normal release: echo 0.7 >.version; make release\
a bugfix release: echo 0.7.1 >.version; make release\
)
2009-06-22 23:52:58 +04:00
2015-03-30 22:02:48 +03:00
upload : cabalsdist hackageupload pushdocs \
$( call def-help,upload,\
Upload the latest cabal package and update hledger.org\
)
2009-12-12 05:55:59 +03:00
2015-03-30 22:02:48 +03:00
releaseandupload : release upload \
$( call def-help,releaseandupload,\
\
)
2009-02-27 05:55:54 +03:00
2010-07-10 17:09:49 +04:00
2015-03-30 22:02:48 +03:00
setandrecordversion : setversion \
$( call def-help,setandrecordversion,\
update the version number in local files, and prompt to record changes\
in these files. Triggered by "make release" .\
)
2010-07-18 03:09:24 +04:00
darcs record -m "bump version" $( VERSIONFILE) $( VERSIONSENSITIVEFILES)
2010-07-10 17:09:49 +04:00
2015-03-30 22:02:48 +03:00
setversion : $( VERSIONSENSITIVEFILES ) \
$( call def-help,setversion,\
update the version string in local files. This should be run immediately\
after editing the VERSION file.\
)
2010-07-10 17:09:49 +04:00
2015-03-30 22:02:48 +03:00
Setversion : \
$( call def-help,Setversion,\
re-update version string even if it seems unchanged\
)
2010-09-10 02:54:34 +04:00
touch $( VERSIONFILE) ; make setversion
2015-03-30 22:02:48 +03:00
hledger-lib/hledger-lib.cabal : $( VERSIONFILE ) \
$( call def-help,hledger-lib/hledger-lib.cabal,\
\
)
2010-09-10 02:54:34 +04:00
perl -p -e " s/(^ *version:) *.*/\1 $( VERSION) / " -i $@
2015-03-30 22:02:48 +03:00
hledger/hledger.cabal : $( VERSIONFILE ) \
$( call def-help,hledger/hledger.cabal,\
\
)
2010-04-15 02:36:11 +04:00
perl -p -e " s/(^ *version:) *.*/\1 $( VERSION) / " -i $@
2014-12-28 01:38:18 +03:00
perl -p -e " s/(^[ ,]*hledger(-lib)? *[>=]=) *.*/\1 $( VERSION) / " -i $@
2012-10-22 01:09:24 +04:00
perl -p -e " s/(-DVERSION=\")[^\"]+/\$ ${ 1 } $( VERSION) / " -i $@
2009-02-27 05:55:54 +03:00
2015-03-30 22:02:48 +03:00
hledger-web/hledger-web.cabal : $( VERSIONFILE ) \
$( call def-help,hledger-web/hledger-web.cabal,\
\
)
2010-04-15 02:36:11 +04:00
perl -p -e " s/(^ *version:) *.*/\1 $( VERSION) / " -i $@
2014-12-28 01:38:18 +03:00
perl -p -e " s/(^[ ,]*hledger(-lib|-web)? *[>=]=) *.*/\1 $( VERSION) / " -i $@
2012-10-22 01:09:24 +04:00
perl -p -e " s/(-DVERSION=\")[^\"]+/\$ ${ 1 } $( VERSION) / " -i $@
2009-02-27 05:55:54 +03:00
2015-03-30 22:02:48 +03:00
doc/MANUAL.md : $( VERSIONFILE ) \
$( call def-help,doc/MANUAL.md,\
\
)
2012-11-24 19:59:42 +04:00
perl -p -e " s/(^Version:) +[0-9.]+/\1 $( VERSION) / " -i $@
2010-07-18 03:09:24 +04:00
2015-03-30 22:02:48 +03:00
tagrelease : \
$( call def-help,tagrelease,\
\
)
2014-09-13 05:32:36 +04:00
for p in $( PACKAGES) ; do git tag $$ p-$( VERSION) ; done
2009-02-26 20:37:46 +03:00
2015-03-30 22:02:48 +03:00
hackageupload-dry : \
$( call def-help,hackageupload-dry,\
\
)
2013-07-11 02:28:34 +04:00
for p in $( PACKAGES) ; do cabal upload $$ p/dist/$$ p-$( VERSION) .tar.gz -v2 --check; done
2015-03-30 22:02:48 +03:00
hackageupload : \
$( call def-help,hackageupload,\
\
)
2013-01-11 17:32:42 +04:00
for p in $( PACKAGES) ; do cabal upload $$ p/dist/$$ p-$( VERSION) .tar.gz -v2; done
2015-03-30 22:02:48 +03:00
send : \
$( call def-help,send,\
send unpushed patches to the mail list\
)
2009-05-29 12:29:04 +04:00
darcs send http://joyful.com/repos/hledger --to= hledger@googlegroups.com --edit-description
2008-11-24 01:15:51 +03:00
2015-03-30 22:02:48 +03:00
push : pushprofs \
$( call def-help,push,\
push patches and anything else pending to the public server\
) # pushlatestbinary
2010-07-19 02:22:11 +04:00
darcs push simon@joyful.com:/repos/hledger
2008-10-18 08:34:41 +04:00
2015-03-30 22:02:48 +03:00
pull : pullprofs \
$( call def-help,pull,\
pull anything pending from the public server\
)
2010-07-19 02:22:11 +04:00
darcs pull -a simon@joyful.com:/repos/hledger
2009-05-30 01:00:38 +04:00
2012-10-22 01:09:24 +04:00
RSYNC = rsync
2015-03-30 22:02:48 +03:00
pushprofs : \
$( call def-help,pushprofs,\
push any new profiles and benchmark results to the public site\
beware, results will vary depending on which machine generated them\
)
2014-11-01 02:24:58 +03:00
$( RSYNC) -azP doc/profs/ simon@joyful.com:/repos/hledger/doc/profs/
2009-05-30 01:00:38 +04:00
2015-03-30 22:02:48 +03:00
pullprofs : \
$( call def-help,pullprofs,\
fetch any new profiles and benchmark results from the public site\
)
2014-11-01 02:24:58 +03:00
$( RSYNC) -azP simon@joyful.com:/repos/hledger/doc/profs/ doc/profs/
2009-05-29 23:26:09 +04:00
2015-03-30 22:02:48 +03:00
compressbinary : \
$( call def-help,compressbinary,\
compress the just-built platform binary. make hledgerPLATFORM first. Use\
the win variant on windows.\
)
2010-09-07 01:00:19 +04:00
gzip -9 bin/$( BINARYFILENAME)
2015-03-30 22:02:48 +03:00
compressbinarywin : \
$( call def-help,compressbinarywin,\
\
)
2010-07-19 02:23:00 +04:00
cd bin; zip -9 $( BINARYFILENAME) .zip $( BINARYFILENAME)
2010-09-07 01:00:19 +04:00
# push the last-updated platform binary to the public download directory
2014-01-13 03:15:09 +04:00
# pushlatestbinary:
# cd bin; $(RSYNC) -aP `ls -t | head -2` simon@joyful.com:/repos/hledger/site/download/
2010-07-19 02:23:00 +04:00
2009-06-05 04:55:20 +04:00
2011-09-02 05:00:53 +04:00
showreleasestats stats : \
2011-04-22 22:47:57 +04:00
showreleasedays \
showunreleasedchangecount \
showloc \
showtestcount \
showunittestcoverage \
showreleaseauthors \
showunreleasedcodechanges \
2015-03-30 22:02:48 +03:00
showunpushedchanges \
$( call def-help,showreleasestats stats,\
show project stats useful for release notes\
)
2011-04-22 22:47:57 +04:00
# simplebench
# showerrors
2011-09-25 22:29:23 +04:00
FROMTAG = .
2015-03-30 22:02:48 +03:00
showreleasedays : \
$( call def-help,showreleasedays,\
\
)
2011-04-22 22:47:57 +04:00
@echo Days since last release:
2011-09-25 22:29:23 +04:00
@tools/dayssincetag.hs $( FROMTAG) | head -1 | cut -d' ' -f-1
2011-04-22 22:47:57 +04:00
@echo
2011-04-18 11:26:58 +04:00
2015-03-30 22:02:48 +03:00
showunreleasedchangecount : \
$( call def-help,showunreleasedchangecount,\
\
)
2011-04-22 22:47:57 +04:00
@echo Commits since last release:
2011-09-25 22:29:23 +04:00
@darcs changes --from-tag $( FROMTAG) --count
2011-04-18 11:26:58 +04:00
@echo
2009-01-21 01:27:32 +03:00
2015-03-30 22:02:48 +03:00
showreleaseauthors : \
$( call def-help,showreleaseauthors,\
\
)
2008-11-24 00:50:38 +03:00
@echo Patch authors since last release:
2011-09-25 22:29:23 +04:00
@darcs changes --from-tag $( FROMTAG) | grep '^\w' | cut -c 31- | sort | uniq
2009-05-29 12:29:04 +04:00
@echo
2008-11-24 00:50:38 +03:00
2015-03-30 22:02:48 +03:00
showloc : \
$( call def-help,showloc,\
\
)
2011-04-22 22:47:57 +04:00
@echo Current lines of code including tests:
2010-05-24 02:46:40 +04:00
@sloccount ` ls $( SOURCEFILES) ` | grep haskell:
2009-05-29 12:29:04 +04:00
@echo
2009-05-17 18:13:06 +04:00
2015-03-30 22:02:48 +03:00
sloc : \
$( call def-help,sloc,\
\
)
2013-07-11 02:29:00 +04:00
@sloccount hledger-lib hledger hledger-web
2015-03-30 22:02:48 +03:00
cloc : \
$( call def-help,cloc,\
\
)
2013-07-11 02:29:00 +04:00
@echo
@echo "Lines of code as of `date`:"
@echo
@echo "hledger-lib, hledger"
@cloc -q hledger-lib hledger 2>& 1 | grep -v 'defined('
@echo
@echo "hledger-web"
@cloc -q hledger-web 2>& 1 | grep -v 'defined('
@echo
@echo "hledger-lib, hledger, hledger-web"
@cloc -q hledger-lib hledger hledger-web 2>& 1 | grep -v 'defined('
2015-03-30 22:02:48 +03:00
showtestcount : \
$( call def-help,showtestcount,\
\
)
2011-04-22 22:47:57 +04:00
@echo "Unit tests:"
@hledger test 2>& 1 | cut -d' ' -f2
@echo "Functional tests:"
@make --no-print functest | egrep '^ Total' | awk '{print $$2}'
@echo
2015-03-30 22:02:48 +03:00
showunittestcoverage : \
$( call def-help,showunittestcoverage,\
\
)
2011-04-22 22:47:57 +04:00
@echo Unit test coverage:
@make --no-print quickcoverage | grep 'expressions'
@echo
2009-06-04 05:33:31 +04:00
2010-05-24 02:46:40 +04:00
# showerrors:
# @echo Known errors:
2012-02-23 18:47:10 +04:00
# @awk '/^** errors/, /^** / && !/^** errors/' NOTES.org | grep '^\*\*\* ' | tail +1
2010-05-24 02:46:40 +04:00
# @echo
2009-05-17 18:13:06 +04:00
2015-03-30 22:02:48 +03:00
showunpushedchanges showunpushed : \
$( call def-help,showunpushedchanges showunpushed,\
\
)
2011-04-22 22:47:57 +04:00
@echo "Changes not yet pushed upstream (to `darcs show repo | grep 'Default Remote' | cut -c 17-`):"
2010-07-19 02:22:11 +04:00
@-darcs push simon@joyful.com:/repos/hledger --dry-run | grep '*' | tac
2009-05-29 12:29:04 +04:00
@echo
2009-05-17 18:13:06 +04:00
2015-03-30 22:02:48 +03:00
showunreleasedcodechanges showunreleased showchanges : \
$( call def-help,showunreleasedcodechanges showunreleased showchanges,\
\
)
2011-04-22 22:47:57 +04:00
@echo "hledger code changes since last release:"
2011-09-25 22:29:23 +04:00
@darcs changes --from-tag $( FROMTAG) --matches "not (name docs: or name doc: or name site: or name tools:)" | grep '*'
2010-02-27 21:16:36 +03:00
@echo
2015-03-30 22:02:48 +03:00
showcodechanges : \
$( call def-help,showcodechanges,\
\
)
2011-04-22 22:47:57 +04:00
@echo "hledger code changes:"
@darcs changes --matches "not (name docs: or name site: or name tools:)" | egrep '^ +(\*|tagged)'
2009-05-29 12:29:04 +04:00
@echo
######################################################################
# MISCELLANEOUS
2015-03-30 22:02:48 +03:00
$( call def -help -section ,MISCELLANEOUS )
fixperms : \
$( call def-help,fixperms,\
fix permissions ( eg after darcs get) \
)
2010-09-10 05:57:41 +04:00
chmod +x tools/* $( MAIN) hledger-*/Main.hs
2015-03-30 22:02:48 +03:00
tag : emacstags \
$( call def-help,tag,\
\
)
2009-05-29 12:29:04 +04:00
2015-03-30 22:02:48 +03:00
emacstags : \
$( call def-help,emacstags,\
\
)
2012-03-11 22:39:26 +04:00
-@rm -f TAGS; hasktags -e $( SOURCEFILES) $( WEBFILES) $( CABALFILES) $( DOCFILES) Makefile
2009-05-29 12:29:04 +04:00
2015-03-30 22:02:48 +03:00
cleanghc : \
$( call def-help,cleanghc,\
\
)
2014-10-18 20:30:53 +04:00
rm -rf ` find . -name "*.o" -o -name "*.hi" -o -name "*~" | grep -vE '(virthualenv|cabal-sandbox)' `
2014-10-18 21:18:36 +04:00
2015-03-30 22:02:48 +03:00
cleancabal : cabalclean \
$( call def-help,cleancabal,\
\
)
2009-05-29 12:29:04 +04:00
2015-03-30 22:02:48 +03:00
cleanbin : \
$( call def-help,cleanbin,\
\
)
2012-10-21 22:23:23 +04:00
rm -f bin/hledgerdev bin/hledgerdev.ghc*
2012-03-30 00:41:47 +04:00
2015-03-30 22:02:48 +03:00
cleantags : \
$( call def-help,cleantags,\
\
)
2012-03-30 00:41:47 +04:00
rm -f TAGS tags
2008-10-03 11:40:28 +04:00
2015-03-30 22:02:48 +03:00
clean : cleanghc \
$( call def-help,clean,\
\
)
2014-10-18 21:18:36 +04:00
2015-03-30 22:02:48 +03:00
Clean : cleanghc cleancabal cleanbin cleantags \
$( call def-help,Clean,\
\
)
######################################################################
# LOCAL NON-COMMITTED CUSTOMISATIONS, IF ANY
2014-10-18 20:30:53 +04:00
2013-05-03 23:00:05 +04:00
- i n c l u d e M a k e f i l e . l o c a l