make/makefile.mk

changeset 791
945ee9bf2dd1
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/make/makefile.mk	Tue Jan 02 23:31:00 2024 +0100
     1.3 @@ -0,0 +1,72 @@
     1.4 +# Copyright 2023 Mike Becker. All rights reserved.
     1.5 +#
     1.6 +# Redistribution and use in source and binary forms, with or without
     1.7 +# modification, are permitted provided that the following conditions are met:
     1.8 +#
     1.9 +# 1. Redistributions of source code must retain the above copyright
    1.10 +# notice, this list of conditions and the following disclaimer.
    1.11 +#
    1.12 +# 2. Redistributions in binary form must reproduce the above copyright
    1.13 +# notice, this list of conditions and the following disclaimer in the
    1.14 +# documentation and/or other materials provided with the distribution.
    1.15 +#
    1.16 +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
    1.17 +# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
    1.18 +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
    1.19 +# DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
    1.20 +# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
    1.21 +# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
    1.22 +# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
    1.23 +# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
    1.24 +# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
    1.25 +# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
    1.26 +
    1.27 +include config.mk
    1.28 +
    1.29 +dist: FORCE
    1.30 +	$(MKDIR) $(dist_dir)/libucx
    1.31 +	$(COPYALL) CHANGELOG configure COPYING Doxyfile Makefile README \
    1.32 +		uaplogo.png docs make src tests $(dist_dir)/libucx/
    1.33 +	@cd $(dist_dir) && tar -czf libucx-src-$(VERSION).tar.gz -Hustar libucx
    1.34 +	@echo "[ Dist created: $(dist_dir)/libucx-src-$(VERSION).tar.gz ]"
    1.35 +
    1.36 +clean: FORCE
    1.37 +	$(RMDIR) $(build_dir)
    1.38 +
    1.39 +dist-clean: FORCE
    1.40 +	$(RMDIR) $(dist_dir)
    1.41 +	$(RMDIR) $(build_dir)
    1.42 +
    1.43 +compile: static shared
    1.44 +
    1.45 +$(build_dir):
    1.46 +	$(MKDIR) $@
    1.47 +
    1.48 +shared: $(build_dir) FORCE
    1.49 +	@cd src && $(MAKE) OBJ_EXT=.shared.o \
    1.50 +		CFLAGS="$(CFLAGS) $(SHLIB_CFLAGS)" \
    1.51 +		LDFLAGS="$(LDFLAGS) $(SHLIB_LDFLAGS)" \
    1.52 +		shared
    1.53 +
    1.54 +static: $(build_dir) FORCE
    1.55 +	@cd src && $(MAKE) static
    1.56 +
    1.57 +check: test-compile FORCE
    1.58 +	$(RMFILE) $(build_dir)/*.gcda
    1.59 +	$(RMFILE) $(build_dir)/tests/*.gcda
    1.60 +	$(build_dir)/tests/ucxtest
    1.61 +
    1.62 +test-compile: static FORCE
    1.63 +	cd tests && $(MAKE)
    1.64 +
    1.65 +docs: FORCE
    1.66 +	@(test "$(WITH_DOCS_API)" = "yes" && cd docs && $(MAKE) all-api) \
    1.67 +		|| echo "[ Generation of API Docs disabled - skipped ]"
    1.68 +	@(test "$(WITH_DOCS_HTML)" = "yes" && cd docs && $(MAKE) all-html) \
    1.69 +		|| echo "[ Generation of HTML Docs disabled - skipped ]"
    1.70 +
    1.71 +update-rules: FORCE
    1.72 +	make/update-rules.sh src
    1.73 +	CFLAGS='$(CFLAGS) -I../src' make/update-rules.sh tests '$$(TEST_DIR)'
    1.74 +
    1.75 +FORCE:

mercurial