File: Makefile

package info (click to toggle)
cgreen 1.6.4-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 2,588 kB
  • sloc: ansic: 12,276; sh: 558; makefile: 474; cpp: 403; python: 181; xml: 33; sed: 13
file content (45 lines) | stat: -rw-r--r-- 1,283 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
# This make file may serve as an example of how to easily build a lot
# of Cgreen test libraries and run them through the runner. By
# structuring it this way only affected libraries need to be rebuilt.
#
# Note that this is not official builds or tests for Cgreen. To do
# that you should go to root directory and do "make unit" or "make
# test"

CFLAGS = -Wall -fPIC -std=c99 -I../include -I.. -I../src

LIBRARY_PATH = ../build/src
ifneq ($(shell uname), Darwin)
LOAD_PATH = LD_LIBRARY_PATH=$(LIBRARY_PATH)
else
LOAD_PATH = DYLD_LIBRARY_PATH=$(LIBRARY_PATH)
endif

TEST_SOURCES = \
	assertion_tests.c \
	breadcrumb_tests.c \
	cdash_reporter_tests.c \
	cgreen_value_tests.c \
	constraint_tests.c \
	cute_reporter_tests.c \
	double_tests.c \
	environment_variables_tests.c \
	message_formatting_tests.c \
	messaging_tests.c \
	mocks_tests.c \
	parameters_tests.c \
	reflective_runner_no_teardown_tests.c \
	reflective_tests.c \
	text_reporter_tests.c \
	unit_tests.c \
	utils_tests.c \
	vector_tests.c \
	xml_reporter_tests.c \

TEST_LIBRARIES = $(patsubst %.c,lib%.so, $(TEST_SOURCES))

all: $(TEST_LIBRARIES)
	cd ..; make --no-print-directory
	$(LOAD_PATH) ../build/tools/cgreen-runner -s unittests $?

lib%_tests.so : %_tests.o ; $(CC) -shared -o $@ $^ -L$(LIBRARY_PATH) -lcgreen