build system: Allow using .a archives as source

Change-Id: I1d61971f1458ca7e4257abb6a9c2aa15ac08e1d0
Signed-off-by: Patrick Georgi <pgeorgi@chromium.org>
Reviewed-on: http://review.coreboot.org/10001
Tested-by: build bot (Jenkins)
Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net>
diff --git a/Makefile.inc b/Makefile.inc
index fee227cd..94513d2 100644
--- a/Makefile.inc
+++ b/Makefile.inc
@@ -149,6 +149,16 @@
 en$(EMPTY)def
 endef
 
+# Add handler to deal with archives
+define generic-objs_a_template_gen
+de$(EMPTY)fine $(1)-objs_a_template
+$$(call src-to-obj,$1,$$(1).a): $$(1).a
+	@printf "    CP         $$$$(subst $$$$(obj)/,,$$$$(@))\n"
+	cp $$$$< $$$$@.tmp
+	mv $$$$@.tmp $$$$@
+en$(EMPTY)def
+endef
+
 # Add handler to add no rules for manual files
 define generic-objs_manual_template_gen
 # do nothing