Modification : sépare hcompta-ledger de hcompta-lib.
[comptalang.git] / GNUmakefile
index 689ad6badc2fdcb5845aa9ec4d5722a45012848e..386c3e8659ecf6cd49accf57e2ab6ca21cbfc837 100644 (file)
@@ -15,9 +15,9 @@ GHC_PROF_CPUS:=
 GHC_PROF_PS_WIDTH:=11in
 GHC_PROF_RATE:=0.1
 GHC_PROF_CC_LENGTH:=50
-HCOMPTA_CLI_PROF:=$(CABAL_SANDBOX)/bin/hcompta-cli-prof
+HCOMPTA_CLI_PROF:=$(CABAL_SANDBOX)/bin/hcompta-prof
 HCOMPTA_COMMANDS:=balance gl journal
-HCOMPTA_INTERFACES:=lib cli web
+HCOMPTA_INTERFACES:=lib ledger cli web
 commit:=$(shell if which git >/dev/null; then git describe --long; else echo COMMIT; fi)
 
 #
@@ -35,8 +35,20 @@ cabal/install:
        cabal $(CABAL_FLAGS) update $(CABAL_UPDATE_FLAGS)
        cabal $(CABAL_FLAGS) install -v $(CABAL_INSTALL_FLAGS) cabal
 .PHONY: $(HCOMPTA_INTERFACES)
-lib lib/install: cli/unregister web/unregister cli/unregister/sandbox web/unregister/sandbox
+lib lib/install: \
+ cli/unregister \
+ web/unregister \
+ ledger/unregister \
+ cli/unregister/sandbox \
+ web/unregister/sandbox \
+ ledger/unregister/sandbox
        cabal $(CABAL_FLAGS) install -v $(CABAL_INSTALL_FLAGS) ./lib
+ledger ledger/install: \
+ cli/unregister \
+ web/unregister \
+ cli/unregister/sandbox \
+ web/unregister/sandbox
+       cabal $(CABAL_FLAGS) install -v $(CABAL_INSTALL_FLAGS) ./ledger
 cli cli/install:
        cabal $(CABAL_FLAGS) install -v $(CABAL_INSTALL_FLAGS) ./cli
 web web/install:
@@ -53,6 +65,8 @@ web web/install:
 clean: lib/clean $(HCOMPTA_INTERFACES:=/clean)
 lib/clean:
        (cd lib && cabal clean)
+ledger/clean:
+       (cd ledger && cabal clean)
 cli/clean:
        (cd cli && cabal clean)
 web/clean:
@@ -64,6 +78,8 @@ web/clean:
 test: $(HCOMPTA_INTERFACES:=/test)
 lib/test:
        (cd lib && cabal $(CABAL_FLAGS) test --show-details=always $(CABAL_TEST_FLAGS))
+ledger/test:
+       (cd ledger && cabal $(CABAL_FLAGS) test --show-details=always $(CABAL_TEST_FLAGS))
 cli/test:
        (cd cli && cabal $(CABAL_FLAGS) test --show-details=always $(CABAL_TEST_FLAGS))
 web/test:
@@ -77,12 +93,11 @@ web/test:
 ###
 .PHONY: doc
 doc: doc/xhtml $(HCOMPTA_INTERFACES:=/doc)
-%/prof: CABAL_INSTALL_FLAGS+=-fprof --enable-library-profiling --enable-executable-profiling
-%/prof: $(CABAL_SANDBOX) %
-       
 
 lib/doc:
        (cd lib && cabal $(CABAL_FLAGS) haddock --hyperlink-source $(CABAL_HADDOCK_FLAGS))
+ledger/doc:
+       (cd ledger && cabal $(CABAL_FLAGS) haddock --hyperlink-source $(CABAL_HADDOCK_FLAGS))
 cli/doc:
        (cd cli && cabal $(CABAL_FLAGS) haddock --hyperlink-source $(CABAL_HADDOCK_FLAGS))
 web/doc:
@@ -108,8 +123,10 @@ doc/%: .
 ##  hlint
 ###
 hlint: $(HCOMPTA_INTERFACES:=/hlint.html)
+%/hlint: %/hlint.html
+       
 %/hlint.html: .
-       hlint \
+       if hlint \
         -i 'Redundant $$' \
         -i 'Redundant bracket' \
         -i 'Redundant do' \
@@ -119,7 +136,9 @@ hlint: $(HCOMPTA_INTERFACES:=/hlint.html)
         -i 'Use String' \
         -i 'Use string literal' \
         --quiet --report="$@" \
-        "$*"/Hcompta && rm -f "$@"
+        "$*"/Hcompta; \
+       then rm -f "$@"; \
+       else echo; echo "BROWSE REPORT AT: file://$(abspath $@)"; fi
 
 #
 ##  prof
@@ -134,11 +153,15 @@ lib/install/prof: CABAL_INSTALL_FLAGS+=-fprof --enable-library-profiling
 lib/install/prof: cli/unregister/sandbox lib/install | $(CABAL_SANDBOX)
        
 
+ledger/install/prof: CABAL_INSTALL_FLAGS+=-fprof --enable-library-profiling
+ledger/install/prof: cli/unregister/sandbox web/unregister/sandbox ledger/install | $(CABAL_SANDBOX)
+       
+
 cli/install/prof: CABAL_INSTALL_FLAGS+=-fprof --enable-library-profiling --enable-executable-profiling
 cli/install/prof: cli/install | $(CABAL_SANDBOX)
        mv \
-        $(CABAL_SANDBOX)/bin/hcompta-cli \
-        $(CABAL_SANDBOX)/bin/hcompta-cli-prof
+        $(CABAL_SANDBOX)/bin/hcompta \
+        $(HCOMPTA_CLI_PROF)
 
 define prof/command