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