Tue, 19 Sep 2017 15:32:53 +0200
removes unusedFunction check for now (we may add it later to get a further indicator for test coverage)
olaf@0 | 1 | # |
olaf@0 | 2 | # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. |
olaf@0 | 3 | # |
universe@225 | 4 | # Copyright 2016 Olaf Wintermann. All rights reserved. |
olaf@0 | 5 | # |
olaf@0 | 6 | # Redistribution and use in source and binary forms, with or without |
olaf@0 | 7 | # modification, are permitted provided that the following conditions are met: |
olaf@0 | 8 | # |
olaf@0 | 9 | # 1. Redistributions of source code must retain the above copyright |
olaf@0 | 10 | # notice, this list of conditions and the following disclaimer. |
olaf@0 | 11 | # |
olaf@0 | 12 | # 2. Redistributions in binary form must reproduce the above copyright |
olaf@0 | 13 | # notice, this list of conditions and the following disclaimer in the |
olaf@0 | 14 | # documentation and/or other materials provided with the distribution. |
olaf@0 | 15 | # |
olaf@0 | 16 | # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" |
olaf@0 | 17 | # AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE |
olaf@0 | 18 | # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE |
olaf@0 | 19 | # ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE |
olaf@0 | 20 | # LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR |
olaf@0 | 21 | # CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF |
olaf@0 | 22 | # SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS |
olaf@0 | 23 | # INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN |
olaf@0 | 24 | # CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) |
olaf@0 | 25 | # ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE |
olaf@0 | 26 | # POSSIBILITY OF SUCH DAMAGE. |
olaf@0 | 27 | # |
olaf@0 | 28 | |
olaf@0 | 29 | |
olaf@0 | 30 | # |
olaf@0 | 31 | # available configurations: |
universe@155 | 32 | # clang |
universe@155 | 33 | # gcc |
universe@157 | 34 | # mingw |
universe@155 | 35 | # osx |
universe@155 | 36 | # suncc |
olaf@0 | 37 | # |
olaf@0 | 38 | |
universe@152 | 39 | CONF=gcc |
universe@152 | 40 | PREFIX=/usr/local |
olaf@0 | 41 | |
olaf@0 | 42 | include $(CONF).mk |
universe@246 | 43 | include cppcheck.mk |
olaf@0 | 44 | |
olaf@154 | 45 | all: ucx test |
olaf@154 | 46 | |
olaf@0 | 47 | ucx: FORCE |
universe@155 | 48 | cd ucx; $(MAKE) CONF=$(CONF) |
universe@155 | 49 | |
universe@155 | 50 | ucx-debug: FORCE |
universe@155 | 51 | cd ucx; $(MAKE) CONF=$(CONF) debug |
olaf@0 | 52 | |
universe@228 | 53 | test: ucx FORCE |
universe@155 | 54 | cd test; $(MAKE) CONF=$(CONF) |
universe@155 | 55 | |
universe@228 | 56 | test-debug: ucx-debug FORCE |
universe@155 | 57 | cd test; $(MAKE) CONF=$(CONF) debug |
olaf@0 | 58 | |
universe@213 | 59 | run: test |
universe@155 | 60 | ./build/release/test/ucxtest$(APP_EXT) |
universe@155 | 61 | |
universe@213 | 62 | run-debug: test-debug |
universe@155 | 63 | ./build/debug/test/ucxtest$(APP_EXT) |
universe@155 | 64 | |
universe@155 | 65 | debug: ucx-debug test-debug |
olaf@0 | 66 | |
universe@230 | 67 | install: ucx $(DESTDIR)$(PREFIX)/lib $(DESTDIR)$(PREFIX)/include/ucx |
universe@230 | 68 | cp ./build/release/libucx$(LIB_EXT) $(DESTDIR)$(PREFIX)/lib && \ |
universe@230 | 69 | cp ./build/release/libucx$(SO_EXT) $(DESTDIR)$(PREFIX)/lib && \ |
universe@230 | 70 | cp ./ucx/*.h $(DESTDIR)$(PREFIX)/include/ucx |
universe@152 | 71 | |
universe@152 | 72 | uninstall: |
universe@230 | 73 | $(RM) $(RMFLAGS) $(DESTDIR)$(PREFIX)/include/ucx &&\ |
universe@230 | 74 | $(RM) $(RMFLAGS) $(DESTDIR)$(PREFIX)/lib/libucx$(LIB_EXT) &&\ |
universe@230 | 75 | $(RM) $(RMFLAGS) $(DESTDIR)$(PREFIX)/lib/libucx$(SO_EXT) |
universe@152 | 76 | |
universe@230 | 77 | $(DESTDIR)$(PREFIX)/lib: |
universe@230 | 78 | mkdir -p $@ |
universe@152 | 79 | |
universe@230 | 80 | $(DESTDIR)$(PREFIX)/include/ucx: |
universe@230 | 81 | mkdir -p $@ |
universe@152 | 82 | |
olaf@0 | 83 | clean: FORCE |
universe@152 | 84 | $(RM) $(RMFLAGS) build |
universe@246 | 85 | |
universe@246 | 86 | build: |
universe@246 | 87 | mkdir -p build |
universe@246 | 88 | |
universe@246 | 89 | cppcheck: FORCE build |
universe@246 | 90 | truncate -s0 $(CPPCHECK_LOG) |
universe@246 | 91 | cd ucx; $(MAKE) CONF=$(CONF) cppcheck |
universe@246 | 92 | @echo "Static code analysis complete. See $(CPPCHECK_LOG) for the results." |
olaf@0 | 93 | |
olaf@0 | 94 | FORCE: |
olaf@0 | 95 |