summaryrefslogtreecommitdiffstats
path: root/scripts/Makefile.lib
diff options
context:
space:
mode:
authorMichal Marek <mmarek@suse.cz>2011-06-23 23:00:16 +0200
committerMichal Marek <mmarek@suse.cz>2011-06-23 23:00:16 +0200
commit5e05981b5b79afb42adb754c558ee050092d2d85 (patch)
treeb9bbdea5a3d95cb759f48fb3c1dd8faa6bfd3f82 /scripts/Makefile.lib
parent2e483528cebad089d0bb3f9aebb0ada22d968ffa (diff)
parentedfc86aadad371b76d95b11d0bc8eb36c2376d1e (diff)
downloadtalos-op-linux-5e05981b5b79afb42adb754c558ee050092d2d85.tar.gz
talos-op-linux-5e05981b5b79afb42adb754c558ee050092d2d85.zip
Merge branch 'kbuild-implicit-parser-rule' of git://github.com/lacombar/linux-2.6 into kbuild/kbuild
Diffstat (limited to 'scripts/Makefile.lib')
-rw-r--r--scripts/Makefile.lib40
1 files changed, 39 insertions, 1 deletions
diff --git a/scripts/Makefile.lib b/scripts/Makefile.lib
index 93b2b5938a2e..aeea84a24836 100644
--- a/scripts/Makefile.lib
+++ b/scripts/Makefile.lib
@@ -160,13 +160,51 @@ ld_flags = $(LDFLAGS) $(ldflags-y)
modname-multi = $(sort $(foreach m,$(multi-used),\
$(if $(filter $(subst $(obj)/,,$*.o), $($(m:.o=-objs)) $($(m:.o=-y))),$(m:.o=))))
+ifdef REGENERATE_PARSERS
+
+# GPERF
+# ---------------------------------------------------------------------------
+quiet_cmd_gperf = GPERF $@
+ cmd_gperf = gperf -t --output-file $@ -a -C -E -g -k 1,3,$$ -p -t $<
+
+$(src)/%.hash.c_shipped: $(src)/%.gperf
+ $(call cmd,gperf)
+
+# LEX
+# ---------------------------------------------------------------------------
+LEX_PREFIX = $(if $(LEX_PREFIX_${baseprereq}),$(LEX_PREFIX_${baseprereq}),yy)
+
+quiet_cmd_flex = LEX $@
+ cmd_flex = flex -o$@ -L -P $(LEX_PREFIX) $<
+
+$(src)/%.lex.c_shipped: $(src)/%.l
+ $(call cmd,flex)
+
+# YACC
+# ---------------------------------------------------------------------------
+YACC_PREFIX = $(if $(YACC_PREFIX_${baseprereq}),$(YACC_PREFIX_${baseprereq}),yy)
+
+quiet_cmd_bison = YACC $@
+ cmd_bison = bison -o$@ -t -l -p $(YACC_PREFIX) $<
+
+$(src)/%.tab.c_shipped: $(src)/%.y
+ $(call cmd,bison)
+
+quiet_cmd_bison_h = YACC $@
+ cmd_bison_h = bison -o/dev/null --defines=$@ -t -l -p $(YACC_PREFIX) $<
+
+$(src)/%.tab.h_shipped: $(src)/%.y
+ $(call cmd,bison_h)
+
+endif
+
# Shipped files
# ===========================================================================
quiet_cmd_shipped = SHIPPED $@
cmd_shipped = cat $< > $@
-$(obj)/%:: $(src)/%_shipped
+$(obj)/%: $(src)/%_shipped
$(call cmd,shipped)
# Commands useful for building a boot image
OpenPOWER on IntegriCloud