Revision 9b0a0ba9 Makefile.in

View differences:

Makefile.in
22 22

  
23 23
client=$(addprefix $(exedir)/,@CLIENT@)
24 24
daemon=$(exedir)/bird
25
protocols  = @protocols@
25
protocols=@protocols@
26 26

  
27 27
prefix=@prefix@
28 28
exec_prefix=@exec_prefix@
......
49 49
endif
50 50

  
51 51
# Meta rules
52
cleangoals := clean distclean
53 52
docgoals := docs userdocs progdocs
54
.PHONY: all daemon cli $(cleangoals) $(docgoals) tags
53
testgoals := check test tests tests_run
54
cleangoals := clean distclean testsclean
55
.PHONY: all daemon cli $(docgoals) $(testgoals) $(cleangoals) tags
55 56
all: daemon cli
56 57

  
57 58
daemon: $(daemon)
58 59
cli: $(client)
59 60

  
60 61
# Include directories
61
dirs := client conf doc filter lib nest $(addprefix proto/,$(protocols)) @sysdep_dirs@
62
dirs := client conf doc filter lib nest test $(addprefix proto/,$(protocols)) @sysdep_dirs@
62 63

  
63 64
conf-y-targets := $(addprefix $(objdir)/conf/,cf-parse.y keywords.h commands.h)
64 65
cf-local = $(conf-y-targets): $(s)config.Y
65 66

  
66 67
src-o-files = $(patsubst %.c,$(o)%.o,$(src))
68
tests-target-files = $(patsubst %.c,$(o)%,$(tests_src))
67 69

  
68
all-daemon = $(exedir)/bird: $(obj)
69
all-client = $(exedir)/birdc $(exedir)/birdcl: $(obj)
70
all-daemon = $(daemon): $(obj)
71
all-client = $(client): $(obj)
70 72

  
71 73
s = $(dir $(lastword $(MAKEFILE_LIST)))
72 74
ifeq ($(srcdir),.)
......
109 111
	echo >>$@ "#define PATH_CONTROL_SOCKET \"@CONTROL_SOCKET@\""
110 112
	if test -n "@iproutedir@" ; then echo >>$@ "#define PATH_IPROUTE_DIR \"@iproutedir@\"" ; fi
111 113

  
114
# Unit tests rules
115

  
116
tests_targets_ok = $(addsuffix .ok,$(tests_targets))
117

  
118
$(tests_targets): %: %.o $(tests_objs)
119
	$(E)echo LD $(LDFLAGS) -o $@ $^ $(LIBS)
120
	$(Q)$(CC) $(LDFLAGS) -o $@ $^ $(LIBS)
121

  
122
$(tests_targets_ok): %.ok: %
123
	$(Q)$* 2>/dev/null && touch $*.ok
124

  
125
test: testsclean check
126
check: tests tests_run
127
tests: $(tests_targets)
128
tests_run: $(tests_targets_ok)
129

  
112 130
# Finally include the computed dependencies
113 131

  
114 132
ifneq ($(filter-out $(cleangoals),$(MAKECMDGOALS)),)
......
147 165
	rm -f $(addprefix $(exedir)/,bird birdc birdcl)
148 166
	find $(objdir) -name "*.[od]" -exec rm -f '{}' '+'
149 167

  
168
testsclean:
169
	rm -f $(tests_targets_ok)
170

  
150 171
ifeq ($(objdir),obj)
151 172
distclean: clean
152 173
	rm -rf $(objdir)

Also available in: Unified diff