mirror of
https://github.com/simonmichael/hledger.git
synced 2024-09-18 17:57:11 +03:00
make: clean out old stuff
[ci skip]
This commit is contained in:
parent
47f3ebf25a
commit
1ff2516a84
508
Makefile
508
Makefile
@ -1,5 +1,6 @@
|
|||||||
# One of two project scripts files (Makefile, Shake.hs).
|
# One of two project scripts files (Makefile, Shake.hs).
|
||||||
# This one is usually the simplest to use.
|
# This one was a reboot of Makefile.old.
|
||||||
|
# It is probably used by hledger developers/contributors but not end-users.
|
||||||
# It requires GNU Make (https://www.gnu.org/software/make/).
|
# It requires GNU Make (https://www.gnu.org/software/make/).
|
||||||
# Also, some rules require:
|
# Also, some rules require:
|
||||||
# - stack (http://haskell-lang.org/get-started, installs libs and runs ghc)
|
# - stack (http://haskell-lang.org/get-started, installs libs and runs ghc)
|
||||||
@ -10,53 +11,43 @@
|
|||||||
# - hpack (hackage/stackage, generates cabal files from package.yaml files)
|
# - hpack (hackage/stackage, generates cabal files from package.yaml files)
|
||||||
# - site/hakyll-std/hakyll-std (generic site-building hakyll script)
|
# - site/hakyll-std/hakyll-std (generic site-building hakyll script)
|
||||||
# - perl
|
# - perl
|
||||||
|
|
||||||
# WARNING: don't edit this with IDEA, it rewrites CLEANUPCHANGES below
|
|
||||||
|
|
||||||
# This was a reboot of Makefile.old. The old rules were commented out below,
|
|
||||||
# to be removed or updated over the next while.
|
|
||||||
#
|
|
||||||
# Target users: hledger developers, contributors, probably not end-users.
|
|
||||||
#
|
#
|
||||||
# Kinds of hledger builds:
|
# Kinds of hledger builds:
|
||||||
#
|
#
|
||||||
# - stack build: built with stack
|
# - stack build: built with stack
|
||||||
# (hledger/.stack-work/dist/ARCH/CABAL/build/hledger/hledger,
|
# (hledger/.stack-work/dist/ARCH/CABAL/build/hledger/hledger,
|
||||||
# .stack-work/install/ARCH/SNAPSHOT/GHC/bin/hledger, installs to ~/.local/bin)
|
# .stack-work/install/ARCH/SNAPSHOT/GHC/bin/hledger, installs to ~/.local/bin)
|
||||||
# - cabal build: built with cabal (and maybe a sandbox)
|
# - cabal (v1) build: built with cabal (and maybe a sandbox)
|
||||||
# (hledger/dist/build/hledger/hledger, installs to ~/.cabal/bin)
|
# (hledger/dist/build/hledger/hledger, installs to ~/.cabal/bin)
|
||||||
# - ghc build: built quickly with ghc only, unoptimised, with DEVELOPMENT flag
|
# - ghc-only build: built quickly with ghc only, unoptimised, with DEVELOPMENT flag
|
||||||
# (bin/hledgerdev)
|
# (hledgerdev)
|
||||||
#
|
#
|
||||||
# This makefile mostly uses stack to get things done (slow but robust).
|
# This makefile mostly uses stack to get things done (slow but robust).
|
||||||
# Secondarily it uses ghc directly to do some developer tasks (faster).
|
# It may sometimes (still ?) use ghc only, or cabal, when easier.
|
||||||
# # Also if needed it uses cabal directly for a few tasks.
|
|
||||||
|
|
||||||
# XXX do we need this ?
|
# XXX do we need this ?
|
||||||
#SHELL=/bin/bash
|
#SHELL=/bin/bash
|
||||||
#.SHELLFLAGS="-O extglob -c" # example
|
#.SHELLFLAGS="-O extglob -c" # example
|
||||||
|
|
||||||
# help system
|
###############################################################################
|
||||||
# Every user-relevant rule in this makefile should use def-help to define
|
# MAKEFILE HELP SYSTEM
|
||||||
# a help string. Use "make help" to see the available rules.
|
|
||||||
|
|
||||||
# def-help* functions for documenting make rules. See the file for usage.
|
# This defines the def-help* functions for describing make rules
|
||||||
|
# (see this file for usage details), and a default "help" rule.
|
||||||
|
# Every user-relevant rule in this makefile should use def-help to
|
||||||
|
# describe itself.
|
||||||
-include help-system.mk
|
-include help-system.mk
|
||||||
|
|
||||||
$(call def-help-heading,Main make rules in the hledger project.)
|
# Show all this makefile's rule descriptions on "make" or "make help";
|
||||||
$(call def-help-heading,(not always entirely up to date))
|
# or just matching descriptions on "make help-SUBSTR" or "make SUBSTR-help".
|
||||||
$(call def-help-heading,---------------------------------------)
|
$(call def-help-heading,Main rules in the hledger project Makefile:)
|
||||||
$(call def-help-heading, )
|
$(call def-help-subheading,HELP:)
|
||||||
|
dummy1: $(call def-help,[help], list documented rules in this makefile )
|
||||||
add-to-help-1: $(call def-help,[help], list documented rules in this makefile )
|
|
||||||
|
|
||||||
help-%: $(call def-help,help-SECTION, list documented rules containing some string )
|
help-%: $(call def-help,help-SECTION, list documented rules containing some string )
|
||||||
make help 2>&1 | grep -i $*
|
make help 2>&1 | grep -i $*
|
||||||
|
|
||||||
%-help: $(call def-help,SECTION-help, same but easier to type (can append "-help" to any "make RULE") )
|
%-help: $(call def-help,SECTION-help, same but easier to type (can append "-help" to any "make RULE") )
|
||||||
@make help 2>&1 | grep -i $*
|
@make help 2>&1 | grep -i $*
|
||||||
|
dummy2: $(call def-help,RULE -n, show what RULE would do )
|
||||||
add-to-help-2: $(call def-help,RULE -n, show what RULE would do )
|
|
||||||
|
|
||||||
###############################################################################
|
###############################################################################
|
||||||
# VARS
|
# VARS
|
||||||
@ -200,51 +191,17 @@ WARNINGS:=\
|
|||||||
-fno-warn-orphans \
|
-fno-warn-orphans \
|
||||||
-fno-warn-type-defaults \
|
-fno-warn-type-defaults \
|
||||||
|
|
||||||
# # For ghc-only dev builds of hledger-web: enable the language
|
# if you have need to try building in less memory
|
||||||
# # extensions specified in hledger-web.cabal, except for some which are
|
# GHCLOWMEMFLAGS= #+RTS -M200m -RTS
|
||||||
# # 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.
|
|
||||||
# WEBLANGEXTS:=\
|
|
||||||
# -XCPP \
|
|
||||||
# -XMultiParamTypeClasses \
|
|
||||||
# -XQuasiQuotes \
|
|
||||||
# -XRecordWildCards \
|
|
||||||
# -XTemplateHaskell \
|
|
||||||
# # -XOverloadedStrings \
|
|
||||||
# # -XNoImplicitPrelude \
|
|
||||||
# # -XTypeFamilies \
|
|
||||||
# # -XGADTs \
|
|
||||||
# # -XGeneralizedNewtypeDeriving \
|
|
||||||
# # -XFlexibleContexts \
|
|
||||||
# # -XEmptyDataDecls \
|
|
||||||
# # -XNoMonomorphismRestriction
|
|
||||||
|
|
||||||
# PREFERMACUSRLIBFLAGS=-L/usr/lib
|
# ghc-only builds need the macro definitions generated by cabal
|
||||||
# GHCMEMFLAGS= #+RTS -M200m -RTS
|
# from cabal's dist or dist-sandbox dir, hopefully there's just one:
|
||||||
|
|
||||||
# ghc builds need the macro definitions generated by cabal
|
|
||||||
# from cabal's dist or dist-sandbox dir, hopefully there's just one
|
|
||||||
#CABALMACROSFLAGS=-optP-include -optP hledger/dist*/build/autogen/cabal_macros.h
|
#CABALMACROSFLAGS=-optP-include -optP hledger/dist*/build/autogen/cabal_macros.h
|
||||||
# from stack's dist dir, hopefully there's just one. If not (after cabal upgrade), will get warnings. Maybe obsolete ?
|
# or from stack's dist dir:
|
||||||
#CABALMACROSFLAGS=-optP-include -optP hledger/.stack-work/dist/*/*/build/autogen/cabal_macros.h
|
#CABALMACROSFLAGS=-optP-include -optP hledger/.stack-work/dist/*/*/build/autogen/cabal_macros.h
|
||||||
|
|
||||||
BUILDFLAGS1=-rtsopts $(WARNINGS) $(INCLUDEPATHS) $(PREFERMACUSRLIBFLAGS) $(GHCMEMFLAGS) $(CABALMACROSFLAGS) -DPATCHLEVEL=$(PATCHLEVEL) -DDEVELOPMENT
|
BUILDFLAGS=-rtsopts $(WARNINGS) $(INCLUDEPATHS) $(GHCLOWMEMFLAGS) $(CABALMACROSFLAGS) -DPATCHLEVEL=$(PATCHLEVEL) -DDEVELOPMENT -DVERSION="\"$(VERSION)\""
|
||||||
BUILDFLAGS=$(BUILDFLAGS1) -DVERSION="\"$(VERSION)\""
|
|
||||||
# PROFBUILDFLAGS:=-prof -fprof-auto -osuf hs_p
|
# PROFBUILDFLAGS:=-prof -fprof-auto -osuf hs_p
|
||||||
# # sp needs different quoting:
|
|
||||||
# AUTOBUILDFLAGS:=$(BUILDFLAGS1) -DVERSION='\"$(VERSION)dev\"' # $(PROFBUILDFLAGS)
|
|
||||||
# LINUXRELEASEBUILDFLAGS:=-DMAKE $(WARNINGS) $(INCLUDEPATHS) -O2 -static -optl-static -optl-pthread
|
|
||||||
# MACRELEASEBUILDFLAGS:=-DMAKE $(WARNINGS) $(INCLUDEPATHS) $(PREFERMACUSRLIBFLAGS) -O2 # -optl-L/usr/lib
|
|
||||||
# #WINDOWSRELEASEBUILDFLAGS:=-DMAKE $(WARNINGS) $(INCLUDEPATHS)
|
|
||||||
|
|
||||||
# AUTOBUILD=$(SP) --no-exts --no-default-map $(GHC) -O0 $(GHCMEMFLAGS)
|
|
||||||
|
|
||||||
# # 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")
|
TIME=$(shell date +"%Y%m%d%H%M")
|
||||||
MONTHYEAR=$(shell date +'%B %Y')
|
MONTHYEAR=$(shell date +'%B %Y')
|
||||||
@ -256,26 +213,6 @@ install: \
|
|||||||
$(call def-help,install, download dependencies and install hledger executables to ~/.local/bin or equivalent (with stack))
|
$(call def-help,install, download dependencies and install hledger executables to ~/.local/bin or equivalent (with stack))
|
||||||
$(STACK) install
|
$(STACK) install
|
||||||
|
|
||||||
# cabal-install: \
|
|
||||||
# $(call def-help,cabal-install,\
|
|
||||||
# cabal install the main hledger packages and all their dependencies\
|
|
||||||
# in the sandbox if any; otherwise in the users package db\
|
|
||||||
# )
|
|
||||||
# $(CABALINSTALL) $(patsubst %,./%,$(PACKAGES)) $(EXTRAINSTALLARGS) --enable-tests
|
|
||||||
|
|
||||||
# cabal-install-deps: \
|
|
||||||
# $(call def-help,cabal-install-deps,\
|
|
||||||
# cabal install the dependencies for the main hledger packages, but not the hledger packages \
|
|
||||||
# )
|
|
||||||
# $(CABALINSTALL) $(patsubst %,./%,$(PACKAGES)) $(EXTRAINSTALLARGS) --enable-tests --only-dependencies
|
|
||||||
|
|
||||||
# # uninstall: \
|
|
||||||
# # $(call def-help,uninstall,\
|
|
||||||
# # unregister all packages, assuming they are defined lowest-dependency first\
|
|
||||||
# # avoids some reinstall noise when repeatedly doing make install\
|
|
||||||
# # )
|
|
||||||
# # -for p in $(call reverse,$(PACKAGES)); do $(GHCPKG) unregister $$p; done
|
|
||||||
|
|
||||||
###############################################################################
|
###############################################################################
|
||||||
$(call def-help-subheading,BUILDING:)
|
$(call def-help-subheading,BUILDING:)
|
||||||
|
|
||||||
@ -293,23 +230,6 @@ build: \
|
|||||||
# @($(SHELLTEST) checks \
|
# @($(SHELLTEST) checks \
|
||||||
# && echo $@ PASSED) || echo $@ FAILED
|
# && echo $@ PASSED) || echo $@ FAILED
|
||||||
|
|
||||||
# auto: auto---version \
|
|
||||||
# $(call def-help,auto,\
|
|
||||||
# auto-recompile and run (something, eg --help or unit tests) whenever a module changes\
|
|
||||||
# )
|
|
||||||
|
|
||||||
# auto-%: sp \
|
|
||||||
# $(call def-help,auto-%,\
|
|
||||||
# \
|
|
||||||
# )
|
|
||||||
# $(AUTOBUILD) $(MAIN) -o bin/hledgerdev $(AUTOBUILDFLAGS) --run $*
|
|
||||||
|
|
||||||
# autoweb: sp link-web-dirs \
|
|
||||||
# $(call def-help,autoweb,\
|
|
||||||
# \
|
|
||||||
# )
|
|
||||||
# $(AUTOBUILD) hledger-web/app/main.hs -o bin/hledger-webdev $(AUTOBUILDFLAGS) $(WEBLANGEXTS) --run -B --port 5001 --base-url http://localhost:5001 -f webtest.j
|
|
||||||
|
|
||||||
link-web-dirs: config messages static templates \
|
link-web-dirs: config messages static templates \
|
||||||
$(call def-help,link-web-dirs,\
|
$(call def-help,link-web-dirs,\
|
||||||
\
|
\
|
||||||
@ -339,35 +259,8 @@ templates: \
|
|||||||
)
|
)
|
||||||
ln -sf hledger-web/$@
|
ln -sf hledger-web/$@
|
||||||
|
|
||||||
# sp: \
|
|
||||||
# $(call def-help,sp,\
|
|
||||||
# check for sp and explain how to get it if not found.\
|
|
||||||
# )
|
|
||||||
# @/usr/bin/env which sp >/dev/null || \
|
|
||||||
# (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)
|
|
||||||
|
|
||||||
# force a compile even if binary exists, since we don't specify dependencies for these
|
# force a compile even if binary exists, since we don't specify dependencies for these
|
||||||
.PHONY: bin/hledgerdev bin/hledgerprof # bin/hledger-webdev
|
.PHONY: bin/hledgerprof bin/hledgercov
|
||||||
|
|
||||||
# NB requires cabal macros generated by cabal build in hledger/
|
|
||||||
bin/hledgerdev hledgerdev: \
|
|
||||||
$(call def-help,hledgerdev, build an unoptimised "bin/hledgerdev" executable quickly (with ghc) )
|
|
||||||
$(GHC) $(MAIN) -o bin/hledgerdev $(BUILDFLAGS)
|
|
||||||
|
|
||||||
# bin/hledgerdev.ghc-%: $(SOURCEFILES) \
|
|
||||||
# $(call def-help,bin/hledgerdev.ghc-%,\
|
|
||||||
# build a GHC-version-specific hledger binary without disturbing with other GHC version builds\
|
|
||||||
# )
|
|
||||||
# ghc-$* $(MAIN) -o $@ $(BUILDFLAGS) -outputdir .ghc-$*
|
|
||||||
|
|
||||||
# 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 \
|
|
||||||
# $(call def-help,bin/hledgerdev.ghcall,\
|
|
||||||
# build hledger with the main supported GHC versions\
|
|
||||||
# )
|
|
||||||
|
|
||||||
hledgerprof: \
|
hledgerprof: \
|
||||||
$(call def-help,hledgerprof, build "hledgerprof" for profiling (with stack) )
|
$(call def-help,hledgerprof, build "hledgerprof" for profiling (with stack) )
|
||||||
@ -375,19 +268,6 @@ hledgerprof: \
|
|||||||
cp `$(STACK) exec which hledger`{,prof}
|
cp `$(STACK) exec which hledger`{,prof}
|
||||||
@echo to profile, use $(STACK) exec -- hledgerprof ...
|
@echo to profile, use $(STACK) exec -- hledgerprof ...
|
||||||
|
|
||||||
# bin/hledgerprof: \
|
|
||||||
# $(call def-help,bin/hledgerprof,\
|
|
||||||
# build the "production" cabal build with profiling enabled.\
|
|
||||||
# )
|
|
||||||
# rm -f bin/hledgerprof
|
|
||||||
# cabal install --enable-profiling --ghc-options=-fprof-auto ./hledger-lib ./hledger \
|
|
||||||
# && mv $(CABALINSTALLDIR)/bin/hledger bin/hledgerprof
|
|
||||||
|
|
||||||
# # build the dev build with profiling enabled.
|
|
||||||
# # not working with cabal sandbox
|
|
||||||
# # bin/hledgerdev-prof:
|
|
||||||
# # $(GHC) $(BUILDFLAGS) $(PROFBUILDFLAGS) $(MAIN) -o $@
|
|
||||||
|
|
||||||
hledgercov: \
|
hledgercov: \
|
||||||
$(call def-help,hledgercov, build "bin/hledgercov" for coverage reports (with ghc) )
|
$(call def-help,hledgercov, build "bin/hledgercov" for coverage reports (with ghc) )
|
||||||
$(GHC) $(MAIN) -fhpc -o bin/hledgercov -outputdir .hledgercovobjs $(BUILDFLAGS)
|
$(GHC) $(MAIN) -fhpc -o bin/hledgercov -outputdir .hledgercovobjs $(BUILDFLAGS)
|
||||||
@ -397,14 +277,6 @@ dev: dev.hs $(SOURCEFILES) \
|
|||||||
$(call def-help,dev, build the dev.hs script for quick experiments (with ghc) )
|
$(call def-help,dev, build the dev.hs script for quick experiments (with ghc) )
|
||||||
$(STACK) ghc -- $(CABALMACROSFLAGS) -ihledger-lib dev.hs \
|
$(STACK) ghc -- $(CABALMACROSFLAGS) -ihledger-lib dev.hs \
|
||||||
|
|
||||||
# dev0: dev.hs $(SOURCEFILES) \
|
|
||||||
# $(call def-help,dev, build the dev.hs script for quick experiments (with ghc -O0) )
|
|
||||||
# $(STACK) ghc -- -O0 $(CABALMACROSFLAGS) -ihledger-lib dev.hs -o dev0 \
|
|
||||||
|
|
||||||
# dev2: dev.hs $(SOURCEFILES) \
|
|
||||||
# $(call def-help,dev, build the dev.hs script for quick experiments (with ghc -O2) )
|
|
||||||
# $(STACK) ghc -- -O2 $(CABALMACROSFLAGS) -ihledger-lib dev.hs -o dev2 \
|
|
||||||
|
|
||||||
# to get profiling deps installed, first do something like:
|
# to get profiling deps installed, first do something like:
|
||||||
# stack build --library-profiling hledger-lib timeit criterion
|
# stack build --library-profiling hledger-lib timeit criterion
|
||||||
devprof: dev.hs $(SOURCEFILES) \
|
devprof: dev.hs $(SOURCEFILES) \
|
||||||
@ -426,130 +298,6 @@ dev-heap-upload:
|
|||||||
curl -F "file=@devprof-hc.hp" -F "title='hledger parser'" http://heap.ezyang.com/upload
|
curl -F "file=@devprof-hc.hp" -F "title='hledger parser'" http://heap.ezyang.com/upload
|
||||||
curl -F "file=@devprof-hr.hp" -F "title='hledger parser'" http://heap.ezyang.com/upload
|
curl -F "file=@devprof-hr.hp" -F "title='hledger parser'" http://heap.ezyang.com/upload
|
||||||
|
|
||||||
# # build other executables quickly
|
|
||||||
|
|
||||||
# bin/hledger-webdev: link-web-dirs \
|
|
||||||
# $(call def-help,bin/hledger-webdev,\
|
|
||||||
# \
|
|
||||||
# )
|
|
||||||
# $(GHC) -o $@ $(BUILDFLAGS) $(WEBLANGEXTS) hledger-web/app/main.hs
|
|
||||||
|
|
||||||
# bin/hledger-web-production: \
|
|
||||||
# $(call def-help,bin/hledger-web-production,\
|
|
||||||
# \
|
|
||||||
# )
|
|
||||||
# $(GHC) -o $@ $(BUILDFLAGS) $(WEBLANGEXTS) hledger-web/app/main.hs
|
|
||||||
|
|
||||||
# linuxbinaries: linuxbinary-hledger \
|
|
||||||
# linuxbinary-hledger-web \
|
|
||||||
# $(call def-help,linuxbinaries,\
|
|
||||||
# build portable releaseable binaries for gnu/linux\
|
|
||||||
# )
|
|
||||||
# @echo 'Please check the binaries look portable, then make compressbinaries:'
|
|
||||||
# -file bin/*`arch`
|
|
||||||
|
|
||||||
# linuxbinary-hledger: \
|
|
||||||
# $(call def-help,linuxbinary-hledger,\
|
|
||||||
# work around for inconsistently-named (why ?) hledger/app/hledger-cli.hs\
|
|
||||||
# )
|
|
||||||
# $(GHC) hledger/app/hledger-cli.hs -o bin/$*$(RELEASEBINARYSUFFIX) $(LINUXRELEASEBUILDFLAGS)
|
|
||||||
|
|
||||||
# linuxbinary-%: \
|
|
||||||
# $(call def-help,linuxbinary-%,\
|
|
||||||
# \
|
|
||||||
# )
|
|
||||||
# $(GHC) $*/$*.hs -o bin/$*$(RELEASEBINARYSUFFIX) $(LINUXRELEASEBUILDFLAGS)
|
|
||||||
|
|
||||||
# macbinaries: macbinary-hledger \
|
|
||||||
# macbinary-hledger-web \
|
|
||||||
# $(call def-help,macbinaries,\
|
|
||||||
# \
|
|
||||||
# )
|
|
||||||
# @echo 'Please check the binaries are portable, then make compressbinaries'
|
|
||||||
# otool -L bin/*`arch`
|
|
||||||
|
|
||||||
# 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.\
|
|
||||||
# )
|
|
||||||
# BINARY=`echo $(BINARYFILENAME) | sed -e 's/hledger/$*/'` ; \
|
|
||||||
# LINKCMD=`$(GHC) -v $*/$*.hs $(MACRELEASEBUILDFLAGS) -o bin/$$BINARY 2>&1 | egrep "bin/gcc.*bin/$$BINARY"` ; \
|
|
||||||
# PORTABLELINKCMD=`echo $$LINKCMD | sed -e 's/ -framework GMP//'` ; \
|
|
||||||
# echo $$PORTABLELINKCMD; $$PORTABLELINKCMD
|
|
||||||
|
|
||||||
# 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.\
|
|
||||||
# )
|
|
||||||
# cp ~/.cabal/bin/hledger.exe bin/`echo $(BINARYFILENAME) | dos2unix`
|
|
||||||
# -cp ~/.cabal/bin/hledger-web.exe bin/`echo $(BINARYFILENAME) | sed -e 's/hledger/hledger-web/' | dos2unix`
|
|
||||||
# @echo 'Please check the binaries are portable, then make compressbinaries'
|
|
||||||
# ls -l bin/*`arch`
|
|
||||||
|
|
||||||
# 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.\
|
|
||||||
# )
|
|
||||||
# wine cmd
|
|
||||||
|
|
||||||
# wine-cmd2: \
|
|
||||||
# $(call def-help,wine-cmd2,\
|
|
||||||
# as above but try to cd somewhere useful (doesnt work), also ctrl-d exits quickly\
|
|
||||||
# )
|
|
||||||
# (echo c:; echo cd \\mingw\\msys\\1.0; cat) | wine cmd
|
|
||||||
|
|
||||||
# wine-cmd-window: \
|
|
||||||
# $(call def-help,wine-cmd-window,\
|
|
||||||
# windows command prompt in a new window\
|
|
||||||
# )
|
|
||||||
# wineconsole cmd &
|
|
||||||
|
|
||||||
# wine-mintty: \
|
|
||||||
# $(call def-help,wine-mintty,\
|
|
||||||
# msys bash shell in a mintty window\
|
|
||||||
# )
|
|
||||||
# wine c:/mingw/msys/1.0/bin/mintty - &
|
|
||||||
|
|
||||||
# compressbinaries: \
|
|
||||||
# $(call def-help,compressbinaries,\
|
|
||||||
# \
|
|
||||||
# )
|
|
||||||
# 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`
|
|
||||||
|
|
||||||
# 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.\
|
|
||||||
# )
|
|
||||||
# $(GHC) -threaded -O2 tools/unittest.hs
|
|
||||||
|
|
||||||
# tools/doctest: tools/doctest.hs \
|
|
||||||
# $(call def-help,tools/doctest,\
|
|
||||||
# build the doctest runner\
|
|
||||||
# )
|
|
||||||
# $(GHC) tools/doctest.hs
|
|
||||||
|
|
||||||
# tools/criterionbench: tools/criterionbench.hs \
|
|
||||||
# $(call def-help,tools/criterionbench,\
|
|
||||||
# build the criterion-based benchmark runner. Requires criterion.\
|
|
||||||
# )
|
|
||||||
# $(GHC) tools/criterionbench.hs
|
|
||||||
|
|
||||||
# tools/progressionbench: tools/progressionbench.hs \
|
|
||||||
# $(call def-help,tools/progressionbench,\
|
|
||||||
# build the progression-based benchmark runner. Requires progression.\
|
|
||||||
# )
|
|
||||||
# $(GHC) tools/progressionbench.hs
|
|
||||||
|
|
||||||
tools/generatejournal: tools/generatejournal.hs \
|
tools/generatejournal: tools/generatejournal.hs \
|
||||||
$(call def-help,tools/generatejournal, build the generatejournal tool )
|
$(call def-help,tools/generatejournal, build the generatejournal tool )
|
||||||
@ -880,150 +628,14 @@ quickheap-%: hledgerprof samplejournals \
|
|||||||
# )
|
# )
|
||||||
# $(VIEWHTML) doc/profs/coverage/index.html
|
# $(VIEWHTML) doc/profs/coverage/index.html
|
||||||
|
|
||||||
# # 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)
|
|
||||||
# (cd hledger-lib; cabal repl)
|
|
||||||
|
|
||||||
# repl-cli:\
|
|
||||||
# $(call def-help,repl-cli, start a cabal REPL and load the hledger package)
|
|
||||||
# (cd hledger; cabal repl exe:hledger)
|
|
||||||
|
|
||||||
# repl-web:\
|
|
||||||
# $(call def-help,repl-web, start a cabal REPL and load the hledger-web package)
|
|
||||||
# (cd hledger-web; cabal repl exe:hledger-web)
|
|
||||||
|
|
||||||
###############################################################################
|
###############################################################################
|
||||||
$(call def-help-subheading,DOCUMENTATION:)
|
$(call def-help-subheading,DOCUMENTATION: (see also Shake.hs))
|
||||||
|
|
||||||
# docs: site codedocs \
|
|
||||||
# $(call def-help,docs,\
|
|
||||||
# rebuild all docs\
|
|
||||||
# )
|
|
||||||
|
|
||||||
# cleandocs: site-clean \
|
|
||||||
# $(call def-help,cleandocs,\
|
|
||||||
# \
|
|
||||||
# )
|
|
||||||
|
|
||||||
hakyll-std site/hakyll-std/hakyll-std: \
|
|
||||||
site/hakyll-std/hakyll-std.hs \
|
|
||||||
site/hakyll-std/TableOfContents.hs \
|
|
||||||
$(call def-help,hakyll-std, build a generic hakyll site builder script )
|
|
||||||
cd site/hakyll-std; ./hakyll-std.hs
|
|
||||||
|
|
||||||
site-build: site/hakyll-std/hakyll-std site/manual.md \
|
|
||||||
$(call def-help,site-build, generate the hledger.org website with hakyll-std )
|
|
||||||
-cd site; hakyll-std/hakyll-std build
|
|
||||||
|
|
||||||
site/index.md: wiki/_Sidebar.md \
|
|
||||||
$(call def-help,site/index.md, update home page with ./wiki/_Sidebar content )
|
|
||||||
(sed -ne '1,/<!-- WIKICONTENT -->/ p' site/index.md ; \
|
|
||||||
sed -ne '/^#.*Cookbook/,$$ p' wiki/_Sidebar.md \
|
|
||||||
| perl -p \
|
|
||||||
-e 's/\[\[([^\|]*)\|([^\]]*)\]\]/[\1](https:\/\/github.com\/simonmichael\/hledger\/wiki\/\2)/g;' \
|
|
||||||
-e 's/\[\[([^\]]*)\]\]/[\1](https:\/\/github.com\/simonmichael\/hledger\/wiki\/\1)/g;' \
|
|
||||||
-e 's/^# >/##/;' \
|
|
||||||
; \
|
|
||||||
sed -ne '/<!-- ENDWIKICONTENT -->/,$$ p' site/index.md ) \
|
|
||||||
> site/_index.md.$$$$ && \
|
|
||||||
mv site/_index.md.$$$$ site/index.md
|
|
||||||
|
|
||||||
site/index.md-push: \
|
|
||||||
$(call def-help,site/index.md-push, update home page with ./wiki/_Sidebar content and commit and do a git push if changed )
|
|
||||||
git diff --quiet site/index.md && \
|
|
||||||
make -s site/index.md && \
|
|
||||||
( git diff --quiet site/index.md || (git commit -q -m 'site: home: update from wiki' -m '[ci skip]' site/index.md && git push) )
|
|
||||||
|
|
||||||
site-clean: site/hakyll-std/hakyll-std \
|
|
||||||
$(call def-help,site-clean, remove hakyll-generated files (& take down the website) ) #cleanolddocs
|
|
||||||
-cd site; hakyll-std/hakyll-std clean
|
|
||||||
# rm -rf site/_site/*
|
|
||||||
|
|
||||||
# regenerate html whenever markdown files change (and serve it on port 8000)
|
|
||||||
# XXX hakyll preview/watch often fail to notice changes in large files
|
|
||||||
# XXX can get confused when docs are generated concurrently by a Shake command
|
|
||||||
# XXX individual file updates loses the stylesheets for some reason
|
|
||||||
# more robust: "ls site/*.md | entr ./Shake website" and reload file:///Users/simon/src/hledger/site/_site/docs.html
|
|
||||||
site-preview: site/hakyll-std/hakyll-std \
|
|
||||||
$(call def-help,site-preview, run a hakyll server to preview the website ) #site/site
|
|
||||||
-cd site; hakyll-std/hakyll-std watch # -h hledger.org
|
|
||||||
|
|
||||||
site-livereload: \
|
site-livereload: \
|
||||||
$(call def-help,site-livereload, open a browser on the latest site html and reload the page whenever it is saved )
|
$(call def-help,site-livereload, open a browser on the latest site html and reload the page whenever it is saved )
|
||||||
(sleep 1; open http://localhost:8001) &
|
(sleep 1; open http://localhost:8001) &
|
||||||
livereloadx -p 8001 --static site/_site
|
livereloadx -p 8001 --static site/_site
|
||||||
|
|
||||||
# site-view: site \
|
|
||||||
# $(call def-help,site-view,\
|
|
||||||
# \
|
|
||||||
# )
|
|
||||||
# $(VIEWHTML) site/_site/index.html
|
|
||||||
|
|
||||||
# # site-auto:
|
|
||||||
# # cd site; $(AUTOBUILD) site.hs -o site $(PREFERMACUSRLIBFLAGS) --run preview
|
|
||||||
|
|
||||||
# # ensure some old doc versions are in place:
|
|
||||||
|
|
||||||
# #olddocs: doc/0.22 doc/0.21
|
|
||||||
|
|
||||||
# #doc/0.23:
|
|
||||||
# # (cd doc; git archive --prefix doc/0.23/ tags/0.23 'doc/MANUAL.md') | tar xf -
|
|
||||||
|
|
||||||
# # doc/0.22:
|
|
||||||
# # git archive --prefix doc/0.22/ tags/0.22 'MANUAL.md' | tar xf -
|
|
||||||
|
|
||||||
# # doc/0.21:
|
|
||||||
# # git archive --prefix doc/0.21/ tags/0.21.3 'MANUAL.md' | tar xf -
|
|
||||||
|
|
||||||
# # cleanolddocs:
|
|
||||||
# # cd doc; rm -rf 0.22 0.21
|
|
||||||
|
|
||||||
|
|
||||||
# pdf: codepdf \
|
|
||||||
# $(call def-help,pdf,\
|
|
||||||
# \
|
|
||||||
# ) #docspdf
|
|
||||||
|
|
||||||
# # generate pdf versions of main docs
|
|
||||||
# # docspdf:
|
|
||||||
# # -for d in $(DOCFILES); do (cd site && ln -sf ../$$d && pandoc $$d -w pdf && rm -f $$d); done
|
|
||||||
|
|
||||||
# # # 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
|
|
||||||
|
|
||||||
# # # view all docs and code as pdf
|
|
||||||
# # PDFS=site/{README,README2,MANUAL,CHANGES,CONTRIBUTORS}.pdf code.pdf
|
|
||||||
# # viewall: pdf
|
|
||||||
# # $(VIEWPDF) $(PDFS)
|
|
||||||
|
|
||||||
# # # print all docs and code for offline reading
|
|
||||||
# # printall: pdf
|
|
||||||
# # $(PRINT) $(PDFS)
|
|
||||||
|
|
||||||
# pushdocs: push \
|
|
||||||
# $(call def-help,pushdocs,\
|
|
||||||
# push latest docs etc. and update the hledger.org site\
|
|
||||||
# )
|
|
||||||
# ssh simon@joyful.com 'make -C/repos/hledger docs'
|
|
||||||
|
|
||||||
# EXES=hledger hledger-vty hledger-web
|
|
||||||
# savehelp: \
|
|
||||||
# $(call def-help,savehelp,\
|
|
||||||
# dump all executables command line help into files for review\
|
|
||||||
# )
|
|
||||||
# for e in $(EXES); do $$e --help >.HELP_$$e; done
|
|
||||||
|
|
||||||
# codedocs: haddock hscolour coverage \
|
|
||||||
# $(call def-help,codedocs,\
|
|
||||||
# generate api & other code docs\
|
|
||||||
# ) #sourcegraph #hoogle
|
|
||||||
|
|
||||||
# cf http://www.haskell.org/haddock/doc/html/invoking.html
|
# 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
|
# --ghc-options=-optP-P is a workaround for http://trac.haskell.org/haddock/ticket/284
|
||||||
HADDOCKFLAGS= \
|
HADDOCKFLAGS= \
|
||||||
@ -1041,43 +653,12 @@ haddock: \
|
|||||||
# )
|
# )
|
||||||
# $(VIEWHTML) hledger/dist/doc/html/hledger/index.html
|
# $(VIEWHTML) hledger/dist/doc/html/hledger/index.html
|
||||||
|
|
||||||
# # http://www.cs.york.ac.uk/fp/darcs/hscolour/
|
|
||||||
# HSCOLOUR=HsColour -css
|
|
||||||
# hscolour: site/api/src site/api/src/hscolour.css \
|
|
||||||
# $(call def-help,hscolour,\
|
|
||||||
# \
|
|
||||||
# )
|
|
||||||
# for f in $(HADDOCKSOURCEFILES); do \
|
|
||||||
# $(HSCOLOUR) -anchor $$f -osite/api/src/`echo $$f | sed -e's%[^/]*/%%' | sed -e's%/%-%g' | sed -e's%\.hs$$%.html%'` ; \
|
|
||||||
# done
|
|
||||||
|
|
||||||
# site/api/src/hscolour.css: site/api/src \
|
|
||||||
# $(call def-help,site/api/src/hscolour.css,\
|
|
||||||
# \
|
|
||||||
# )
|
|
||||||
# $(HSCOLOUR) -print-css >site/api/src/hscolour.css
|
|
||||||
|
|
||||||
# site/api/src: \
|
|
||||||
# $(call def-help,site/api/src,\
|
|
||||||
# \
|
|
||||||
# )
|
|
||||||
# mkdir -p site/api/src
|
|
||||||
|
|
||||||
# sourcegraph: \
|
# sourcegraph: \
|
||||||
# $(call def-help,sourcegraph,\
|
# $(call def-help,sourcegraph,\
|
||||||
# \
|
# \
|
||||||
# )
|
# )
|
||||||
# for p in $(PACKAGES); do (cd $$p; SourceGraph $$p.cabal); done
|
# for p in $(PACKAGES); do (cd $$p; SourceGraph $$p.cabal); done
|
||||||
|
|
||||||
# # # generate external api docs for each package
|
|
||||||
# # allhaddock: cabalhaddock\ --hyperlink-source\ --executables
|
|
||||||
|
|
||||||
# # # generate internal code docs for each package
|
|
||||||
# # allhaddockinternal: cabalhaddock\ --hyperlink-source\ --executables\ --internal
|
|
||||||
|
|
||||||
# # # generate hoogle indices for each package
|
|
||||||
# # allhoogle: cabalhaddock\ --hoogle\ --executables
|
|
||||||
|
|
||||||
# #set up the hoogle web interface
|
# #set up the hoogle web interface
|
||||||
# ## We munge haddock and hoogle into a rough but useful framed layout.
|
# ## 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".
|
# ## For this to work the hoogle cgi must be built with base target "main".
|
||||||
@ -1263,39 +844,6 @@ hackageupload: \
|
|||||||
$(call def-help,hackageupload, upload all packages to hackage )
|
$(call def-help,hackageupload, upload all packages to hackage )
|
||||||
for p in $(PACKAGES); do stack upload $$p; done
|
for p in $(PACKAGES); do stack upload $$p; done
|
||||||
|
|
||||||
# RSYNC=rsync
|
|
||||||
|
|
||||||
# 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\
|
|
||||||
# )
|
|
||||||
# $(RSYNC) -azP doc/profs/ simon@joyful.com:/repos/hledger/doc/profs/
|
|
||||||
|
|
||||||
# pullprofs: \
|
|
||||||
# $(call def-help,pullprofs,\
|
|
||||||
# fetch any new profiles and benchmark results from the public site\
|
|
||||||
# )
|
|
||||||
# $(RSYNC) -azP simon@joyful.com:/repos/hledger/doc/profs/ doc/profs/
|
|
||||||
|
|
||||||
# compressbinary: \
|
|
||||||
# $(call def-help,compressbinary,\
|
|
||||||
# compress the just-built platform binary. make hledgerPLATFORM first. Use\
|
|
||||||
# the win variant on windows.\
|
|
||||||
# )
|
|
||||||
# gzip -9 bin/$(BINARYFILENAME)
|
|
||||||
|
|
||||||
# compressbinarywin: \
|
|
||||||
# $(call def-help,compressbinarywin,\
|
|
||||||
# \
|
|
||||||
# )
|
|
||||||
# cd bin; zip -9 $(BINARYFILENAME).zip $(BINARYFILENAME)
|
|
||||||
|
|
||||||
# # push the last-updated platform binary to the public download directory
|
|
||||||
# # pushlatestbinary:
|
|
||||||
# # cd bin; $(RSYNC) -aP `ls -t | head -2` simon@joyful.com:/repos/hledger/site/download/
|
|
||||||
|
|
||||||
|
|
||||||
# showreleasestats stats: \
|
# showreleasestats stats: \
|
||||||
# showreleasedays \
|
# showreleasedays \
|
||||||
# showunreleasedchangecount \
|
# showunreleasedchangecount \
|
||||||
@ -1484,10 +1032,6 @@ cleanghco: \
|
|||||||
$(call def-help-hide,cleanghc, remove ghc build leftovers )
|
$(call def-help-hide,cleanghc, remove ghc build leftovers )
|
||||||
rm -rf `find . -name "*.o" -o -name "*.hi" -o -name "*.dyn_o" -o -name "*.dyn_hi" -o -name "*~" | grep -vE '\.(stack-work|cabal-sandbox|virthualenv)'`
|
rm -rf `find . -name "*.o" -o -name "*.hi" -o -name "*.dyn_o" -o -name "*.dyn_hi" -o -name "*~" | grep -vE '\.(stack-work|cabal-sandbox|virthualenv)'`
|
||||||
|
|
||||||
cleanghc: cleanghco \
|
|
||||||
$(call def-help-hide,cleanghc, remove ghc builds )
|
|
||||||
rm -f bin/hledgerdev bin/hledgerdev.ghc*
|
|
||||||
|
|
||||||
clean: cleanghco \
|
clean: cleanghco \
|
||||||
$(call def-help,clean, default cleanup (ghc build leftovers) )
|
$(call def-help,clean, default cleanup (ghc build leftovers) )
|
||||||
|
|
||||||
|
1344
Makefile.old
1344
Makefile.old
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue
Block a user