tests/Makefile

changeset 766
e59b76889f00
parent 756
0b635553b86a
child 767
d31f4d4075dc
equal deleted inserted replaced
765:b5128bb44459 766:e59b76889f00
21 # OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 21 # OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
22 # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 22 # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
23 23
24 include ../config.mk 24 include ../config.mk
25 25
26 CFLAGS += -I../src
27
26 TEST_DIR=$(build_dir)/tests 28 TEST_DIR=$(build_dir)/tests
27 29
28 all: $(TEST_DIR) $(build_dir)/libucx_static.a 30 SRC = test_utils.c ucxtest.o
29 cd $(TEST_DIR) && $(CMAKE) -DSTLIB_EXT="$(STLIB_EXT)" "$(src_dir)/tests" && $(CMAKE) --build .
30 @echo "[ Tests complete ]"
31 31
32 # do not define libucx.a target - if it wasn't build, we simply fail! 32 OBJ_EXT=.o
33 OBJ=$(SRC:%.c=$(TEST_DIR)/%$(OBJ_EXT))
34
35 all: $(TEST_DIR) $(TEST_DIR)/ucxtest
36
37 $(TEST_DIR)/ucxtest: $(build_dir)/libucx_static.a $(OBJ)
38 $(CC) -o $@ $+
39
40 $(build_dir)/libucx_static.a:
41 test -f "$@"
33 42
34 $(TEST_DIR): 43 $(TEST_DIR):
35 $(MKDIR) $@ 44 $(MKDIR) $@
45
46 FORCE:
47
48 $(TEST_DIR)/test_map_generics$(OBJ_EXT): test_map_generics.c \
49 test_map_generics.h ../src/cx/map.h ../src/cx/common.h \
50 ../src/cx/collection.h ../src/cx/allocator.h ../src/cx/iterator.h \
51 ../src/cx/string.h ../src/cx/hash_key.h ../src/cx/hash_map.h \
52 ../src/cx/map.h
53 @echo "Compiling $<"
54 $(CC) -o $@ $(CFLAGS) -c $<
55
56 $(TEST_DIR)/test_utils$(OBJ_EXT): test_utils.c test_utils.h \
57 ../src/cx/test.h
58 @echo "Compiling $<"
59 $(CC) -o $@ $(CFLAGS) -c $<
60
61 $(TEST_DIR)/ucxtest$(OBJ_EXT): ucxtest.c test_utils.h ../src/cx/test.h
62 @echo "Compiling $<"
63 $(CC) -o $@ $(CFLAGS) -c $<
64

mercurial