2 # Copyright (c) 2013 Vojtech Horky
5 # Redistribution and use in source and binary forms, with or without
6 # modification, are permitted provided that the following conditions
9 # - Redistributions of source code must retain the above copyright
10 # notice, this list of conditions and the following disclaimer.
11 # - Redistributions in binary form must reproduce the above copyright
12 # notice, this list of conditions and the following disclaimer in the
13 # documentation and/or other materials provided with the distribution.
14 # - The name of the author may not be used to endorse or promote products
15 # derived from this software without specific prior written permission.
17 # THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
18 # IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
19 # OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
20 # IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
21 # INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
22 # NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
23 # DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
24 # THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25 # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
26 # THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
29 TEST_DEPS
= $(TEST_BASE
)tested.o
32 $(TEST_BASE
)alloc.
$(EXE_EXT
) \
33 $(TEST_BASE
)asserts.
$(EXE_EXT
) \
34 $(TEST_BASE
)errno.
$(EXE_EXT
) \
35 $(TEST_BASE
)manytests.
$(EXE_EXT
) \
36 $(TEST_BASE
)multisuite.
$(EXE_EXT
) \
37 $(TEST_BASE
)null.
$(EXE_EXT
) \
38 $(TEST_BASE
)nullteardown.
$(EXE_EXT
) \
39 $(TEST_BASE
)printing.
$(EXE_EXT
) \
40 $(TEST_BASE
)simple.
$(EXE_EXT
) \
41 $(TEST_BASE
)skip.
$(EXE_EXT
) \
42 $(TEST_BASE
)suites.
$(EXE_EXT
) \
43 $(TEST_BASE
)teardown.
$(EXE_EXT
) \
44 $(TEST_BASE
)timeout.
$(EXE_EXT
)
46 check-build
: $(TEST_APPS
)
48 .PRECIOUS
: $(TEST_BASE
)tested.o
51 rm -f
$(TEST_BASE
)*.o
$(TEST_BASE
)*.pcut.c
$(TEST_BASE
)*.
$(EXE_EXT
) $(TEST_BASE
)*.got
53 $(TEST_BASE
)%.
$(EXE_EXT
): $(TEST_DEPS
)
54 $(LD
) -o
$@
$^
$(TEST_LDFLAGS
)
56 $(TEST_BASE
)alloc.
$(EXE_EXT
): $(TEST_BASE
)alloc.o
$(PCUT_LIB
)
57 $(TEST_BASE
)asserts.
$(EXE_EXT
): $(TEST_BASE
)asserts.o
$(PCUT_LIB
)
58 $(TEST_BASE
)errno.
$(EXE_EXT
): $(TEST_BASE
)errno.o
$(PCUT_LIB
)
59 $(TEST_BASE
)manytests.
$(EXE_EXT
): $(TEST_BASE
)manytests.o
$(PCUT_LIB
)
60 $(TEST_BASE
)multisuite.
$(EXE_EXT
): $(TEST_BASE
)suite_all.o
$(TEST_BASE
)suite1.o
$(TEST_BASE
)suite2.o
$(PCUT_LIB
)
61 $(TEST_BASE
)null.
$(EXE_EXT
): $(TEST_BASE
)null.o
$(PCUT_LIB
)
62 $(TEST_BASE
)nullteardown.
$(EXE_EXT
): $(TEST_BASE
)nullteardown.o
$(PCUT_LIB
)
63 $(TEST_BASE
)printing.
$(EXE_EXT
): $(TEST_BASE
)printing.o
$(PCUT_LIB
)
64 $(TEST_BASE
)simple.
$(EXE_EXT
): $(TEST_BASE
)simple.o
$(PCUT_LIB
)
65 $(TEST_BASE
)skip.
$(EXE_EXT
): $(TEST_BASE
)skip.o
$(PCUT_LIB
)
66 $(TEST_BASE
)suites.
$(EXE_EXT
): $(TEST_BASE
)suites.o
$(PCUT_LIB
)
67 $(TEST_BASE
)teardown.
$(EXE_EXT
): $(TEST_BASE
)teardown.o
$(PCUT_LIB
)
68 $(TEST_BASE
)timeout.
$(EXE_EXT
): $(TEST_BASE
)timeout.o
$(PCUT_LIB
)
71 ifeq ($(NEEDS_PREPROC
),y
)
72 $(TEST_BASE
)%.o
: $(TEST_BASE
)%.pcut.c
73 $(CC
) -c
-o
$@
$(TEST_CFLAGS
) $<
75 $(TEST_BASE
)%.pcut.c
: $(TEST_BASE
)%.c
$(PCUT_PREPROC
)
76 $(CC
) -E
$(TEST_CFLAGS
) $< |
$(PCUT_PREPROC
) >$@
78 $(TEST_BASE
)%.o
: $(TEST_BASE
)%.c
79 $(CC
) -c
-o
$@
$(TEST_CFLAGS
) $<