blob: efac7973b2c7f3a4c7fc7eb587bda31193eb5bd1 [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
Bernd Schmidt738f2522014-11-10 16:12:42 +000027as_flags-$o := -xassembler$(if $(filter .S,$(suffix $o)),-with-cpp)
28
Daniel Jacobowitzfa958512007-01-04 04:22:37 +000029$(base)$(objext): $o $(base).vis
Bernd Schmidt738f2522014-11-10 16:12:42 +000030 $(gcc_compile) -c $(as_flags-$<) -include $*.vis $<
Daniel Jacobowitzfa958512007-01-04 04:22:37 +000031
32$(base).vis: $(base)_s$(objext)
33 $(gen-hide-list)
34
35$(base)_s$(objext): $o
Bernd Schmidt738f2522014-11-10 16:12:42 +000036 $(gcc_s_compile) -c $(as_flags-$<) $<
Daniel Jacobowitzfa958512007-01-04 04:22:37 +000037
38endif