Skip to content

Commit

Permalink
Merge branches 'kbuild', 'packaging' and 'misc' of git://git.kernel.o…
Browse files Browse the repository at this point in the history
…rg/pub/scm/linux/kernel/git/mmarek/kbuild-2.6

* 'kbuild' of git://git.kernel.org/pub/scm/linux/kernel/git/mmarek/kbuild-2.6:
  genksyms: Use same type in loop comparison
  kbuild: silence generated makefile message
  kernel: prevent unnecessary rebuilding due to config_data.gz
  headers_install: fix __packed in exported kernel headers
  dtc: regen parser
  dtc: migrate parser to implicit rules
  kconfig: regen parser
  kconfig: migrate parser to implicit rules
  kconfig/zconf.l: do not ask to generate backup
  kconfig: kill no longer needed reference to YYDEBUG
  kconfig: constify `kconf_id_lookup'
  genksym: regen parser
  genksyms: migrate parser to implicit rules
  genksyms: drop -Wno-uninitialized from HOSTCFLAGS_parse.tab.o
  genksyms: pass hash and lookup functions name and target language though the input file
  kbuild: simplify the %_shipped rule
  kbuild: add implicit rules for parser generation
  kbuild: add `baseprereq'
  kbuild: Fix reference to vermagic.h

* 'packaging' of git://git.kernel.org/pub/scm/linux/kernel/git/mmarek/kbuild-2.6:
  package: Makefile: fix perf target bug

* 'misc' of git://git.kernel.org/pub/scm/linux/kernel/git/mmarek/kbuild-2.6:
  gitignore: ignore debian build directory
  • Loading branch information
torvalds committed Jul 26, 2011
4 parents 14067ff + 1ae1470 + 3bdccc8 + b756828 commit 154dd78
Show file tree
Hide file tree
Showing 30 changed files with 393 additions and 1,052 deletions.
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,11 @@ modules.builtin
/Module.markers
/Module.symvers

#
# Debian directory (make deb-pkg)
#
/debian/

#
# git files that we don't want to ignore even it they are dot-files
#
Expand Down
5 changes: 2 additions & 3 deletions kernel/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -125,11 +125,10 @@ targets += config_data.gz
$(obj)/config_data.gz: $(KCONFIG_CONFIG) FORCE
$(call if_changed,gzip)

quiet_cmd_ikconfiggz = IKCFG $@
cmd_ikconfiggz = (echo "static const char kernel_config_data[] __used = MAGIC_START"; cat $< | scripts/bin2c; echo "MAGIC_END;") > $@
filechk_ikconfiggz = (echo "static const char kernel_config_data[] __used = MAGIC_START"; cat $< | scripts/bin2c; echo "MAGIC_END;")
targets += config_data.h
$(obj)/config_data.h: $(obj)/config_data.gz FORCE
$(call if_changed,ikconfiggz)
$(call filechk,ikconfiggz)

$(obj)/time.o: $(obj)/timeconst.h

Expand Down
4 changes: 4 additions & 0 deletions scripts/Kbuild.include
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,10 @@ depfile = $(subst $(comma),_,$(dot-target).d)
# filename of target with directory and extension stripped
basetarget = $(basename $(notdir $@))

###
# filename of first prerequisite with directory and extension stripped
baseprereq = $(basename $(notdir $<))

###
# Escape single quote for use in echo statements
escsq = $(subst $(squote),'\$(squote)',$1)
Expand Down
40 changes: 39 additions & 1 deletion scripts/Makefile.lib
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion scripts/Makefile.modpost
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@

# Step 3 is used to place certain information in the module's ELF
# section, including information such as:
# Version magic (see include/vermagic.h for full details)
# Version magic (see include/linux/vermagic.h for full details)
# - Kernel release
# - SMP is CONFIG_SMP
# - PREEMPT is CONFIG_PREEMPT
Expand Down
28 changes: 1 addition & 27 deletions scripts/dtc/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -25,31 +25,5 @@ HOSTCFLAGS_dtc-lexer.lex.o := $(HOSTCFLAGS_DTC)
HOSTCFLAGS_dtc-parser.tab.o := $(HOSTCFLAGS_DTC)

# dependencies on generated files need to be listed explicitly
$(obj)/dtc-parser.tab.o: $(obj)/dtc-parser.tab.c $(obj)/dtc-parser.tab.h
$(obj)/dtc-lexer.lex.o: $(obj)/dtc-lexer.lex.c $(obj)/dtc-parser.tab.h
$(obj)/dtc-lexer.lex.o: $(obj)/dtc-parser.tab.h

targets += dtc-parser.tab.c dtc-lexer.lex.c

clean-files += dtc-parser.tab.h

# GENERATE_PARSER := 1 # Uncomment to rebuild flex/bison output

ifdef GENERATE_PARSER

BISON = bison
FLEX = flex

quiet_cmd_bison = BISON $@
cmd_bison = $(BISON) -o$@ -d $<; cp $@ $@_shipped
quiet_cmd_flex = FLEX $@
cmd_flex = $(FLEX) -o$@ $<; cp $@ $@_shipped

$(obj)/dtc-parser.tab.c: $(src)/dtc-parser.y FORCE
$(call if_changed,bison)

$(obj)/dtc-parser.tab.h: $(obj)/dtc-parser.tab.c

$(obj)/dtc-lexer.lex.c: $(src)/dtc-lexer.l FORCE
$(call if_changed,flex)

endif
Loading

0 comments on commit 154dd78

Please sign in to comment.