Skip to content

Commit 154dd78

Browse files
committed
Merge branches 'kbuild', 'packaging' and 'misc' of git://git.kernel.org/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
4 parents 14067ff + 1ae1470 + 3bdccc8 + b756828 commit 154dd78

30 files changed

Lines changed: 393 additions & 1052 deletions

‎.gitignore‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,11 @@ modules.builtin
4545
/Module.markers
4646
/Module.symvers
4747

48+
#
49+
# Debian directory (make deb-pkg)
50+
#
51+
/debian/
52+
4853
#
4954
# git files that we don't want to ignore even it they are dot-files
5055
#

‎kernel/Makefile‎

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -125,11 +125,10 @@ targets += config_data.gz
125125
$(obj)/config_data.gz: $(KCONFIG_CONFIG) FORCE
126126
$(call if_changed,gzip)
127127

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

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

‎scripts/Kbuild.include‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,10 @@ depfile = $(subst $(comma),_,$(dot-target).d)
2020
# filename of target with directory and extension stripped
2121
basetarget = $(basename $(notdir $@))
2222

23+
###
24+
# filename of first prerequisite with directory and extension stripped
25+
baseprereq = $(basename $(notdir $<))
26+
2327
###
2428
# Escape single quote for use in echo statements
2529
escsq = $(subst $(squote),'\$(squote)',$1)

‎scripts/Makefile.lib‎

Lines changed: 39 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -160,13 +160,51 @@ ld_flags = $(LDFLAGS) $(ldflags-y)
160160
modname-multi = $(sort $(foreach m,$(multi-used),\
161161
$(if $(filter $(subst $(obj)/,,$*.o), $($(m:.o=-objs)) $($(m:.o=-y))),$(m:.o=))))
162162

163+
ifdef REGENERATE_PARSERS
164+
165+
# GPERF
166+
# ---------------------------------------------------------------------------
167+
quiet_cmd_gperf = GPERF $@
168+
cmd_gperf = gperf -t --output-file $@ -a -C -E -g -k 1,3,$$ -p -t $<
169+
170+
$(src)/%.hash.c_shipped: $(src)/%.gperf
171+
$(call cmd,gperf)
172+
173+
# LEX
174+
# ---------------------------------------------------------------------------
175+
LEX_PREFIX = $(if $(LEX_PREFIX_${baseprereq}),$(LEX_PREFIX_${baseprereq}),yy)
176+
177+
quiet_cmd_flex = LEX $@
178+
cmd_flex = flex -o$@ -L -P $(LEX_PREFIX) $<
179+
180+
$(src)/%.lex.c_shipped: $(src)/%.l
181+
$(call cmd,flex)
182+
183+
# YACC
184+
# ---------------------------------------------------------------------------
185+
YACC_PREFIX = $(if $(YACC_PREFIX_${baseprereq}),$(YACC_PREFIX_${baseprereq}),yy)
186+
187+
quiet_cmd_bison = YACC $@
188+
cmd_bison = bison -o$@ -t -l -p $(YACC_PREFIX) $<
189+
190+
$(src)/%.tab.c_shipped: $(src)/%.y
191+
$(call cmd,bison)
192+
193+
quiet_cmd_bison_h = YACC $@
194+
cmd_bison_h = bison -o/dev/null --defines=$@ -t -l -p $(YACC_PREFIX) $<
195+
196+
$(src)/%.tab.h_shipped: $(src)/%.y
197+
$(call cmd,bison_h)
198+
199+
endif
200+
163201
# Shipped files
164202
# ===========================================================================
165203

166204
quiet_cmd_shipped = SHIPPED $@
167205
cmd_shipped = cat $< > $@
168206

169-
$(obj)/%:: $(src)/%_shipped
207+
$(obj)/%: $(src)/%_shipped
170208
$(call cmd,shipped)
171209

172210
# Commands useful for building a boot image

‎scripts/Makefile.modpost‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818

1919
# Step 3 is used to place certain information in the module's ELF
2020
# section, including information such as:
21-
# Version magic (see include/vermagic.h for full details)
21+
# Version magic (see include/linux/vermagic.h for full details)
2222
# - Kernel release
2323
# - SMP is CONFIG_SMP
2424
# - PREEMPT is CONFIG_PREEMPT

‎scripts/dtc/Makefile‎

Lines changed: 1 addition & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -25,31 +25,5 @@ HOSTCFLAGS_dtc-lexer.lex.o := $(HOSTCFLAGS_DTC)
2525
HOSTCFLAGS_dtc-parser.tab.o := $(HOSTCFLAGS_DTC)
2626

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

31-
targets += dtc-parser.tab.c dtc-lexer.lex.c
32-
33-
clean-files += dtc-parser.tab.h
34-
35-
# GENERATE_PARSER := 1 # Uncomment to rebuild flex/bison output
36-
37-
ifdef GENERATE_PARSER
38-
39-
BISON = bison
40-
FLEX = flex
41-
42-
quiet_cmd_bison = BISON $@
43-
cmd_bison = $(BISON) -o$@ -d $<; cp $@ $@_shipped
44-
quiet_cmd_flex = FLEX $@
45-
cmd_flex = $(FLEX) -o$@ $<; cp $@ $@_shipped
46-
47-
$(obj)/dtc-parser.tab.c: $(src)/dtc-parser.y FORCE
48-
$(call if_changed,bison)
49-
50-
$(obj)/dtc-parser.tab.h: $(obj)/dtc-parser.tab.c
51-
52-
$(obj)/dtc-lexer.lex.c: $(src)/dtc-lexer.l FORCE
53-
$(call if_changed,flex)
54-
55-
endif

0 commit comments

Comments
 (0)