File: Makefile

package info (click to toggle)
uftrace 0.6.0.20161014-1
  • links: PTS
  • area: main
  • in suites: stretch
  • size: 1,940 kB
  • ctags: 3,404
  • sloc: ansic: 24,586; python: 3,663; makefile: 585; asm: 242; sh: 135; cpp: 117
file content (29 lines) | stat: -rw-r--r-- 863 bytes parent folder | download
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
TEST_CFLAGS  := -D_GNU_SOURCE -DUNIT_TEST -I$(srcdir) -I$(objdir)
TEST_CFLAGS  += -include $(srcdir)/tests/unittest.h
TEST_LDFLAGS := -L$(objdir)/libtraceevent -ltraceevent -lelf -pthread -lrt -ldl

UNIT_TEST_SRC := $(wildcard $(srcdir)/*.c $(srcdir)/utils/*.c)
UNIT_TEST_SRC += $(wildcard $(srcdir)/arch/$(ARCH)/*.c)
UNIT_TEST_OBJ := $(patsubst %.c,%.ot,$(UNIT_TEST_SRC))

include $(srcdir)/config/Makefile.include

test: test_unit test_run

test_run:
	./runtest.py $(TESTARG)

test_unit: unittest
	./unittest $(filter -d,$(TESTARG))

unittest: unittest.c unittest.h $(UNIT_TEST_OBJ)
	$(QUIET_LINK)$(CC) -o $@ $(TEST_CFLAGS) $< $(UNIT_TEST_OBJ) $(TEST_LDFLAGS)

$(UNIT_TEST_OBJ): %.ot: %.c
	$(QUIET_CC)$(CC) -o $@ -c $(TEST_CFLAGS) $^

clean:
	$(call QUIET_CLEAN, test)
	@rm -f *.o *.so *.pyc t-* unittest $(UNIT_TEST_OBJ)

.PHONY: clean test test_run test_unit