Makefile (1357B)
1 # This Makefile has been placed under the public domain 2 3 # Written by ./configure; sets 'prefix' and 'cargo'. The leading '-' keeps it 4 # optional and it is included BEFORE the '?=' defaults below, so a configured 5 # tree wins while a plain 'make' in an unconfigured tree still builds. 6 -include build-system/config.mk 7 8 # The Rust toolchain to build with. Any cargo on $PATH works -- the 9 # distribution's cargo package, a rustup-managed one, or an explicit override: 10 # make build cargo=/opt/rust/bin/cargo 11 cargo ?= cargo 12 prefix ?= /usr/local 13 14 # Absolute DESTDIR or empty string if DESTDIR unset/empty 15 abs_destdir=$(abspath $(DESTDIR)) 16 17 man_dir=$(abs_destdir)$(prefix)/share/man 18 bin_dir=$(abs_destdir)$(prefix)/bin 19 20 all: build 21 22 .PHONY: check 23 check: 24 $(cargo) test 25 26 .PHONY: build 27 build: 28 $(cargo) build --release 29 30 .PHONY: install 31 install: build 32 install -D -t $(bin_dir) target/release/robocop 33 install -D -t $(bin_dir) robocop-ch-to-json 34 install -D -t $(bin_dir) robocop-eu-to-json 35 install -D -t $(bin_dir) robocop-un-to-json 36 install -D -t $(bin_dir) robocop-ofac-to-json 37 install -D -t $(bin_dir) robocop-uk-to-json 38 install -D -t $(bin_dir) robocop-json-postprocess 39 install -m 644 -D doc/prebuilt/man/robocop.1 $(man_dir)/man1 40 41 .PHONY: doc 42 doc: 43 $(cargo) doc 44 45 .PHONY: deb 46 deb: 47 dpkg-buildpackage -b -uc -us 48 49 .PHONY: ci 50 ci: 51 contrib/ci/run-all-jobs.sh