1# file      : examples/cxx/hello/libhello/test/makefile
2# copyright : Copyright (c) 2004-2012 Code Synthesis Tools CC
3# license   : GNU GPL v2; see accompanying LICENSE file
4
5include $(dir $(lastword $(MAKEFILE_LIST)))../build/bootstrap.make
6
7cxx_tun := driver.cxx
8cxx_obj := $(addprefix $(out_base)/,$(cxx_tun:.cxx=.o))
9cxx_od  := $(cxx_obj:.o=.o.d)
10
11hello.l             := $(out_root)/libhello/hello.l
12hello.l.cpp-options := $(out_root)/libhello/hello.l.cpp-options
13
14driver  := $(out_base)/driver
15clean   := $(out_base)/.clean
16test    := $(out_base)/.test
17
18
19# Build.
20#
21$(driver): $(cxx_obj) $(hello.l)
22
23$(cxx_obj) $(cxx_od): $(hello.l.cpp-options)
24
25$(call -include,$(cxx_od))
26
27
28# Test.
29#
30.PHONY: $(test)
31
32$(test): $(driver)
33	$<
34
35
36# Clean.
37#
38.PHONY: $(clean)
39
40$(clean): $(driver).o.clean          \
41  $(addsuffix .cxx.clean,$(cxx_obj)) \
42  $(addsuffix .cxx.clean,$(cxx_od))
43
44
45# Aliases.
46#
47ifdef %interactive%
48
49.PHONY: clean test
50
51test: $(test)
52clean: $(clean)
53
54endif
55
56
57# How to.
58#
59$(call include,$(bld_root)/cxx/o-e.make)
60$(call include,$(bld_root)/cxx/cxx-o.make)
61$(call include,$(bld_root)/cxx/cxx-d.make)
62
63
64# Import build rules.
65#
66$(call import,$(src_root)/libhello/makefile)
67