blob: d9ee922c96b01ba054f5654bf940973b5d47665e [file] [log] [blame]
Daniel Jacobowitzfa958512007-01-04 04:22:37 +00001# This file is included several times in a row, once for each element of
2# $(iter-items). On each inclusion, we advance $o to the next element.
3
4o := $(firstword $(iter-items))
5iter-items := $(filter-out $o,$(iter-items))
6
7base := $(basename $(notdir $o))
8
Rainer Orthe4d48a42011-06-21 14:26:13 +00009c_flags-$o := $(c_flags)
10
Daniel Jacobowitzfa958512007-01-04 04:22:37 +000011ifeq ($(suffix $o),.c)
12
13$(base)$(objext): $o
Rainer Orthe4d48a42011-06-21 14:26:13 +000014 $(gcc_compile) $(c_flags-$<) -c $< $(vis_hide)
Daniel Jacobowitzfa958512007-01-04 04:22:37 +000015
16$(base)_s$(objext): $o
Rainer Orthe4d48a42011-06-21 14:26:13 +000017 $(gcc_s_compile) $(c_flags-$<) -c $<
Daniel Jacobowitzfa958512007-01-04 04:22:37 +000018
19else
20
21ifneq ($(suffix $o),.S)
22ifneq ($(suffix $o),.asm)
23$(error Unsupported file type: $o)
24endif
25endif
26
27$(base)$(objext): $o $(base).vis
28 $(gcc_compile) -c -xassembler-with-cpp -include $*.vis $<
29
30$(base).vis: $(base)_s$(objext)
31 $(gen-hide-list)
32
33$(base)_s$(objext): $o
H.J. Lud0aede12008-07-03 19:22:00 +000034 $(gcc_s_compile) -c -xassembler-with-cpp $<
Daniel Jacobowitzfa958512007-01-04 04:22:37 +000035
36endif