"make profile" works again

This commit is contained in:
Simon Michael 2008-12-05 00:38:19 +00:00
parent 1d087d8b8d
commit b17e23909f

View File

@ -1,6 +1,8 @@
BUILD=ghc --make hledger.hs -o hledger -O3 BUILD=ghc --make hledger.hs -O3 -o hledger
BUILDPROF=$(BUILD) -prof -auto-all PROFBIN=hledgerp
PROFILE=./hledger -s balance +RTS -p BUILDPROF=ghc --make hledger.hs -prof -auto-all -o $(PROFBIN)
RUNPROF=./$(PROFBIN) +RTS -p -RTS
PROFCMD=-s balance
TIME=`date +"%Y%m%d%H%M"` TIME=`date +"%Y%m%d%H%M"`
build: tag build: tag
@ -13,14 +15,13 @@ rebuild: clean build
continuous ci: continuous ci:
sp --no-exts --no-default-map -o hledger ghc --make hledger.hs --run test sp --no-exts --no-default-map -o hledger ghc --make hledger.hs --run test
profile: build profile:
$(PROFILE) @echo "Profiling $(PROFCMD)"
mv hledger.prof profs/$(TIME).prof $(BUILDPROF)
rm -f last.prof $(RUNPROF) $(PROFCMD) >/dev/null
ln -s profs/$(TIME).prof last.prof tools/simplifyprof.hs $(PROFBIN).prof >simple.prof
head -20 profs/$(TIME).prof >simple.prof cp simple.prof profs/$(TIME).prof
cat simple.prof cat simple.prof
./simplifyprof.hs <last.prof >>simple.prof
xprofile: build xprofile: build
$(PROFILE) -x $(PROFILE) -x