summaryrefslogtreecommitdiff
path: root/build-0.3/cxx/gnu/cxx-o.make
blob: 0b751ad0dcbb910b0dbaf53e65c02735d340dcd5 (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
# file      : build/cxx/gnu/cxx-o.make
# copyright : Copyright (c) 2004-2012 Code Synthesis Tools CC
# license   : GNU GPL v2; see accompanying LICENSE file

$(call include-once,$(bld_root)/c/cpp-options.make,$(out_base))
$(call include,$(bld_root)/cxx/gnu/configuration.make)

$(out_base)/%.o: cxx := $(cxx_gnu)
$(out_base)/%.o: cxx_options := $(cxx_gnu_optimization_options) $(cxx_gnu_debugging_options)

#@@ wrong prefix
#
$(out_base)/%.o: expand-cpp-options-impl = \
$(if $1,$(shell sed -e 's%include: \(.*\)%\1%' -e t -e d $1))

$(out_base)/%.o: expand-cpp-options = \
$(call expand-cpp-options-impl,$(filter %.cpp-options,$1))

ifeq ($(out_base),$(src_base))
$(out_base)/%.o: $(src_base)/%.$(cxx_s_suffix)
else
$(out_base)/%.o: $(src_base)/%.$(cxx_s_suffix) | $$(dir $$@).
endif
	$(call message,c++ $<,$(cxx) \
$(cpp_options) $(call expand-cpp-options,$^) $(cxx_pp_extra_options) \
$(cxx_options) $(cxx_pic_options) $(cxx_extra_options) -o $@ -c $<)

ifneq ($(out_base),$(src_base))

$(out_base)/%.o: $(out_base)/%.$(cxx_s_suffix) | $$(dir $$@).
	$(call message,c++ $<,$(cxx) \
$(cpp_options) $(call expand-cpp-options,$^) $(cxx_pp_extra_options) \
$(cxx_options) $(cxx_pic_options) $(cxx_extra_options) -o $@ -c $<)

endif

.PHONY: $(out_base)/%.o.$(cxx_s_suffix).clean

$(out_base)/%.o.$(cxx_s_suffix).clean:
	$(call message,rm $$1,rm -f $$1,$(basename $(basename $@)))