1# 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# $(iter-labels) and $(iter-flags) are also advanced.
4# This works similar to $(srcdir)/siditi-object.mk.
5
6o := $(firstword $(iter-items))
7iter-items := $(filter-out $o,$(iter-items))
8
9$o-label := $(firstword $(iter-labels))
10iter-labels := $(wordlist 2,$(words $(iter-labels)),$(iter-labels))
11
12$o-flag := $(firstword $(iter-flags))
13iter-flags := $(wordlist 2,$(words $(iter-flags)),$(iter-flags))
14
15$o$(objext): %$(objext): $(srcdir)/config/avr/lib2funcs.c
16	$(gcc_compile) -DL_$($*-label) -DL_LABEL=$($*-label) $($*-flag) \
17		-c $< $(vis_hide)
18
19ifeq ($(enable_shared),yes)
20$(o)_s$(objext): %_s$(objext): $(srcdir)/config/avr/lib2funcs.c
21	$(gcc_s_compile) -DL_$($*-label) -DL_LABEL=$($*-label) $($*-flag) \
22		-c $<
23endif
24