notif_pending short circuits handle_events()
[akaros.git] / tests / Makefrag
1 TESTS_DIR = tests
2
3 OBJDIRS += $(TESTS_DIR)
4
5 TESTS_CFLAGS += $(USER_CFLAGS) -g
6
7 ALL_TEST_FILES = $(shell ls $(TESTS_DIR)/*.c)
8
9 TESTS_LDLIBS := -lpthread
10
11 TESTS_SRCS := $(ALL_TEST_FILES)
12
13 TESTS_LDDEPENDS := $(TESTS_DIR)/%.c 
14
15 TESTS_EXECS  = $(patsubst $(TESTS_DIR)/%.c, \
16                            $(OBJDIR)/$(TESTS_DIR)/%, \
17                            $(TESTS_SRCS))
18
19 include $(TESTS_DIR)/c3po/Makefrag
20 include $(TESTS_DIR)/openmp/Makefrag
21
22 STATIC := $(findstring static,$(TESTS_CFLAGS))
23 $(OBJDIR)/$(TESTS_DIR)/%: $(TESTS_LDDEPENDS)
24         @echo + cc [TESTS] $<
25         @mkdir -p $(@D)
26         $(V)$(CC) $(TESTS_CFLAGS) -o $@ $(TESTS_LDFLAGS) \
27                   $< $(TESTS_LDLIBS)
28         @if [ "$(STATIC)" != "static" ]; then \
29                 $(OBJDUMP) -S $@ > $@.asm; \
30                 $(NM) -n $@ > $@.sym; \
31         fi
32
33 install-tests: $(TESTS_EXECS)
34         @echo + install [TESTS] $(FIRST_INITRAMFS_PATH)/bin/
35         $(V)for i in "$(TESTS_EXECS)"; \
36         do \
37           cp $$i $(FIRST_INITRAMFS_PATH)/bin/; \
38         done;