depolymerization

wire gateway for Bitcoin/Ethereum
Log | Files | Refs | Submodules | README | LICENSE

makefile (2020B)


      1 # This Makefile has been placed under the public domain
      2 -include .config.mk
      3 
      4 # Defaults for an unconfigured tree.  .config.mk is included above, so whatever
      5 # ./configure resolved wins over these; a plain `make` without ./configure still
      6 # works and uses whichever cargo is on $PATH.  No rustup required either way.
      7 cargo ?= cargo
      8 prefix ?= /usr/local
      9 
     10 # Absolute DESTDIR or empty string if DESTDIR unset/empty
     11 abs_destdir=$(abspath $(DESTDIR))
     12 
     13 share_dir=$(abs_destdir)$(prefix)/share
     14 man_dir=$(share_dir)/man
     15 bin_dir=$(abs_destdir)$(prefix)/bin
     16 lib_dir=$(abs_destdir)$(prefix)/lib
     17 
     18 all: build
     19 
     20 .PHONY: build
     21 build:
     22 	$(cargo) build --release --bin depolymerizer-bitcoin
     23 
     24 .PHONY: install-files
     25 install-files:
     26 	install -m 644 -D -t $(share_dir)/depolymerizer-bitcoin/config.d depolymerizer-bitcoin/depolymerizer-bitcoin.conf
     27 	install -m 644 -D -t $(share_dir)/depolymerizer-bitcoin/sql depolymerizer-common/db/versioning.sql 
     28 	install -m 644 -D -t $(share_dir)/depolymerizer-bitcoin/sql depolymerizer-bitcoin/db/depolymerizer-bitcoin*.sql
     29 	install -m 644 -D -t $(man_dir)/man1 doc/prebuilt/man/depolymerizer-bitcoin.1
     30 	install -m 644 -D -t $(man_dir)/man5 doc/prebuilt/man/depolymerizer-bitcoin.conf.5
     31 	install -D -t $(bin_dir) contrib/depolymerizer-bitcoin-dbconfig
     32 
     33 .PHONY: install
     34 install: build install-files
     35 	install -D -t $(bin_dir) target/release/depolymerizer-bitcoin
     36 
     37 .PHONY: check
     38 check: install-files
     39 	$(cargo) test
     40 
     41 .PHONY: test
     42 test: install-files
     43 	RUST_BACKTRACE=true $(cargo) run --profile dev --bin testbench -- instrumentation
     44 
     45 .PHONY: doc
     46 doc:
     47 	$(cargo) doc
     48 
     49 .PHONY: deb
     50 deb:
     51 	dpkg-buildpackage -b -uc -us $(if $(DEB_HOST_ARCH),-a$(DEB_HOST_ARCH))
     52 
     53 .PHONY: ci
     54 ci:
     55 	contrib/ci/run-all-jobs.sh
     56 
     57 .PHONY: fmt
     58 fmt:
     59 	rustfmt-unstable --apply
     60 
     61 
     62 .PHONY: coverage-cyclos
     63 coverage:
     64 	$(cargo) llvm-cov clean --workspace
     65 	$(cargo) llvm-cov test --no-clean
     66 	$(cargo) llvm-cov run --bin btc-harness --no-clean -- logic
     67 	$(cargo) llvm-cov report --html