# result of such a transformation to the sources of this language. Then, if the
# source-to-source compiler also creates duplicate files of other formats
# (i.e. yacc/bison also produce accompanying .h files), add them to the list of
-# source files that this makefile can generate ('$1_MKSRC'), to later be deleted
+# source files that this makefile can generate ('$1_TARGETS'), to later be deleted
# during the clean rule.
$(foreach srcl,$($1_SRCL),\
-$(eval $1_MKSRC := $(shell find -name "*.$(srcl)" \
-| sed -e 's@^\(.*\).$(srcl)@\1$($(srcl)_STEM:%=.%).$1@g' -e 's@\./@@'))\
-$(eval $1_SOURCES += $($1_MKSRC))\
-$(eval $(srcl)_SOURCES += $($1_MKSRC))\
-$(if $($(srcl)_DUP),\
-$(eval $1_SOURCES += $($1_MKSRC:%.$1=%.$($(srcl)_DUP))))\
+$(eval $(srcl)_SOURCES := $(shell find -name "*.$(srcl)" | \
+sed -e 's@^\(.*\).$(srcl)@\1$($(srcl)_STEM:%=.%).$1@g' -e 's@\./@@'))\
+$(eval $1_SOURCES += $($(srcl)_SOURCES))\
+$(eval $(srcl)_TARGETS += $($(srcl)_SOURCES:%.$(srcl)=.$1))\
+$(foreach dup,$($(srcl)_DUP),\
+$(eval $(srcl)_TARGETS += $($(srcl)_TARGETS:%.$1=%.$(dup)))\
)
$(eval $1_DRV_SRC := $(filter $(DRIVER_DIR)/%,$($1_SOURCES)))
# sources (yacc, etc)
$(foreach module,$(MODULES),\
$(eval $(call MODULE_ARCRULE,$(module)))\
-$(eval YS += $(wildcard $(module)/*.y))\
)
# Create lang-specific rules for producing final (linked) targets
$(eval $(call SRCLANG_TRGLANG_BUILDRULE,$(srcl),$(lang))))))
clean:
- rm -f $(foreach lang,$(LANGS),$($(lang)_TARGETS) $($(lang)_MKSRC))
+ rm$(foreach lang,$(LANGS),$(foreach srclang,$($(lang)_SRCL), $($(srclang)_TARGETS)) $($(lang)_TARGETS))
scrub: clean
rm -Rf $(MAKE_DIRS)