-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathMakefile
62 lines (44 loc) · 1.71 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
## ======================================================================
## Copyright (c) 2018 Inkblot Software Limited.
##
## This Source Code Form is subject to the terms of the Mozilla Public
## License, v. 2.0. If a copy of the MPL was not distributed with this
## file, You can obtain one at http:##mozilla.org/MPL/2.0/.
## ======================================================================
SHELL=/bin/bash -o pipefail
.DELETE_ON_ERROR:
default: all
## ======================================================================
## User-facing binaries
CXXFLAGS := -g -Wall -Wextra -Werror -std=c++14 -O2
bin/aismmfile_ls: src/aismmfile_ls.cpp include/aismmfile.hpp
@mkdir -p $(dir $@)
c++ $(CXXFLAGS) $< -o $@
bin/aismmfile_mmsi: src/aismmfile_mmsi.cpp include/aismmfile.hpp
@mkdir -p $(dir $@)
c++ $(CXXFLAGS) $< -o $@
bin/run_tests: src/run_tests.cpp include/aismmfile.hpp
@mkdir -p $(dir $@)
c++ $(CXXFLAGS) $< -o $@
## ======================================================================
## System-wide install
### Install prefix; override at 'make' invocation if desired
PREFIX := /usr/local
install: bin/aismmfile_ls bin/aismmfile_mmsi
cp include/aismmfile.hpp $(DESTDIR)$(PREFIX)/include/
cp bin/aismmfile_ls $(DESTDIR)$(PREFIX)/bin
cp bin/aismmfile_mmsi $(DESTDIR)$(PREFIX)/bin
uninstall:
rm -f $(DESTDIR)$(PREFIX)/include/aismmfile.hpp
rm -f $(DESTDIR)$(PREFIX)/bin/aismmfile_ls
rm -f $(DESTDIR)$(PREFIX)/bin/aismmfile_mmsi
## ======================================================================
## Utilities
all: bin/aismmfile_ls \
bin/aismmfile_mmsi \
bin/run_tests
clean:
rm -f bin/run_tests
rm -f bin/aismmfile_ls
run-tests: bin/run_tests
./$< test/testdata.aismmf