aboutsummaryrefslogtreecommitdiff
path: root/build/import/cli/cli-cxx.make
blob: 913ce1ff338000a24b2d0eb48720487e4895d418 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
# file      : build/import/cli/cli-cxx.make
# copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC
# license   : MIT; see accompanying LICENSE file

# Here we are operating in the importing project's space, not in
# cli's.
#

# Get the C++ file extensions.
#
$(call include,$(bld_root)/cxx/configuration-static.make)

cli_pattern :=                \
$(out_base)/%.$(cxx_s_suffix) \
$(out_base)/%.$(cxx_h_suffix) \
$(out_base)/%.$(cxx_i_suffix)

$(cli_pattern): cli_options := \
--hxx-suffix .$(cxx_h_suffix)  \
--ixx-suffix .$(cxx_i_suffix)  \
--cxx-suffix .$(cxx_s_suffix)

.PRECIOUS: $(cli_pattern)

ifeq ($(out_base),$(src_base))

$(cli_pattern): $(src_base)/%.cli
	$(call message,cli $<,$(cli) $(cli_options) --output-dir $(dir $@) $<)

else

$(cli_pattern): $(src_base)/%.cli | $$(dir $$@).
	$(call message,cli $<,$(cli) $(cli_options) --output-dir $(dir $@) $<)

$(cli_pattern): $(out_base)/%.cli | $$(dir $$@).
	$(call message,cli $<,$(cli) $(cli_options) --output-dir $(dir $@) $<)
endif

.PHONY: $(out_base)/%.cxx.cli.clean

$(out_base)/%.cxx.cli.clean: cxx_s_suffix := $(cxx_s_suffix)
$(out_base)/%.cxx.cli.clean: cxx_h_suffix := $(cxx_h_suffix)
$(out_base)/%.cxx.cli.clean: cxx_i_suffix := $(cxx_i_suffix)

$(out_base)/%.cxx.cli.clean:
	$(call message,rm $$1,rm -f $$1,$(@:.cxx.cli.clean=.$(cxx_s_suffix)))
	$(call message,rm $$1,rm -f $$1,$(@:.cxx.cli.clean=.$(cxx_h_suffix)))
	$(call message,rm $$1,rm -f $$1,$(@:.cxx.cli.clean=.$(cxx_i_suffix)))