Tue, 02 Jan 2024 23:31:00 +0100
generate (release) config.mk if none exists - fixes #350
Makefile | file | annotate | diff | comparison | revisions | |
make/makefile.mk | file | annotate | diff | comparison | revisions |
1.1 --- a/Makefile Mon Jan 01 16:43:18 2024 +0100 1.2 +++ b/Makefile Tue Jan 02 23:31:00 2024 +0100 1.3 @@ -21,61 +21,40 @@ 1.4 # OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 1.5 # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 1.6 1.7 -include config.mk 1.8 - 1.9 all: compile test-compile FORCE 1.10 1.11 -install: 1.12 +install: config.mk FORCE 1.13 @cd src && $(MAKE) install 1.14 1.15 -dist: FORCE 1.16 - $(MKDIR) $(dist_dir)/libucx 1.17 - $(COPYALL) CHANGELOG configure COPYING Doxyfile Makefile README \ 1.18 - uaplogo.png docs make src tests $(dist_dir)/libucx/ 1.19 - @cd $(dist_dir) && tar -czf libucx-src-$(VERSION).tar.gz -Hustar libucx 1.20 - @echo "[ Dist created: $(dist_dir)/libucx-src-$(VERSION).tar.gz ]" 1.21 +dist: config.mk FORCE 1.22 + $(MAKE) -f make/makefile.mk dist 1.23 1.24 -clean: 1.25 - $(RMDIR) $(build_dir) 1.26 +clean: config.mk FORCE 1.27 + $(MAKE) -f make/makefile.mk clean 1.28 1.29 -dist-clean: 1.30 - $(RMDIR) $(dist_dir) 1.31 - $(RMDIR) $(build_dir) 1.32 +dist-clean: config.mk FORCE 1.33 + $(MAKE) -f make/makefile.mk dist-clean 1.34 1.35 -compile: $(build_dir) static shared 1.36 +compile: config.mk FORCE 1.37 + $(MAKE) -f make/makefile.mk compile 1.38 1.39 -$(build_dir): 1.40 - $(MKDIR) $@ 1.41 +test-compile: config.mk FORCE 1.42 + $(MAKE) -f make/makefile.mk test-compile 1.43 1.44 -shared: FORCE 1.45 - @cd src && $(MAKE) OBJ_EXT=.shared.o \ 1.46 - CFLAGS="$(CFLAGS) $(SHLIB_CFLAGS)" \ 1.47 - LDFLAGS="$(LDFLAGS) $(SHLIB_LDFLAGS)" \ 1.48 - shared 1.49 - 1.50 -static: FORCE 1.51 - @cd src && $(MAKE) static 1.52 - 1.53 -check: all 1.54 - $(RMFILE) $(build_dir)/*.gcda 1.55 - $(RMFILE) $(build_dir)/tests/*.gcda 1.56 - $(build_dir)/tests/ucxtest 1.57 +check: config.mk FORCE 1.58 + $(MAKE) -f make/makefile.mk check 1.59 1.60 check-coverage: FORCE 1.61 $(MAKE) -s check 1.62 @cd src && $(MAKE) check-coverage 1.63 1.64 -test-compile: 1.65 - cd tests && $(MAKE) 1.66 +docs: config.mk FORCE 1.67 + $(MAKE) -f make/makefile.mk docs 1.68 1.69 -docs: FORCE 1.70 - @(test "$(WITH_DOCS_API)" = "yes" && cd docs && $(MAKE) all-api) \ 1.71 - || echo "[ Generation of API Docs disabled - skipped ]" 1.72 - @(test "$(WITH_DOCS_HTML)" = "yes" && cd docs && $(MAKE) all-html) \ 1.73 - || echo "[ Generation of HTML Docs disabled - skipped ]" 1.74 +update-rules: config.mk FORCE 1.75 + $(MAKE) -f make/makefile.mk update-rules 1.76 1.77 -update-rules: 1.78 - make/update-rules.sh src 1.79 - CFLAGS='$(CFLAGS) -I../src' make/update-rules.sh tests '$$(TEST_DIR)' 1.80 +config.mk: 1.81 + ./configure --release 1.82 1.83 FORCE:
2.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 2.2 +++ b/make/makefile.mk Tue Jan 02 23:31:00 2024 +0100 2.3 @@ -0,0 +1,72 @@ 2.4 +# Copyright 2023 Mike Becker. All rights reserved. 2.5 +# 2.6 +# Redistribution and use in source and binary forms, with or without 2.7 +# modification, are permitted provided that the following conditions are met: 2.8 +# 2.9 +# 1. Redistributions of source code must retain the above copyright 2.10 +# notice, this list of conditions and the following disclaimer. 2.11 +# 2.12 +# 2. Redistributions in binary form must reproduce the above copyright 2.13 +# notice, this list of conditions and the following disclaimer in the 2.14 +# documentation and/or other materials provided with the distribution. 2.15 +# 2.16 +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 2.17 +# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 2.18 +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 2.19 +# DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE 2.20 +# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 2.21 +# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 2.22 +# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 2.23 +# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 2.24 +# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 2.25 +# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 2.26 + 2.27 +include config.mk 2.28 + 2.29 +dist: FORCE 2.30 + $(MKDIR) $(dist_dir)/libucx 2.31 + $(COPYALL) CHANGELOG configure COPYING Doxyfile Makefile README \ 2.32 + uaplogo.png docs make src tests $(dist_dir)/libucx/ 2.33 + @cd $(dist_dir) && tar -czf libucx-src-$(VERSION).tar.gz -Hustar libucx 2.34 + @echo "[ Dist created: $(dist_dir)/libucx-src-$(VERSION).tar.gz ]" 2.35 + 2.36 +clean: FORCE 2.37 + $(RMDIR) $(build_dir) 2.38 + 2.39 +dist-clean: FORCE 2.40 + $(RMDIR) $(dist_dir) 2.41 + $(RMDIR) $(build_dir) 2.42 + 2.43 +compile: static shared 2.44 + 2.45 +$(build_dir): 2.46 + $(MKDIR) $@ 2.47 + 2.48 +shared: $(build_dir) FORCE 2.49 + @cd src && $(MAKE) OBJ_EXT=.shared.o \ 2.50 + CFLAGS="$(CFLAGS) $(SHLIB_CFLAGS)" \ 2.51 + LDFLAGS="$(LDFLAGS) $(SHLIB_LDFLAGS)" \ 2.52 + shared 2.53 + 2.54 +static: $(build_dir) FORCE 2.55 + @cd src && $(MAKE) static 2.56 + 2.57 +check: test-compile FORCE 2.58 + $(RMFILE) $(build_dir)/*.gcda 2.59 + $(RMFILE) $(build_dir)/tests/*.gcda 2.60 + $(build_dir)/tests/ucxtest 2.61 + 2.62 +test-compile: static FORCE 2.63 + cd tests && $(MAKE) 2.64 + 2.65 +docs: FORCE 2.66 + @(test "$(WITH_DOCS_API)" = "yes" && cd docs && $(MAKE) all-api) \ 2.67 + || echo "[ Generation of API Docs disabled - skipped ]" 2.68 + @(test "$(WITH_DOCS_HTML)" = "yes" && cd docs && $(MAKE) all-html) \ 2.69 + || echo "[ Generation of HTML Docs disabled - skipped ]" 2.70 + 2.71 +update-rules: FORCE 2.72 + make/update-rules.sh src 2.73 + CFLAGS='$(CFLAGS) -I../src' make/update-rules.sh tests '$$(TEST_DIR)' 2.74 + 2.75 +FORCE: