tests/Makefile

Wed, 20 Dec 2023 17:57:18 +0100

author
Mike Becker <universe@uap-core.de>
date
Wed, 20 Dec 2023 17:57:18 +0100
changeset 767
d31f4d4075dc
parent 766
e59b76889f00
child 768
0e1cf2cd500e
permissions
-rw-r--r--

migrate utils tests - relates to #342

753
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff changeset
1 # Copyright 2023 Mike Becker. All rights reserved.
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff changeset
2 #
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff changeset
3 # Redistribution and use in source and binary forms, with or without
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff changeset
4 # modification, are permitted provided that the following conditions are met:
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff changeset
5 #
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff changeset
6 # 1. Redistributions of source code must retain the above copyright
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff changeset
7 # notice, this list of conditions and the following disclaimer.
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff changeset
8 #
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff changeset
9 # 2. Redistributions in binary form must reproduce the above copyright
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff changeset
10 # notice, this list of conditions and the following disclaimer in the
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff changeset
11 # documentation and/or other materials provided with the distribution.
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff changeset
12 #
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff changeset
13 # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff changeset
14 # AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff changeset
15 # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff changeset
16 # DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff changeset
17 # FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff changeset
18 # DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff changeset
19 # SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff changeset
20 # CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff changeset
21 # OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff changeset
22 # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff changeset
23
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff changeset
24 include ../config.mk
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff changeset
25
766
e59b76889f00 bring back UCX test - fixes #341
Mike Becker <universe@uap-core.de>
parents: 756
diff changeset
26 CFLAGS += -I../src
e59b76889f00 bring back UCX test - fixes #341
Mike Becker <universe@uap-core.de>
parents: 756
diff changeset
27
754
4bc7d966c9db add an uwproj based install target
Mike Becker <universe@uap-core.de>
parents: 753
diff changeset
28 TEST_DIR=$(build_dir)/tests
753
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff changeset
29
767
d31f4d4075dc migrate utils tests - relates to #342
Mike Becker <universe@uap-core.de>
parents: 766
diff changeset
30 SRC = test_utils.c ucxtest.c
766
e59b76889f00 bring back UCX test - fixes #341
Mike Becker <universe@uap-core.de>
parents: 756
diff changeset
31
e59b76889f00 bring back UCX test - fixes #341
Mike Becker <universe@uap-core.de>
parents: 756
diff changeset
32 OBJ_EXT=.o
e59b76889f00 bring back UCX test - fixes #341
Mike Becker <universe@uap-core.de>
parents: 756
diff changeset
33 OBJ=$(SRC:%.c=$(TEST_DIR)/%$(OBJ_EXT))
753
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff changeset
34
766
e59b76889f00 bring back UCX test - fixes #341
Mike Becker <universe@uap-core.de>
parents: 756
diff changeset
35 all: $(TEST_DIR) $(TEST_DIR)/ucxtest
e59b76889f00 bring back UCX test - fixes #341
Mike Becker <universe@uap-core.de>
parents: 756
diff changeset
36
767
d31f4d4075dc migrate utils tests - relates to #342
Mike Becker <universe@uap-core.de>
parents: 766
diff changeset
37 $(TEST_DIR)/ucxtest: $(OBJ) $(build_dir)/libucx_static.a
766
e59b76889f00 bring back UCX test - fixes #341
Mike Becker <universe@uap-core.de>
parents: 756
diff changeset
38 $(CC) -o $@ $+
e59b76889f00 bring back UCX test - fixes #341
Mike Becker <universe@uap-core.de>
parents: 756
diff changeset
39
e59b76889f00 bring back UCX test - fixes #341
Mike Becker <universe@uap-core.de>
parents: 756
diff changeset
40 $(build_dir)/libucx_static.a:
e59b76889f00 bring back UCX test - fixes #341
Mike Becker <universe@uap-core.de>
parents: 756
diff changeset
41 test -f "$@"
753
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff changeset
42
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents:
diff changeset
43 $(TEST_DIR):
766
e59b76889f00 bring back UCX test - fixes #341
Mike Becker <universe@uap-core.de>
parents: 756
diff changeset
44 $(MKDIR) $@
e59b76889f00 bring back UCX test - fixes #341
Mike Becker <universe@uap-core.de>
parents: 756
diff changeset
45
e59b76889f00 bring back UCX test - fixes #341
Mike Becker <universe@uap-core.de>
parents: 756
diff changeset
46 FORCE:
e59b76889f00 bring back UCX test - fixes #341
Mike Becker <universe@uap-core.de>
parents: 756
diff changeset
47
e59b76889f00 bring back UCX test - fixes #341
Mike Becker <universe@uap-core.de>
parents: 756
diff changeset
48 $(TEST_DIR)/test_map_generics$(OBJ_EXT): test_map_generics.c \
e59b76889f00 bring back UCX test - fixes #341
Mike Becker <universe@uap-core.de>
parents: 756
diff changeset
49 test_map_generics.h ../src/cx/map.h ../src/cx/common.h \
e59b76889f00 bring back UCX test - fixes #341
Mike Becker <universe@uap-core.de>
parents: 756
diff changeset
50 ../src/cx/collection.h ../src/cx/allocator.h ../src/cx/iterator.h \
e59b76889f00 bring back UCX test - fixes #341
Mike Becker <universe@uap-core.de>
parents: 756
diff changeset
51 ../src/cx/string.h ../src/cx/hash_key.h ../src/cx/hash_map.h \
e59b76889f00 bring back UCX test - fixes #341
Mike Becker <universe@uap-core.de>
parents: 756
diff changeset
52 ../src/cx/map.h
e59b76889f00 bring back UCX test - fixes #341
Mike Becker <universe@uap-core.de>
parents: 756
diff changeset
53 @echo "Compiling $<"
e59b76889f00 bring back UCX test - fixes #341
Mike Becker <universe@uap-core.de>
parents: 756
diff changeset
54 $(CC) -o $@ $(CFLAGS) -c $<
e59b76889f00 bring back UCX test - fixes #341
Mike Becker <universe@uap-core.de>
parents: 756
diff changeset
55
767
d31f4d4075dc migrate utils tests - relates to #342
Mike Becker <universe@uap-core.de>
parents: 766
diff changeset
56 $(TEST_DIR)/test_utils$(OBJ_EXT): test_utils.c ../src/cx/test.h \
d31f4d4075dc migrate utils tests - relates to #342
Mike Becker <universe@uap-core.de>
parents: 766
diff changeset
57 ../src/cx/utils.h ../src/cx/common.h ../src/cx/buffer.h \
d31f4d4075dc migrate utils tests - relates to #342
Mike Becker <universe@uap-core.de>
parents: 766
diff changeset
58 ../src/cx/allocator.h ../src/szmul.c
766
e59b76889f00 bring back UCX test - fixes #341
Mike Becker <universe@uap-core.de>
parents: 756
diff changeset
59 @echo "Compiling $<"
e59b76889f00 bring back UCX test - fixes #341
Mike Becker <universe@uap-core.de>
parents: 756
diff changeset
60 $(CC) -o $@ $(CFLAGS) -c $<
e59b76889f00 bring back UCX test - fixes #341
Mike Becker <universe@uap-core.de>
parents: 756
diff changeset
61
767
d31f4d4075dc migrate utils tests - relates to #342
Mike Becker <universe@uap-core.de>
parents: 766
diff changeset
62 $(TEST_DIR)/ucxtest$(OBJ_EXT): ucxtest.c ../src/cx/test.h
766
e59b76889f00 bring back UCX test - fixes #341
Mike Becker <universe@uap-core.de>
parents: 756
diff changeset
63 @echo "Compiling $<"
e59b76889f00 bring back UCX test - fixes #341
Mike Becker <universe@uap-core.de>
parents: 756
diff changeset
64 $(CC) -o $@ $(CFLAGS) -c $<
e59b76889f00 bring back UCX test - fixes #341
Mike Becker <universe@uap-core.de>
parents: 756
diff changeset
65

mercurial