1d3801e724b3959d99517618d608d88d354d96aa
[akaros.git] / tests / dune / Makefrag
1 DUNE_TESTS_DIR = $(TESTS_DIR)/dune
2
3 DUNE_TESTS_CFLAGS += $(CFLAGS_TESTS) -Wunused -Werror
4
5 ALL_DUNE_TEST_FILES := $(wildcard $(DUNE_TESTS_DIR)/*.c)
6
7 DUNE_TESTS_LDLIBS := $(TESTS_LDLIBS) -lelf -liplib -ldl
8
9 DUNE_TESTS_SRCS := $(ALL_DUNE_TEST_FILES)
10
11 DUNE_TESTS_LDDEPENDS := $(DUNE_TESTS_DIR)/%.c
12
13 TESTS_EXECS_C  += $(patsubst $(DUNE_TESTS_DIR)/%.c, \
14                       $(OBJDIR)/$(DUNE_TESTS_DIR)/%, \
15                       $(DUNE_TESTS_SRCS))
16
17 STATIC := $(findstring static,$(DUNE_TESTS_CFLAGS))
18 $(OBJDIR)/$(DUNE_TESTS_DIR)/%: $(DUNE_TESTS_LDDEPENDS)
19         @echo + cc [DUNE_TESTS] $<
20         @mkdir -p $(@D)
21         $(Q)$(CC) $(DUNE_TESTS_CFLAGS) -o $@ $< $(DUNE_TESTS_LDLIBS)
22         @if [ "$(STATIC)" != "static" ]; then \
23                 $(OBJDUMP) -S $@ > $@.asm; \
24                 $(NM) -n $@ > $@.sym; \
25         fi