|
1 # Copyright 2023 Mike Becker. All rights reserved. |
|
2 # |
|
3 # Redistribution and use in source and binary forms, with or without |
|
4 # modification, are permitted provided that the following conditions are met: |
|
5 # |
|
6 # 1. Redistributions of source code must retain the above copyright |
|
7 # notice, this list of conditions and the following disclaimer. |
|
8 # |
|
9 # 2. Redistributions in binary form must reproduce the above copyright |
|
10 # notice, this list of conditions and the following disclaimer in the |
|
11 # documentation and/or other materials provided with the distribution. |
|
12 # |
|
13 # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" |
|
14 # AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE |
|
15 # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE |
|
16 # DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE |
|
17 # FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL |
|
18 # DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR |
|
19 # SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER |
|
20 # CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, |
|
21 # OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
|
22 # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
|
23 |
|
24 include config.mk |
|
25 |
|
26 all: compile |
|
27 |
|
28 install: |
|
29 @cd src && $(MAKE) -s install |
|
30 |
|
31 dist: FORCE |
|
32 $(MKDIR) $(DIST_DIR)/libucx |
|
33 $(COPYALL) CHANGELOG configure COPYING Doxyfile Makefile README \ |
|
34 uaplogo.png docs make src tests $(DIST_DIR)/libucx/ |
|
35 @cd $(DIST_DIR) && tar -czf libucx-src-$(VERSION).tar.gz -Hustar libucx |
|
36 @echo "[ Dist created: $(DIST_DIR)/libucx-src-$(VERSION).tar.gz ]" |
|
37 |
|
38 clean: |
|
39 $(RMDIR) $(BUILD_DIR) |
|
40 |
|
41 dist-clean: |
|
42 $(RMDIR) $(DIST_DIR) |
|
43 $(RMDIR) $(BUILD_DIR) |
|
44 |
|
45 compile: $(BUILD_DIR) static shared |
|
46 |
|
47 $(BUILD_DIR): |
|
48 $(MKDIR) $@ |
|
49 |
|
50 shared: FORCE |
|
51 @cd src && $(MAKE) OBJ_EXT=.shared.o \ |
|
52 CFLAGS="$(CFLAGS) $(SHLIB_CFLAGS)" \ |
|
53 LDFLAGS="$(LDFLAGS) $(SHLIB_LDFLAGS)" \ |
|
54 shared |
|
55 |
|
56 static: FORCE |
|
57 @cd src && $(MAKE) static |
|
58 |
|
59 check: test-compile FORCE |
|
60 $(BUILD_DIR)/tests/ucxtest |
|
61 |
|
62 test-compile: |
|
63 @(test "$(WITH_TESTS)" = "yes" && cd tests && $(MAKE)) \ |
|
64 || echo "[ Tests disabled - skipped ]" |
|
65 |
|
66 docs: FORCE |
|
67 @(test "$(WITH_DOCS_API)" = "yes" && cd docs && $(MAKE) all-api) \ |
|
68 || echo "[ Generation of API Docs disabled - skipped ]" |
|
69 @(test "$(WITH_DOCS_HTML)" = "yes" && cd docs && $(MAKE) all-html) \ |
|
70 || echo "[ Generation of HTML Docs disabled - skipped ]" |
|
71 |
|
72 FORCE: |