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