source: branches/reconfiguration/modules/vci_cc_vcache_wrapper/caba/test/simple_wdt_test/Makefile @ 852

Last change on this file since 852 was 852, checked in by cfuguet, 10 years ago

reconf: including test recipe in unit tests makefiles

  • The execution and result verification are performed by using the 'make test' command
File size: 2.9 KB
Line 
1# =============================================================================
2# \file      Makefile
3# \author    Cesar Fuguet
4# \date      July 9, 2014
5# =============================================================================
6include ../common.mk
7
8# =============================================================================
9# Include files paths
10# =============================================================================
11
12CONFDIR ?= output
13CONF    := $(addprefix $(CONFDIR)/config/, hard_config.h)
14
15INCLUDE += -I$(CONFDIR)/config
16
17# =============================================================================
18# Utils library
19# =============================================================================
20
21LIB_SRCS   := stdio.c            \
22              string.c           \
23              tty.c              \
24              simhelper.c
25
26LIB_OBJS   := $(addprefix $(BUILD_DIR)/,\
27                  $(subst .c,.o, $(notdir $(LIB_SRCS))))
28
29LIB_TARGET := $(BUILD_DIR)/libutils.a
30
31# =============================================================================
32# Object files
33# =============================================================================
34
35S_SRCS := reset.S
36C_SRCS := main.c
37
38OBJS   := $(addprefix $(BUILD_DIR)/,\
39              $(subst .c,.o, $(notdir $(C_SRCS))) \
40              $(subst .S,.o, $(notdir $(S_SRCS))))
41
42TARGET := $(BUILD_DIR)/soft.elf
43
44# =============================================================================
45# Test variables
46# =============================================================================
47PLATFORM  := ../../../../../platforms/tsar_generic_iob
48SIMULATOR := $(PLATFORM)/simul.x
49
50# batch mode => no xterm or frame buffer windows
51SOCLIB_TTY := FILES
52SOCLIB_FB  := HEADLESS
53SOCLIB_GDB ?=
54export SOCLIB_TTY SOCLIB_FB SOCLIB_GDB
55
56# =============================================================================
57# Makefile rules
58# =============================================================================
59
60all: $(TARGET)
61
62# Specific dependencies
63# NOTE: normal prerequisites | order-only prerequisites
64# SEE: http://www.gnu.org/software/make/manual/make.html#Prerequisite-Types
65
66$(LIB_OBJS): $(CONF) | $(BUILD_DIR)
67$(OBJS): $(CONF) | $(BUILD_DIR)
68
69$(LIB_TARGET): $(LIB_OBJS)
70        $(AR) rcs $@ $(LIB_OBJS)
71
72$(TARGET): $(OBJS) ../soft.ld $(LIB_TARGET)
73        $(LD) -o $@ -T ../soft.ld $(OBJS) -L$(BUILD_DIR) -lutils
74        $(DU) -D $@ > $@.txt
75
76test: $(SIMULATOR) $(TARGET)
77        -$< -SOFT $(TARGET) -DISK /dev/null 2> /dev/null >> $(CONFDIR)/log
78        -soclib-cleanup-terms &> /dev/null
79        mv term0 $(CONFDIR)/term
80        grep -q "success" $(CONFDIR)/term
81        if [ $$? == 0 ]; then \
82                echo $$(basename $(PWD)) ": Success"; \
83        else \
84                echo $$(basename $(PWD)) ": Failure"; \
85        fi;
86
87$(SIMULATOR) $(CONF): $(PLATFORM)/scripts/onerun.py
88        ./$< -o $(CONFDIR) -p $(PLATFORM) -x1 -y1 -n1 -c
89
90$(BUILD_DIR):
91        $(MKDIR) $@
92
93clean:
94        $(RM) $(BUILD_DIR)
95
96clean-log:
97        $(RM) $(CONFDIR)
98
99distclean: clean clean-log
Note: See TracBrowser for help on using the repository browser.