Add/update tests.
[eruntime.git] / Makefile
blob7047ca22ea3dcda26765468d5827fdbf58f1c260
1 # Top-level Makefile
3 include Makefile.top
5 SUBDIRS = src
6 CLEANDIRS = $(SUBDIRS) tests
8 .PHONY: all all-recursive
9 all: all-recursive
11 all-recursive: $(SUBDIRS)
12 @list='$^'; for dir in $$list; do \
13 echo -e "\\n... Building $$dir";\
14 $(SUBMAKE) -C $$dir || exit 1; \
15 done
17 .PHONY: deps deps-recursive
18 deps: deps-recursive
20 deps-recursive: $(SUBDIRS)
21 @list='$^'; for dir in $$list; do \
22 echo -e "\\n... Generating dependency information for $$dir"; \
23 $(SUBMAKE) -C $$dir deps || exit 1; \
24 done
26 .PHONY: install install-local install-top install-bin install-headers \
27 install-recursive
29 install: install-top install-local install-recursive
30 install-local: install-bin install-headers
32 install-top:
33 @echo -e "\\n... Installing from top-level"
35 install-bin: eruntime-config
36 @dir='$(DESTDIR)$(bindir)'; \
37 $(INSTALL_DIR) $(DESTDIR)$(bindir) || exit 1; \
38 list='$^'; for bin in $$list; do \
39 echo "Installing $(DESTDIR)$(bindir)/$$bin..."; \
40 $(INSTALL_BIN) $$bin $$dir || exit 1; \
41 done
43 install-headers:
44 @$(INSTALL_DIR) $(DESTDIR)$(includedir)/eruntime || exit 1; \
45 list="$$(echo include/eruntime/*.h)"; \
46 [ "$$list" != 'include/eruntime/*.h' ] && { \
47 for hdr in $$list; do \
48 echo "Installing $(DESTDIR)$(includedir)/$$hdr..."; \
49 $(INSTALL_DATA) $$hdr $(DESTDIR)$(includedir)/eruntime \
50 || exit 1; \
51 done; \
54 install-recursive: $(SUBDIRS)
55 @list='$^'; for dir in $$list; do \
56 echo -e "\\n... Installing from $$dir"; \
57 $(SUBMAKE) -C $$dir install || exit 1; \
58 done
60 .PHONY: check
61 check: all tests
62 @echo -e "\\n... Building tests"; \
63 $(SUBMAKE) -C tests all || exit 1; \
64 echo -e "\\n... Running tests"; \
65 $(SUBMAKE) -C tests check
67 .PHONY: clean clean-recursive
68 clean: clean-recursive
70 clean-recursive: $(CLEANDIRS)
71 @echo; list='$^'; \
72 for dir in $$list; do \
73 echo -e "\\n... Cleaning $$dir"; \
74 $(SUBMAKE) -C $$dir clean || exit 1; \
75 done
77 # vim: ts=8 sw=8 noet fdm=marker tw=80