Stray ) in the install targets removed
[akaros.git] / tests / Makefrag
1 TESTS_DIR = tests
2
3 OBJDIRS += $(TESTS_DIR)
4
5 TESTS_CFLAGS += $(USER_CFLAGS)
6
7 ALL_TEST_FILES = $(shell ls $(TESTS_DIR)/*.c)
8
9 TESTS_LDLIBS := -lpthread -lparlib
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
21 STATIC := $(findstring static,$(TESTS_CFLAGS))
22 $(OBJDIR)/$(TESTS_DIR)/%: $(TESTS_LDDEPENDS)
23         @echo + cc [TESTS] $<
24         @mkdir -p $(@D)
25         $(V)$(CC) $(TESTS_CFLAGS) -o $@ $(TESTS_LDFLAGS) \
26                   $< $(TESTS_LDLIBS)
27         @if [ "$(STATIC)" != "static" ]; then \
28                 $(OBJDUMP) -S $@ > $@.asm; \
29                 $(NM) -n $@ > $@.sym; \
30         fi
31
32 install-tests: $(TESTS_EXECS)
33         @echo + install [TESTS] $(FIRST_INITRAMFS_PATH)/bin/
34         $(V)for i in "$(TESTS_EXECS)"; \
35         do \
36           cp $$i $(FIRST_INITRAMFS_PATH)/bin/; \
37         done;