diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2009-12-17 10:23:42 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2009-12-17 10:23:42 -0500 |
commit | 5a865c0606eb44d5d12cabb429751c83712183de (patch) | |
tree | 726d6eaf3b20f30900304bd0cbb6339b423a071f | |
parent | 331d9d5958277de27e6ce42247e1cbec54fd1c7e (diff) | |
parent | 46e75f66677f5094bb51e91f9473128c4e907c7d (diff) |
Merge branch 'for-33' of git://repo.or.cz/linux-kbuild
* 'for-33' of git://repo.or.cz/linux-kbuild: (29 commits)
net: fix for utsrelease.h moving to generated
gen_init_cpio: fixed fwrite warning
kbuild: fix make clean after mismerge
kbuild: generate modules.builtin
genksyms: properly consider EXPORT_UNUSED_SYMBOL{,_GPL}()
score: add asm/asm-offsets.h wrapper
unifdef: update to upstream revision 1.190
kbuild: specify absolute paths for cscope
kbuild: create include/generated in silentoldconfig
scripts/package: deb-pkg: use fakeroot if available
scripts/package: add KBUILD_PKG_ROOTCMD variable
scripts/package: tar-pkg: use tar --owner=root
Kbuild: clean up marker
net: add net_tstamp.h to headers_install
kbuild: move utsrelease.h to include/generated
kbuild: move autoconf.h to include/generated
drop explicit include of autoconf.h
kbuild: move compile.h to include/generated
kbuild: drop include/asm
kbuild: do not check for include/asm-$ARCH
...
Fixed non-conflicting clean merge of modpost.c as per comments from
Stephen Rothwell (modpost.c had grown an include of linux/autoconf.h
that needed to be changed to generated/autoconf.h)
90 files changed, 556 insertions, 401 deletions
diff --git a/.gitignore b/.gitignore index 946c7ec5c922..fb2190c61af0 100644 --- a/.gitignore +++ b/.gitignore | |||
@@ -22,6 +22,7 @@ | |||
22 | *.lst | 22 | *.lst |
23 | *.symtypes | 23 | *.symtypes |
24 | *.order | 24 | *.order |
25 | modules.builtin | ||
25 | *.elf | 26 | *.elf |
26 | *.bin | 27 | *.bin |
27 | *.gz | 28 | *.gz |
@@ -45,14 +46,8 @@ Module.symvers | |||
45 | # | 46 | # |
46 | # Generated include files | 47 | # Generated include files |
47 | # | 48 | # |
48 | include/asm | ||
49 | include/asm-*/asm-offsets.h | ||
50 | include/config | 49 | include/config |
51 | include/linux/autoconf.h | ||
52 | include/linux/compile.h | ||
53 | include/linux/version.h | 50 | include/linux/version.h |
54 | include/linux/utsrelease.h | ||
55 | include/linux/bounds.h | ||
56 | include/generated | 51 | include/generated |
57 | 52 | ||
58 | # stgit generated dirs | 53 | # stgit generated dirs |
diff --git a/Documentation/dontdiff b/Documentation/dontdiff index e151b2a36267..3ad6acead949 100644 --- a/Documentation/dontdiff +++ b/Documentation/dontdiff | |||
@@ -103,6 +103,7 @@ gconf | |||
103 | gen-devlist | 103 | gen-devlist |
104 | gen_crc32table | 104 | gen_crc32table |
105 | gen_init_cpio | 105 | gen_init_cpio |
106 | generated | ||
106 | genheaders | 107 | genheaders |
107 | genksyms | 108 | genksyms |
108 | *_gray256.c | 109 | *_gray256.c |
diff --git a/Documentation/kbuild/kbuild.txt b/Documentation/kbuild/kbuild.txt index bb3bf38f03da..6f8c1cabbc5d 100644 --- a/Documentation/kbuild/kbuild.txt +++ b/Documentation/kbuild/kbuild.txt | |||
@@ -1,3 +1,17 @@ | |||
1 | Output files | ||
2 | |||
3 | modules.order | ||
4 | -------------------------------------------------- | ||
5 | This file records the order in which modules appear in Makefiles. This | ||
6 | is used by modprobe to deterministically resolve aliases that match | ||
7 | multiple modules. | ||
8 | |||
9 | modules.builtin | ||
10 | -------------------------------------------------- | ||
11 | This file lists all modules that are built into the kernel. This is used | ||
12 | by modprobe to not fail when trying to load something builtin. | ||
13 | |||
14 | |||
1 | Environment variables | 15 | Environment variables |
2 | 16 | ||
3 | KCPPFLAGS | 17 | KCPPFLAGS |
diff --git a/Documentation/kbuild/kconfig.txt b/Documentation/kbuild/kconfig.txt index 849b5e56d06f..49efae703979 100644 --- a/Documentation/kbuild/kconfig.txt +++ b/Documentation/kbuild/kconfig.txt | |||
@@ -103,10 +103,16 @@ KCONFIG_AUTOCONFIG | |||
103 | This environment variable can be set to specify the path & name of the | 103 | This environment variable can be set to specify the path & name of the |
104 | "auto.conf" file. Its default value is "include/config/auto.conf". | 104 | "auto.conf" file. Its default value is "include/config/auto.conf". |
105 | 105 | ||
106 | KCONFIG_TRISTATE | ||
107 | -------------------------------------------------- | ||
108 | This environment variable can be set to specify the path & name of the | ||
109 | "tristate.conf" file. Its default value is "include/config/tristate.conf". | ||
110 | |||
106 | KCONFIG_AUTOHEADER | 111 | KCONFIG_AUTOHEADER |
107 | -------------------------------------------------- | 112 | -------------------------------------------------- |
108 | This environment variable can be set to specify the path & name of the | 113 | This environment variable can be set to specify the path & name of the |
109 | "autoconf.h" (header) file. Its default value is "include/linux/autoconf.h". | 114 | "autoconf.h" (header) file. |
115 | Its default value is "include/generated/autoconf.h". | ||
110 | 116 | ||
111 | 117 | ||
112 | ====================================================================== | 118 | ====================================================================== |
@@ -8,7 +8,7 @@ | |||
8 | ##### | 8 | ##### |
9 | # 1) Generate bounds.h | 9 | # 1) Generate bounds.h |
10 | 10 | ||
11 | bounds-file := include/linux/bounds.h | 11 | bounds-file := include/generated/bounds.h |
12 | 12 | ||
13 | always := $(bounds-file) | 13 | always := $(bounds-file) |
14 | targets := $(bounds-file) kernel/bounds.s | 14 | targets := $(bounds-file) kernel/bounds.s |
@@ -43,7 +43,7 @@ $(obj)/$(bounds-file): kernel/bounds.s Kbuild | |||
43 | # 2) Generate asm-offsets.h | 43 | # 2) Generate asm-offsets.h |
44 | # | 44 | # |
45 | 45 | ||
46 | offsets-file := include/asm/asm-offsets.h | 46 | offsets-file := include/generated/asm-offsets.h |
47 | 47 | ||
48 | always += $(offsets-file) | 48 | always += $(offsets-file) |
49 | targets += $(offsets-file) | 49 | targets += $(offsets-file) |
diff --git a/MAINTAINERS b/MAINTAINERS index 0699782f8c5b..efd2ef2c2660 100644 --- a/MAINTAINERS +++ b/MAINTAINERS | |||
@@ -5434,6 +5434,12 @@ F: drivers/uwb/* | |||
5434 | F: include/linux/uwb.h | 5434 | F: include/linux/uwb.h |
5435 | F: include/linux/uwb/ | 5435 | F: include/linux/uwb/ |
5436 | 5436 | ||
5437 | UNIFDEF | ||
5438 | M: Tony Finch <dot@dotat.at> | ||
5439 | W: http://dotat.at/prog/unifdef | ||
5440 | S: Maintained | ||
5441 | F: scripts/unifdef.c | ||
5442 | |||
5437 | UNIFORM CDROM DRIVER | 5443 | UNIFORM CDROM DRIVER |
5438 | M: Jens Axboe <axboe@kernel.dk> | 5444 | M: Jens Axboe <axboe@kernel.dk> |
5439 | W: http://www.kernel.dk | 5445 | W: http://www.kernel.dk |
@@ -334,10 +334,9 @@ CFLAGS_GCOV = -fprofile-arcs -ftest-coverage | |||
334 | 334 | ||
335 | # Use LINUXINCLUDE when you must reference the include/ directory. | 335 | # Use LINUXINCLUDE when you must reference the include/ directory. |
336 | # Needed to be compatible with the O= option | 336 | # Needed to be compatible with the O= option |
337 | LINUXINCLUDE := -Iinclude \ | 337 | LINUXINCLUDE := -I$(srctree)/arch/$(hdr-arch)/include -Iinclude \ |
338 | $(if $(KBUILD_SRC),-Iinclude2 -I$(srctree)/include) \ | 338 | $(if $(KBUILD_SRC), -I$(srctree)/include) \ |
339 | -I$(srctree)/arch/$(hdr-arch)/include \ | 339 | -include include/generated/autoconf.h |
340 | -include include/linux/autoconf.h | ||
341 | 340 | ||
342 | KBUILD_CPPFLAGS := -D__KERNEL__ | 341 | KBUILD_CPPFLAGS := -D__KERNEL__ |
343 | 342 | ||
@@ -465,7 +464,7 @@ ifeq ($(KBUILD_EXTMOD),) | |||
465 | # Carefully list dependencies so we do not try to build scripts twice | 464 | # Carefully list dependencies so we do not try to build scripts twice |
466 | # in parallel | 465 | # in parallel |
467 | PHONY += scripts | 466 | PHONY += scripts |
468 | scripts: scripts_basic include/config/auto.conf | 467 | scripts: scripts_basic include/config/auto.conf include/config/tristate.conf |
469 | $(Q)$(MAKE) $(build)=$(@) | 468 | $(Q)$(MAKE) $(build)=$(@) |
470 | 469 | ||
471 | # Objects we will link into vmlinux / subdirs we need to visit | 470 | # Objects we will link into vmlinux / subdirs we need to visit |
@@ -492,18 +491,18 @@ $(KCONFIG_CONFIG) include/config/auto.conf.cmd: ; | |||
492 | # with it and forgot to run make oldconfig. | 491 | # with it and forgot to run make oldconfig. |
493 | # if auto.conf.cmd is missing then we are probably in a cleaned tree so | 492 | # if auto.conf.cmd is missing then we are probably in a cleaned tree so |
494 | # we execute the config step to be sure to catch updated Kconfig files | 493 | # we execute the config step to be sure to catch updated Kconfig files |
495 | include/config/auto.conf: $(KCONFIG_CONFIG) include/config/auto.conf.cmd | 494 | include/config/%.conf: $(KCONFIG_CONFIG) include/config/auto.conf.cmd |
496 | $(Q)$(MAKE) -f $(srctree)/Makefile silentoldconfig | 495 | $(Q)$(MAKE) -f $(srctree)/Makefile silentoldconfig |
497 | else | 496 | else |
498 | # external modules needs include/linux/autoconf.h and include/config/auto.conf | 497 | # external modules needs include/generated/autoconf.h and include/config/auto.conf |
499 | # but do not care if they are up-to-date. Use auto.conf to trigger the test | 498 | # but do not care if they are up-to-date. Use auto.conf to trigger the test |
500 | PHONY += include/config/auto.conf | 499 | PHONY += include/config/auto.conf |
501 | 500 | ||
502 | include/config/auto.conf: | 501 | include/config/auto.conf: |
503 | $(Q)test -e include/linux/autoconf.h -a -e $@ || ( \ | 502 | $(Q)test -e include/generated/autoconf.h -a -e $@ || ( \ |
504 | echo; \ | 503 | echo; \ |
505 | echo " ERROR: Kernel configuration is invalid."; \ | 504 | echo " ERROR: Kernel configuration is invalid."; \ |
506 | echo " include/linux/autoconf.h or $@ are missing."; \ | 505 | echo " include/generated/autoconf.h or $@ are missing.";\ |
507 | echo " Run 'make oldconfig && make prepare' on kernel src to fix it."; \ | 506 | echo " Run 'make oldconfig && make prepare' on kernel src to fix it."; \ |
508 | echo; \ | 507 | echo; \ |
509 | /bin/false) | 508 | /bin/false) |
@@ -877,6 +876,9 @@ $(sort $(vmlinux-init) $(vmlinux-main)) $(vmlinux-lds): $(vmlinux-dirs) ; | |||
877 | PHONY += $(vmlinux-dirs) | 876 | PHONY += $(vmlinux-dirs) |
878 | $(vmlinux-dirs): prepare scripts | 877 | $(vmlinux-dirs): prepare scripts |
879 | $(Q)$(MAKE) $(build)=$@ | 878 | $(Q)$(MAKE) $(build)=$@ |
879 | ifdef CONFIG_MODULES | ||
880 | $(Q)$(MAKE) $(modbuiltin)=$@ | ||
881 | endif | ||
880 | 882 | ||
881 | # Build the kernel release string | 883 | # Build the kernel release string |
882 | # | 884 | # |
@@ -955,7 +957,6 @@ PHONY += prepare archprepare prepare0 prepare1 prepare2 prepare3 | |||
955 | # prepare3 is used to check if we are building in a separate output directory, | 957 | # prepare3 is used to check if we are building in a separate output directory, |
956 | # and if so do: | 958 | # and if so do: |
957 | # 1) Check that make has not been executed in the kernel src $(srctree) | 959 | # 1) Check that make has not been executed in the kernel src $(srctree) |
958 | # 2) Create the include2 directory, used for the second asm symlink | ||
959 | prepare3: include/config/kernel.release | 960 | prepare3: include/config/kernel.release |
960 | ifneq ($(KBUILD_SRC),) | 961 | ifneq ($(KBUILD_SRC),) |
961 | @$(kecho) ' Using $(srctree) as source for kernel' | 962 | @$(kecho) ' Using $(srctree) as source for kernel' |
@@ -964,17 +965,13 @@ ifneq ($(KBUILD_SRC),) | |||
964 | echo " in the '$(srctree)' directory.";\ | 965 | echo " in the '$(srctree)' directory.";\ |
965 | /bin/false; \ | 966 | /bin/false; \ |
966 | fi; | 967 | fi; |
967 | $(Q)if [ ! -d include2 ]; then \ | ||
968 | mkdir -p include2; \ | ||
969 | ln -fsn $(srctree)/include/asm-$(SRCARCH) include2/asm; \ | ||
970 | fi | ||
971 | endif | 968 | endif |
972 | 969 | ||
973 | # prepare2 creates a makefile if using a separate output directory | 970 | # prepare2 creates a makefile if using a separate output directory |
974 | prepare2: prepare3 outputmakefile | 971 | prepare2: prepare3 outputmakefile |
975 | 972 | ||
976 | prepare1: prepare2 include/linux/version.h include/linux/utsrelease.h \ | 973 | prepare1: prepare2 include/linux/version.h include/generated/utsrelease.h \ |
977 | include/asm include/config/auto.conf | 974 | include/config/auto.conf |
978 | $(cmd_crmodverdir) | 975 | $(cmd_crmodverdir) |
979 | 976 | ||
980 | archprepare: prepare1 scripts_basic | 977 | archprepare: prepare1 scripts_basic |
@@ -986,42 +983,6 @@ prepare0: archprepare FORCE | |||
986 | # All the preparing.. | 983 | # All the preparing.. |
987 | prepare: prepare0 | 984 | prepare: prepare0 |
988 | 985 | ||
989 | # The asm symlink changes when $(ARCH) changes. | ||
990 | # Detect this and ask user to run make mrproper | ||
991 | # If asm is a stale symlink (point to dir that does not exist) remove it | ||
992 | define check-symlink | ||
993 | set -e; \ | ||
994 | if [ -L include/asm ]; then \ | ||
995 | asmlink=`readlink include/asm | cut -d '-' -f 2`; \ | ||
996 | if [ "$$asmlink" != "$(SRCARCH)" ]; then \ | ||
997 | echo "ERROR: the symlink $@ points to asm-$$asmlink but asm-$(SRCARCH) was expected"; \ | ||
998 | echo " set ARCH or save .config and run 'make mrproper' to fix it"; \ | ||
999 | exit 1; \ | ||
1000 | fi; \ | ||
1001 | test -e $$asmlink || rm include/asm; \ | ||
1002 | elif [ -d include/asm ]; then \ | ||
1003 | echo "ERROR: $@ is a directory but a symlink was expected";\ | ||
1004 | exit 1; \ | ||
1005 | fi | ||
1006 | endef | ||
1007 | |||
1008 | # We create the target directory of the symlink if it does | ||
1009 | # not exist so the test in check-symlink works and we have a | ||
1010 | # directory for generated filesas used by some architectures. | ||
1011 | define create-symlink | ||
1012 | if [ ! -L include/asm ]; then \ | ||
1013 | $(kecho) ' SYMLINK $@ -> include/asm-$(SRCARCH)'; \ | ||
1014 | if [ ! -d include/asm-$(SRCARCH) ]; then \ | ||
1015 | mkdir -p include/asm-$(SRCARCH); \ | ||
1016 | fi; \ | ||
1017 | ln -fsn asm-$(SRCARCH) $@; \ | ||
1018 | fi | ||
1019 | endef | ||
1020 | |||
1021 | include/asm: FORCE | ||
1022 | $(Q)$(check-symlink) | ||
1023 | $(Q)$(create-symlink) | ||
1024 | |||
1025 | # Generate some files | 986 | # Generate some files |
1026 | # --------------------------------------------------------------------------- | 987 | # --------------------------------------------------------------------------- |
1027 | 988 | ||
@@ -1046,7 +1007,7 @@ endef | |||
1046 | include/linux/version.h: $(srctree)/Makefile FORCE | 1007 | include/linux/version.h: $(srctree)/Makefile FORCE |
1047 | $(call filechk,version.h) | 1008 | $(call filechk,version.h) |
1048 | 1009 | ||
1049 | include/linux/utsrelease.h: include/config/kernel.release FORCE | 1010 | include/generated/utsrelease.h: include/config/kernel.release FORCE |
1050 | $(call filechk,utsrelease.h) | 1011 | $(call filechk,utsrelease.h) |
1051 | 1012 | ||
1052 | PHONY += headerdep | 1013 | PHONY += headerdep |
@@ -1076,11 +1037,6 @@ firmware_install: FORCE | |||
1076 | export INSTALL_HDR_PATH = $(objtree)/usr | 1037 | export INSTALL_HDR_PATH = $(objtree)/usr |
1077 | 1038 | ||
1078 | hdr-inst := -rR -f $(srctree)/scripts/Makefile.headersinst obj | 1039 | hdr-inst := -rR -f $(srctree)/scripts/Makefile.headersinst obj |
1079 | # Find out where the Kbuild file is located to support | ||
1080 | # arch/$(ARCH)/include/asm | ||
1081 | hdr-dir = $(strip \ | ||
1082 | $(if $(wildcard $(srctree)/arch/$(hdr-arch)/include/asm/Kbuild), \ | ||
1083 | arch/$(hdr-arch)/include/asm, include/asm-$(hdr-arch))) | ||
1084 | 1040 | ||
1085 | # If we do an all arch process set dst to asm-$(hdr-arch) | 1041 | # If we do an all arch process set dst to asm-$(hdr-arch) |
1086 | hdr-dst = $(if $(KBUILD_HEADERS), dst=include/asm-$(hdr-arch), dst=include/asm) | 1042 | hdr-dst = $(if $(KBUILD_HEADERS), dst=include/asm-$(hdr-arch), dst=include/asm) |
@@ -1095,10 +1051,10 @@ headers_install_all: | |||
1095 | 1051 | ||
1096 | PHONY += headers_install | 1052 | PHONY += headers_install |
1097 | headers_install: __headers | 1053 | headers_install: __headers |
1098 | $(if $(wildcard $(srctree)/$(hdr-dir)/Kbuild),, \ | 1054 | $(if $(wildcard $(srctree)/arch/$(hdr-arch)/include/asm/Kbuild),, \ |
1099 | $(error Headers not exportable for the $(SRCARCH) architecture)) | 1055 | $(error Headers not exportable for the $(SRCARCH) architecture)) |
1100 | $(Q)$(MAKE) $(hdr-inst)=include | 1056 | $(Q)$(MAKE) $(hdr-inst)=include |
1101 | $(Q)$(MAKE) $(hdr-inst)=$(hdr-dir) $(hdr-dst) | 1057 | $(Q)$(MAKE) $(hdr-inst)=arch/$(hdr-arch)/include/asm $(hdr-dst) |
1102 | 1058 | ||
1103 | PHONY += headers_check_all | 1059 | PHONY += headers_check_all |
1104 | headers_check_all: headers_install_all | 1060 | headers_check_all: headers_install_all |
@@ -1107,7 +1063,7 @@ headers_check_all: headers_install_all | |||
1107 | PHONY += headers_check | 1063 | PHONY += headers_check |
1108 | headers_check: headers_install | 1064 | headers_check: headers_install |
1109 | $(Q)$(MAKE) $(hdr-inst)=include HDRCHECK=1 | 1065 | $(Q)$(MAKE) $(hdr-inst)=include HDRCHECK=1 |
1110 | $(Q)$(MAKE) $(hdr-inst)=$(hdr-dir) $(hdr-dst) HDRCHECK=1 | 1066 | $(Q)$(MAKE) $(hdr-inst)=arch/$(hdr-arch)/include/asm $(hdr-dst) HDRCHECK=1 |
1111 | 1067 | ||
1112 | # --------------------------------------------------------------------------- | 1068 | # --------------------------------------------------------------------------- |
1113 | # Modules | 1069 | # Modules |
@@ -1127,6 +1083,7 @@ all: modules | |||
1127 | PHONY += modules | 1083 | PHONY += modules |
1128 | modules: $(vmlinux-dirs) $(if $(KBUILD_BUILTIN),vmlinux) | 1084 | modules: $(vmlinux-dirs) $(if $(KBUILD_BUILTIN),vmlinux) |
1129 | $(Q)$(AWK) '!x[$$0]++' $(vmlinux-dirs:%=$(objtree)/%/modules.order) > $(objtree)/modules.order | 1085 | $(Q)$(AWK) '!x[$$0]++' $(vmlinux-dirs:%=$(objtree)/%/modules.order) > $(objtree)/modules.order |
1086 | $(Q)$(AWK) '!x[$$0]++' $(vmlinux-dirs:%=$(objtree)/%/modules.builtin) > $(objtree)/modules.builtin | ||
1130 | @$(kecho) ' Building modules, stage 2.'; | 1087 | @$(kecho) ' Building modules, stage 2.'; |
1131 | $(Q)$(MAKE) -f $(srctree)/scripts/Makefile.modpost | 1088 | $(Q)$(MAKE) -f $(srctree)/scripts/Makefile.modpost |
1132 | $(Q)$(MAKE) -f $(srctree)/scripts/Makefile.fwinst obj=firmware __fw_modbuild | 1089 | $(Q)$(MAKE) -f $(srctree)/scripts/Makefile.fwinst obj=firmware __fw_modbuild |
@@ -1156,6 +1113,7 @@ _modinst_: | |||
1156 | ln -s $(objtree) $(MODLIB)/build ; \ | 1113 | ln -s $(objtree) $(MODLIB)/build ; \ |
1157 | fi | 1114 | fi |
1158 | @cp -f $(objtree)/modules.order $(MODLIB)/ | 1115 | @cp -f $(objtree)/modules.order $(MODLIB)/ |
1116 | @cp -f $(objtree)/modules.builtin $(MODLIB)/ | ||
1159 | $(Q)$(MAKE) -f $(srctree)/scripts/Makefile.modinst | 1117 | $(Q)$(MAKE) -f $(srctree)/scripts/Makefile.modinst |
1160 | 1118 | ||
1161 | # This depmod is only for convenience to give the initial | 1119 | # This depmod is only for convenience to give the initial |
@@ -1194,12 +1152,10 @@ CLEAN_FILES += vmlinux System.map \ | |||
1194 | .tmp_kallsyms* .tmp_version .tmp_vmlinux* .tmp_System.map | 1152 | .tmp_kallsyms* .tmp_version .tmp_vmlinux* .tmp_System.map |
1195 | 1153 | ||
1196 | # Directories & files removed with 'make mrproper' | 1154 | # Directories & files removed with 'make mrproper' |
1197 | MRPROPER_DIRS += include/config include2 usr/include include/generated | 1155 | MRPROPER_DIRS += include/config usr/include include/generated |
1198 | MRPROPER_FILES += .config .config.old include/asm .version .old_version \ | 1156 | MRPROPER_FILES += .config .config.old .version .old_version \ |
1199 | include/linux/autoconf.h include/linux/version.h \ | 1157 | include/linux/version.h \ |
1200 | include/linux/utsrelease.h \ | 1158 | Module.symvers tags TAGS cscope* |
1201 | include/linux/bounds.h include/asm*/asm-offsets.h \ | ||
1202 | Module.symvers Module.markers tags TAGS cscope* | ||
1203 | 1159 | ||
1204 | # clean - Delete most, but leave enough to build external modules | 1160 | # clean - Delete most, but leave enough to build external modules |
1205 | # | 1161 | # |
@@ -1218,7 +1174,7 @@ clean: archclean $(clean-dirs) | |||
1218 | \( -name '*.[oas]' -o -name '*.ko' -o -name '.*.cmd' \ | 1174 | \( -name '*.[oas]' -o -name '*.ko' -o -name '.*.cmd' \ |
1219 | -o -name '.*.d' -o -name '.*.tmp' -o -name '*.mod.c' \ | 1175 | -o -name '.*.d' -o -name '.*.tmp' -o -name '*.mod.c' \ |
1220 | -o -name '*.symtypes' -o -name 'modules.order' \ | 1176 | -o -name '*.symtypes' -o -name 'modules.order' \ |
1221 | -o -name 'Module.markers' -o -name '.tmp_*.o.*' \ | 1177 | -o -name modules.builtin -o -name '.tmp_*.o.*' \ |
1222 | -o -name '*.gcno' \) -type f -print | xargs rm -f | 1178 | -o -name '*.gcno' \) -type f -print | xargs rm -f |
1223 | 1179 | ||
1224 | # mrproper - Delete all generated files, including .config | 1180 | # mrproper - Delete all generated files, including .config |
@@ -1416,8 +1372,8 @@ $(clean-dirs): | |||
1416 | 1372 | ||
1417 | clean: rm-dirs := $(MODVERDIR) | 1373 | clean: rm-dirs := $(MODVERDIR) |
1418 | clean: rm-files := $(KBUILD_EXTMOD)/Module.symvers \ | 1374 | clean: rm-files := $(KBUILD_EXTMOD)/Module.symvers \ |
1419 | $(KBUILD_EXTMOD)/Module.markers \ | 1375 | $(KBUILD_EXTMOD)/modules.order \ |
1420 | $(KBUILD_EXTMOD)/modules.order | 1376 | $(KBUILD_EXTMOD)/modules.builtin |
1421 | clean: $(clean-dirs) | 1377 | clean: $(clean-dirs) |
1422 | $(call cmd,rmdirs) | 1378 | $(call cmd,rmdirs) |
1423 | $(call cmd,rmfiles) | 1379 | $(call cmd,rmfiles) |
diff --git a/arch/alpha/boot/bootp.c b/arch/alpha/boot/bootp.c index 3af21c789339..3c8d1b25c661 100644 --- a/arch/alpha/boot/bootp.c +++ b/arch/alpha/boot/bootp.c | |||
@@ -9,7 +9,7 @@ | |||
9 | */ | 9 | */ |
10 | #include <linux/kernel.h> | 10 | #include <linux/kernel.h> |
11 | #include <linux/string.h> | 11 | #include <linux/string.h> |
12 | #include <linux/utsrelease.h> | 12 | #include <generated/utsrelease.h> |
13 | #include <linux/mm.h> | 13 | #include <linux/mm.h> |
14 | 14 | ||
15 | #include <asm/system.h> | 15 | #include <asm/system.h> |
diff --git a/arch/alpha/boot/bootpz.c b/arch/alpha/boot/bootpz.c index 1036b515e20c..ade3f129dc27 100644 --- a/arch/alpha/boot/bootpz.c +++ b/arch/alpha/boot/bootpz.c | |||
@@ -11,7 +11,7 @@ | |||
11 | */ | 11 | */ |
12 | #include <linux/kernel.h> | 12 | #include <linux/kernel.h> |
13 | #include <linux/string.h> | 13 | #include <linux/string.h> |
14 | #include <linux/utsrelease.h> | 14 | #include <generated/utsrelease.h> |
15 | #include <linux/mm.h> | 15 | #include <linux/mm.h> |
16 | 16 | ||
17 | #include <asm/system.h> | 17 | #include <asm/system.h> |
diff --git a/arch/alpha/boot/main.c b/arch/alpha/boot/main.c index 89f3be071ae5..644b7db55438 100644 --- a/arch/alpha/boot/main.c +++ b/arch/alpha/boot/main.c | |||
@@ -7,7 +7,7 @@ | |||
7 | */ | 7 | */ |
8 | #include <linux/kernel.h> | 8 | #include <linux/kernel.h> |
9 | #include <linux/string.h> | 9 | #include <linux/string.h> |
10 | #include <linux/utsrelease.h> | 10 | #include <generated/utsrelease.h> |
11 | #include <linux/mm.h> | 11 | #include <linux/mm.h> |
12 | 12 | ||
13 | #include <asm/system.h> | 13 | #include <asm/system.h> |
diff --git a/arch/alpha/include/asm/asm-offsets.h b/arch/alpha/include/asm/asm-offsets.h new file mode 100644 index 000000000000..d370ee36a182 --- /dev/null +++ b/arch/alpha/include/asm/asm-offsets.h | |||
@@ -0,0 +1 @@ | |||
#include <generated/asm-offsets.h> | |||
diff --git a/arch/arm/Makefile b/arch/arm/Makefile index fa0cdab2e1d3..e9da08483b3c 100644 --- a/arch/arm/Makefile +++ b/arch/arm/Makefile | |||
@@ -242,15 +242,8 @@ all: $(KBUILD_IMAGE) | |||
242 | 242 | ||
243 | boot := arch/arm/boot | 243 | boot := arch/arm/boot |
244 | 244 | ||
245 | # Update machine arch and proc symlinks if something which affects | 245 | archprepare: |
246 | # them changed. We use .arch to indicate when they were updated | 246 | $(Q)$(MAKE) $(build)=arch/arm/tools include/generated/mach-types.h |
247 | # last, otherwise make uses the target directory mtime. | ||
248 | |||
249 | archprepare: maketools | ||
250 | |||
251 | PHONY += maketools FORCE | ||
252 | maketools: include/linux/version.h FORCE | ||
253 | $(Q)$(MAKE) $(build)=arch/arm/tools include/asm-arm/mach-types.h | ||
254 | 247 | ||
255 | # Convert bzImage to zImage | 248 | # Convert bzImage to zImage |
256 | bzImage: zImage | 249 | bzImage: zImage |
@@ -261,9 +254,6 @@ zImage Image xipImage bootpImage uImage: vmlinux | |||
261 | zinstall install: vmlinux | 254 | zinstall install: vmlinux |
262 | $(Q)$(MAKE) $(build)=$(boot) MACHINE=$(MACHINE) $@ | 255 | $(Q)$(MAKE) $(build)=$(boot) MACHINE=$(MACHINE) $@ |
263 | 256 | ||
264 | CLEAN_FILES += include/asm-arm/mach-types.h \ | ||
265 | include/asm-arm/arch include/asm-arm/.arch | ||
266 | |||
267 | # We use MRPROPER_FILES and CLEAN_FILES now | 257 | # We use MRPROPER_FILES and CLEAN_FILES now |
268 | archclean: | 258 | archclean: |
269 | $(Q)$(MAKE) $(clean)=$(boot) | 259 | $(Q)$(MAKE) $(clean)=$(boot) |
diff --git a/arch/arm/include/asm/asm-offsets.h b/arch/arm/include/asm/asm-offsets.h new file mode 100644 index 000000000000..d370ee36a182 --- /dev/null +++ b/arch/arm/include/asm/asm-offsets.h | |||
@@ -0,0 +1 @@ | |||
#include <generated/asm-offsets.h> | |||
diff --git a/arch/arm/include/asm/mach-types.h b/arch/arm/include/asm/mach-types.h new file mode 100644 index 000000000000..948178cc6ba8 --- /dev/null +++ b/arch/arm/include/asm/mach-types.h | |||
@@ -0,0 +1 @@ | |||
#include <generated/mach-types.h> | |||
diff --git a/arch/arm/tools/Makefile b/arch/arm/tools/Makefile index 1dbaa29ac4d7..635cb1865e4d 100644 --- a/arch/arm/tools/Makefile +++ b/arch/arm/tools/Makefile | |||
@@ -4,7 +4,7 @@ | |||
4 | # Copyright (C) 2001 Russell King | 4 | # Copyright (C) 2001 Russell King |
5 | # | 5 | # |
6 | 6 | ||
7 | include/asm-arm/mach-types.h: $(src)/gen-mach-types $(src)/mach-types | 7 | include/generated/mach-types.h: $(src)/gen-mach-types $(src)/mach-types |
8 | @echo ' Generating $@' | 8 | @echo ' Generating $@' |
9 | @mkdir -p $(dir $@) | 9 | @mkdir -p $(dir $@) |
10 | $(Q)$(AWK) -f $^ > $@ || { rm -f $@; /bin/false; } | 10 | $(Q)$(AWK) -f $^ > $@ || { rm -f $@; /bin/false; } |
diff --git a/arch/arm/tools/gen-mach-types b/arch/arm/tools/gen-mach-types index ce319ef64bc1..04fef71d7be9 100644 --- a/arch/arm/tools/gen-mach-types +++ b/arch/arm/tools/gen-mach-types | |||
@@ -1,6 +1,6 @@ | |||
1 | #!/bin/awk | 1 | #!/bin/awk |
2 | # | 2 | # |
3 | # Awk script to generate include/asm-arm/mach-types.h | 3 | # Awk script to generate include/generated/mach-types.h |
4 | # | 4 | # |
5 | BEGIN { nr = 0 } | 5 | BEGIN { nr = 0 } |
6 | /^#/ { next } | 6 | /^#/ { next } |
diff --git a/arch/avr32/include/asm/asm-offsets.h b/arch/avr32/include/asm/asm-offsets.h new file mode 100644 index 000000000000..d370ee36a182 --- /dev/null +++ b/arch/avr32/include/asm/asm-offsets.h | |||
@@ -0,0 +1 @@ | |||
#include <generated/asm-offsets.h> | |||
diff --git a/arch/blackfin/include/asm/asm-offsets.h b/arch/blackfin/include/asm/asm-offsets.h new file mode 100644 index 000000000000..d370ee36a182 --- /dev/null +++ b/arch/blackfin/include/asm/asm-offsets.h | |||
@@ -0,0 +1 @@ | |||
#include <generated/asm-offsets.h> | |||
diff --git a/arch/cris/arch-v32/kernel/head.S b/arch/cris/arch-v32/kernel/head.S index 3db478eb5155..76266f80a5f1 100644 --- a/arch/cris/arch-v32/kernel/head.S +++ b/arch/cris/arch-v32/kernel/head.S | |||
@@ -10,7 +10,6 @@ | |||
10 | * The macros found in mmu_defs_asm.h uses the ## concatenation operator, so | 10 | * The macros found in mmu_defs_asm.h uses the ## concatenation operator, so |
11 | * -traditional must not be used when assembling this file. | 11 | * -traditional must not be used when assembling this file. |
12 | */ | 12 | */ |
13 | #include <linux/autoconf.h> | ||
14 | #include <arch/memmap.h> | 13 | #include <arch/memmap.h> |
15 | #include <hwregs/reg_rdwr.h> | 14 | #include <hwregs/reg_rdwr.h> |
16 | #include <hwregs/intr_vect.h> | 15 | #include <hwregs/intr_vect.h> |
diff --git a/arch/cris/include/asm/asm-offsets.h b/arch/cris/include/asm/asm-offsets.h new file mode 100644 index 000000000000..d370ee36a182 --- /dev/null +++ b/arch/cris/include/asm/asm-offsets.h | |||
@@ -0,0 +1 @@ | |||
#include <generated/asm-offsets.h> | |||
diff --git a/arch/cris/kernel/asm-offsets.c b/arch/cris/kernel/asm-offsets.c index ddd6fbbe75de..dd7b8e983221 100644 --- a/arch/cris/kernel/asm-offsets.c +++ b/arch/cris/kernel/asm-offsets.c | |||
@@ -1,6 +1,5 @@ | |||
1 | #include <linux/sched.h> | 1 | #include <linux/sched.h> |
2 | #include <asm/thread_info.h> | 2 | #include <asm/thread_info.h> |
3 | #include <linux/autoconf.h> | ||
4 | 3 | ||
5 | /* | 4 | /* |
6 | * Generate definitions needed by assembly language modules. | 5 | * Generate definitions needed by assembly language modules. |
diff --git a/arch/cris/kernel/vmlinux.lds.S b/arch/cris/kernel/vmlinux.lds.S index bbfda67d2907..d49d17d2a14f 100644 --- a/arch/cris/kernel/vmlinux.lds.S +++ b/arch/cris/kernel/vmlinux.lds.S | |||
@@ -8,7 +8,6 @@ | |||
8 | * the kernel has booted. | 8 | * the kernel has booted. |
9 | */ | 9 | */ |
10 | 10 | ||
11 | #include <linux/autoconf.h> | ||
12 | #include <asm-generic/vmlinux.lds.h> | 11 | #include <asm-generic/vmlinux.lds.h> |
13 | #include <asm/page.h> | 12 | #include <asm/page.h> |
14 | 13 | ||
diff --git a/arch/frv/include/asm/asm-offsets.h b/arch/frv/include/asm/asm-offsets.h new file mode 100644 index 000000000000..d370ee36a182 --- /dev/null +++ b/arch/frv/include/asm/asm-offsets.h | |||
@@ -0,0 +1 @@ | |||
#include <generated/asm-offsets.h> | |||
diff --git a/arch/frv/kernel/setup.c b/arch/frv/kernel/setup.c index 55e4fab7c0bc..75cf7f4b2fa8 100644 --- a/arch/frv/kernel/setup.c +++ b/arch/frv/kernel/setup.c | |||
@@ -10,7 +10,7 @@ | |||
10 | * 2 of the License, or (at your option) any later version. | 10 | * 2 of the License, or (at your option) any later version. |
11 | */ | 11 | */ |
12 | 12 | ||
13 | #include <linux/utsrelease.h> | 13 | #include <generated/utsrelease.h> |
14 | #include <linux/kernel.h> | 14 | #include <linux/kernel.h> |
15 | #include <linux/sched.h> | 15 | #include <linux/sched.h> |
16 | #include <linux/delay.h> | 16 | #include <linux/delay.h> |
diff --git a/arch/h8300/include/asm/asm-offsets.h b/arch/h8300/include/asm/asm-offsets.h new file mode 100644 index 000000000000..d370ee36a182 --- /dev/null +++ b/arch/h8300/include/asm/asm-offsets.h | |||
@@ -0,0 +1 @@ | |||
#include <generated/asm-offsets.h> | |||
diff --git a/arch/ia64/Makefile b/arch/ia64/Makefile index e7cbaa02cd0b..475e2725fbde 100644 --- a/arch/ia64/Makefile +++ b/arch/ia64/Makefile | |||
@@ -103,4 +103,4 @@ archprepare: make_nr_irqs_h FORCE | |||
103 | PHONY += make_nr_irqs_h FORCE | 103 | PHONY += make_nr_irqs_h FORCE |
104 | 104 | ||
105 | make_nr_irqs_h: FORCE | 105 | make_nr_irqs_h: FORCE |
106 | $(Q)$(MAKE) $(build)=arch/ia64/kernel include/asm-ia64/nr-irqs.h | 106 | $(Q)$(MAKE) $(build)=arch/ia64/kernel include/generated/nr-irqs.h |
diff --git a/arch/ia64/include/asm/asm-offsets.h b/arch/ia64/include/asm/asm-offsets.h new file mode 100644 index 000000000000..d370ee36a182 --- /dev/null +++ b/arch/ia64/include/asm/asm-offsets.h | |||
@@ -0,0 +1 @@ | |||
#include <generated/asm-offsets.h> | |||
diff --git a/arch/ia64/include/asm/irq.h b/arch/ia64/include/asm/irq.h index 5282546cdf82..91b920fd7d53 100644 --- a/arch/ia64/include/asm/irq.h +++ b/arch/ia64/include/asm/irq.h | |||
@@ -13,7 +13,7 @@ | |||
13 | 13 | ||
14 | #include <linux/types.h> | 14 | #include <linux/types.h> |
15 | #include <linux/cpumask.h> | 15 | #include <linux/cpumask.h> |
16 | #include <asm-ia64/nr-irqs.h> | 16 | #include <generated/nr-irqs.h> |
17 | 17 | ||
18 | static __inline__ int | 18 | static __inline__ int |
19 | irq_canonicalize (int irq) | 19 | irq_canonicalize (int irq) |
diff --git a/arch/ia64/kernel/Makefile b/arch/ia64/kernel/Makefile index 6b7edcab0cb5..2a75e937ae8d 100644 --- a/arch/ia64/kernel/Makefile +++ b/arch/ia64/kernel/Makefile | |||
@@ -81,17 +81,14 @@ define cmd_nr_irqs | |||
81 | endef | 81 | endef |
82 | 82 | ||
83 | # We use internal kbuild rules to avoid the "is up to date" message from make | 83 | # We use internal kbuild rules to avoid the "is up to date" message from make |
84 | arch/$(SRCARCH)/kernel/nr-irqs.s: $(srctree)/arch/$(SRCARCH)/kernel/nr-irqs.c \ | 84 | arch/$(SRCARCH)/kernel/nr-irqs.s: arch/$(SRCARCH)/kernel/nr-irqs.c |
85 | $(wildcard $(srctree)/include/asm-ia64/*/irq.h) | ||
86 | $(Q)mkdir -p $(dir $@) | 85 | $(Q)mkdir -p $(dir $@) |
87 | $(call if_changed_dep,cc_s_c) | 86 | $(call if_changed_dep,cc_s_c) |
88 | 87 | ||
89 | include/asm-ia64/nr-irqs.h: arch/$(SRCARCH)/kernel/nr-irqs.s | 88 | include/generated/nr-irqs.h: arch/$(SRCARCH)/kernel/nr-irqs.s |
90 | $(Q)mkdir -p $(dir $@) | 89 | $(Q)mkdir -p $(dir $@) |
91 | $(call cmd,nr_irqs) | 90 | $(call cmd,nr_irqs) |
92 | 91 | ||
93 | clean-files += $(objtree)/include/asm-ia64/nr-irqs.h | ||
94 | |||
95 | # | 92 | # |
96 | # native ivt.S, entry.S and fsys.S | 93 | # native ivt.S, entry.S and fsys.S |
97 | # | 94 | # |
diff --git a/arch/ia64/kvm/asm-offsets.c b/arch/ia64/kvm/asm-offsets.c index 0c3564a7a033..9324c875caf5 100644 --- a/arch/ia64/kvm/asm-offsets.c +++ b/arch/ia64/kvm/asm-offsets.c | |||
@@ -22,7 +22,6 @@ | |||
22 | * | 22 | * |
23 | */ | 23 | */ |
24 | 24 | ||
25 | #include <linux/autoconf.h> | ||
26 | #include <linux/kvm_host.h> | 25 | #include <linux/kvm_host.h> |
27 | #include <linux/kbuild.h> | 26 | #include <linux/kbuild.h> |
28 | 27 | ||
diff --git a/arch/m68k/include/asm/asm-offsets.h b/arch/m68k/include/asm/asm-offsets.h new file mode 100644 index 000000000000..d370ee36a182 --- /dev/null +++ b/arch/m68k/include/asm/asm-offsets.h | |||
@@ -0,0 +1 @@ | |||
#include <generated/asm-offsets.h> | |||
diff --git a/arch/m68k/kernel/head.S b/arch/m68k/kernel/head.S index 86edb5fbcfc3..ef54128baa0b 100644 --- a/arch/m68k/kernel/head.S +++ b/arch/m68k/kernel/head.S | |||
@@ -196,7 +196,7 @@ | |||
196 | * for them and trying to understand what they mean. | 196 | * for them and trying to understand what they mean. |
197 | * | 197 | * |
198 | * CONFIG_xxx: These are the obvious machine configuration defines created | 198 | * CONFIG_xxx: These are the obvious machine configuration defines created |
199 | * during configuration. These are defined in include/linux/autoconf.h. | 199 | * during configuration. These are defined in autoconf.h. |
200 | * | 200 | * |
201 | * CONSOLE: There is support for head.S console in this file. This | 201 | * CONSOLE: There is support for head.S console in this file. This |
202 | * console can talk to a Mac frame buffer, but could easily be extrapolated | 202 | * console can talk to a Mac frame buffer, but could easily be extrapolated |
diff --git a/arch/microblaze/include/asm/asm-offsets.h b/arch/microblaze/include/asm/asm-offsets.h new file mode 100644 index 000000000000..d370ee36a182 --- /dev/null +++ b/arch/microblaze/include/asm/asm-offsets.h | |||
@@ -0,0 +1 @@ | |||
#include <generated/asm-offsets.h> | |||
diff --git a/arch/mips/include/asm/asm-offsets.h b/arch/mips/include/asm/asm-offsets.h new file mode 100644 index 000000000000..d370ee36a182 --- /dev/null +++ b/arch/mips/include/asm/asm-offsets.h | |||
@@ -0,0 +1 @@ | |||
#include <generated/asm-offsets.h> | |||
diff --git a/arch/mn10300/include/asm/asm-offsets.h b/arch/mn10300/include/asm/asm-offsets.h new file mode 100644 index 000000000000..d370ee36a182 --- /dev/null +++ b/arch/mn10300/include/asm/asm-offsets.h | |||
@@ -0,0 +1 @@ | |||
#include <generated/asm-offsets.h> | |||
diff --git a/arch/parisc/include/asm/asm-offsets.h b/arch/parisc/include/asm/asm-offsets.h new file mode 100644 index 000000000000..d370ee36a182 --- /dev/null +++ b/arch/parisc/include/asm/asm-offsets.h | |||
@@ -0,0 +1 @@ | |||
#include <generated/asm-offsets.h> | |||
diff --git a/arch/powerpc/include/asm/asm-offsets.h b/arch/powerpc/include/asm/asm-offsets.h new file mode 100644 index 000000000000..d370ee36a182 --- /dev/null +++ b/arch/powerpc/include/asm/asm-offsets.h | |||
@@ -0,0 +1 @@ | |||
#include <generated/asm-offsets.h> | |||
diff --git a/arch/powerpc/platforms/52xx/efika.c b/arch/powerpc/platforms/52xx/efika.c index bcc69e1f77c1..45c0cb9b67e6 100644 --- a/arch/powerpc/platforms/52xx/efika.c +++ b/arch/powerpc/platforms/52xx/efika.c | |||
@@ -10,7 +10,7 @@ | |||
10 | */ | 10 | */ |
11 | 11 | ||
12 | #include <linux/init.h> | 12 | #include <linux/init.h> |
13 | #include <linux/utsrelease.h> | 13 | #include <generated/utsrelease.h> |
14 | #include <linux/pci.h> | 14 | #include <linux/pci.h> |
15 | #include <linux/of.h> | 15 | #include <linux/of.h> |
16 | #include <asm/prom.h> | 16 | #include <asm/prom.h> |
diff --git a/arch/powerpc/platforms/amigaone/setup.c b/arch/powerpc/platforms/amigaone/setup.c index 9290a7a442d0..fb4eb0df054c 100644 --- a/arch/powerpc/platforms/amigaone/setup.c +++ b/arch/powerpc/platforms/amigaone/setup.c | |||
@@ -14,7 +14,7 @@ | |||
14 | 14 | ||
15 | #include <linux/kernel.h> | 15 | #include <linux/kernel.h> |
16 | #include <linux/seq_file.h> | 16 | #include <linux/seq_file.h> |
17 | #include <linux/utsrelease.h> | 17 | #include <generated/utsrelease.h> |
18 | 18 | ||
19 | #include <asm/machdep.h> | 19 | #include <asm/machdep.h> |
20 | #include <asm/cputable.h> | 20 | #include <asm/cputable.h> |
diff --git a/arch/powerpc/platforms/cell/spufs/Makefile b/arch/powerpc/platforms/cell/spufs/Makefile index b93f877ba504..b9d5d678aa44 100644 --- a/arch/powerpc/platforms/cell/spufs/Makefile +++ b/arch/powerpc/platforms/cell/spufs/Makefile | |||
@@ -13,10 +13,8 @@ SPU_CC := $(SPU_CROSS)gcc | |||
13 | SPU_AS := $(SPU_CROSS)gcc | 13 | SPU_AS := $(SPU_CROSS)gcc |
14 | SPU_LD := $(SPU_CROSS)ld | 14 | SPU_LD := $(SPU_CROSS)ld |
15 | SPU_OBJCOPY := $(SPU_CROSS)objcopy | 15 | SPU_OBJCOPY := $(SPU_CROSS)objcopy |
16 | SPU_CFLAGS := -O2 -Wall -I$(srctree)/include \ | 16 | SPU_CFLAGS := -O2 -Wall -I$(srctree)/include -D__KERNEL__ |
17 | -I$(objtree)/include2 -D__KERNEL__ | 17 | SPU_AFLAGS := -c -D__ASSEMBLY__ -I$(srctree)/include -D__KERNEL__ |
18 | SPU_AFLAGS := -c -D__ASSEMBLY__ -I$(srctree)/include \ | ||
19 | -I$(objtree)/include2 -D__KERNEL__ | ||
20 | SPU_LDFLAGS := -N -Ttext=0x0 | 18 | SPU_LDFLAGS := -N -Ttext=0x0 |
21 | 19 | ||
22 | $(obj)/switch.o: $(obj)/spu_save_dump.h $(obj)/spu_restore_dump.h | 20 | $(obj)/switch.o: $(obj)/spu_save_dump.h $(obj)/spu_restore_dump.h |
diff --git a/arch/powerpc/platforms/chrp/setup.c b/arch/powerpc/platforms/chrp/setup.c index 52f3df3b4ca0..8f41685d8f42 100644 --- a/arch/powerpc/platforms/chrp/setup.c +++ b/arch/powerpc/platforms/chrp/setup.c | |||
@@ -23,7 +23,7 @@ | |||
23 | #include <linux/reboot.h> | 23 | #include <linux/reboot.h> |
24 | #include <linux/init.h> | 24 | #include <linux/init.h> |
25 | #include <linux/pci.h> | 25 | #include <linux/pci.h> |
26 | #include <linux/utsrelease.h> | 26 | #include <generated/utsrelease.h> |
27 | #include <linux/adb.h> | 27 | #include <linux/adb.h> |
28 | #include <linux/module.h> | 28 | #include <linux/module.h> |
29 | #include <linux/delay.h> | 29 | #include <linux/delay.h> |
diff --git a/arch/powerpc/platforms/powermac/bootx_init.c b/arch/powerpc/platforms/powermac/bootx_init.c index cf660916ae0b..9dd789a7370d 100644 --- a/arch/powerpc/platforms/powermac/bootx_init.c +++ b/arch/powerpc/platforms/powermac/bootx_init.c | |||
@@ -12,7 +12,7 @@ | |||
12 | #include <linux/kernel.h> | 12 | #include <linux/kernel.h> |
13 | #include <linux/string.h> | 13 | #include <linux/string.h> |
14 | #include <linux/init.h> | 14 | #include <linux/init.h> |
15 | #include <linux/utsrelease.h> | 15 | #include <generated/utsrelease.h> |
16 | #include <asm/sections.h> | 16 | #include <asm/sections.h> |
17 | #include <asm/prom.h> | 17 | #include <asm/prom.h> |
18 | #include <asm/page.h> | 18 | #include <asm/page.h> |
diff --git a/arch/s390/include/asm/asm-offsets.h b/arch/s390/include/asm/asm-offsets.h new file mode 100644 index 000000000000..d370ee36a182 --- /dev/null +++ b/arch/s390/include/asm/asm-offsets.h | |||
@@ -0,0 +1 @@ | |||
#include <generated/asm-offsets.h> | |||
diff --git a/arch/score/include/asm/asm-offsets.h b/arch/score/include/asm/asm-offsets.h new file mode 100644 index 000000000000..d370ee36a182 --- /dev/null +++ b/arch/score/include/asm/asm-offsets.h | |||
@@ -0,0 +1 @@ | |||
#include <generated/asm-offsets.h> | |||
diff --git a/arch/sh/Makefile b/arch/sh/Makefile index ac17c5ac550e..db91925c79d1 100644 --- a/arch/sh/Makefile +++ b/arch/sh/Makefile | |||
@@ -205,10 +205,7 @@ libs-$(CONFIG_SUPERH64) := arch/sh/lib64/ $(libs-y) | |||
205 | 205 | ||
206 | BOOT_TARGETS = uImage uImage.bz2 uImage.gz uImage.lzma uImage.srec uImage.bin \ | 206 | BOOT_TARGETS = uImage uImage.bz2 uImage.gz uImage.lzma uImage.srec uImage.bin \ |
207 | zImage vmlinux.srec romImage | 207 | zImage vmlinux.srec romImage |
208 | PHONY += maketools $(BOOT_TARGETS) FORCE | 208 | PHONY += $(BOOT_TARGETS) |
209 | |||
210 | maketools: include/linux/version.h FORCE | ||
211 | $(Q)$(MAKE) $(build)=arch/sh/tools include/asm-sh/machtypes.h | ||
212 | 209 | ||
213 | all: $(KBUILD_IMAGE) | 210 | all: $(KBUILD_IMAGE) |
214 | 211 | ||
@@ -217,7 +214,8 @@ $(BOOT_TARGETS): vmlinux | |||
217 | 214 | ||
218 | compressed: zImage | 215 | compressed: zImage |
219 | 216 | ||
220 | archprepare: maketools | 217 | archprepare: |
218 | $(Q)$(MAKE) $(build)=arch/sh/tools include/generated/machtypes.h | ||
221 | 219 | ||
222 | archclean: | 220 | archclean: |
223 | $(Q)$(MAKE) $(clean)=$(boot) | 221 | $(Q)$(MAKE) $(clean)=$(boot) |
@@ -234,5 +232,3 @@ define archhelp | |||
234 | @echo ' uImage.bz2 - Kernel-only image for U-Boot (bzip2)' | 232 | @echo ' uImage.bz2 - Kernel-only image for U-Boot (bzip2)' |
235 | @echo ' uImage.lzma - Kernel-only image for U-Boot (lzma)' | 233 | @echo ' uImage.lzma - Kernel-only image for U-Boot (lzma)' |
236 | endef | 234 | endef |
237 | |||
238 | CLEAN_FILES += include/asm-sh/machtypes.h | ||
diff --git a/arch/sh/drivers/pci/fixups-rts7751r2d.c b/arch/sh/drivers/pci/fixups-rts7751r2d.c index 052b354236dc..7898f14d6641 100644 --- a/arch/sh/drivers/pci/fixups-rts7751r2d.c +++ b/arch/sh/drivers/pci/fixups-rts7751r2d.c | |||
@@ -15,7 +15,7 @@ | |||
15 | #include <mach/lboxre2.h> | 15 | #include <mach/lboxre2.h> |
16 | #include <mach/r2d.h> | 16 | #include <mach/r2d.h> |
17 | #include "pci-sh4.h" | 17 | #include "pci-sh4.h" |
18 | #include <asm/machtypes.h> | 18 | #include <generated/machtypes.h> |
19 | 19 | ||
20 | #define PCIMCR_MRSET_OFF 0xBFFFFFFF | 20 | #define PCIMCR_MRSET_OFF 0xBFFFFFFF |
21 | #define PCIMCR_RFSH_OFF 0xFFFFFFFB | 21 | #define PCIMCR_RFSH_OFF 0xFFFFFFFB |
diff --git a/arch/sh/include/asm/.gitignore b/arch/sh/include/asm/.gitignore deleted file mode 100644 index 378db779fb6c..000000000000 --- a/arch/sh/include/asm/.gitignore +++ /dev/null | |||
@@ -1 +0,0 @@ | |||
1 | machtypes.h | ||
diff --git a/arch/sh/include/asm/asm-offsets.h b/arch/sh/include/asm/asm-offsets.h new file mode 100644 index 000000000000..d370ee36a182 --- /dev/null +++ b/arch/sh/include/asm/asm-offsets.h | |||
@@ -0,0 +1 @@ | |||
#include <generated/asm-offsets.h> | |||
diff --git a/arch/sh/include/asm/machvec.h b/arch/sh/include/asm/machvec.h index 84dd37761f56..9c30955630ff 100644 --- a/arch/sh/include/asm/machvec.h +++ b/arch/sh/include/asm/machvec.h | |||
@@ -12,7 +12,7 @@ | |||
12 | 12 | ||
13 | #include <linux/types.h> | 13 | #include <linux/types.h> |
14 | #include <linux/time.h> | 14 | #include <linux/time.h> |
15 | #include <asm/machtypes.h> | 15 | #include <generated/machtypes.h> |
16 | 16 | ||
17 | struct sh_machine_vector { | 17 | struct sh_machine_vector { |
18 | void (*mv_setup)(char **cmdline_p); | 18 | void (*mv_setup)(char **cmdline_p); |
diff --git a/arch/sh/tools/Makefile b/arch/sh/tools/Makefile index 567516b58acc..558a56bcc7cf 100644 --- a/arch/sh/tools/Makefile +++ b/arch/sh/tools/Makefile | |||
@@ -10,7 +10,7 @@ | |||
10 | # Shamelessly cloned from ARM. | 10 | # Shamelessly cloned from ARM. |
11 | # | 11 | # |
12 | 12 | ||
13 | include/asm-sh/machtypes.h: $(src)/gen-mach-types $(src)/mach-types | 13 | include/generated/machtypes.h: $(src)/gen-mach-types $(src)/mach-types |
14 | @echo ' Generating $@' | 14 | @echo ' Generating $@' |
15 | $(Q)if [ ! -d include/asm-sh ]; then mkdir -p include/asm-sh; fi | 15 | $(Q)mkdir -p $(dir $@) |
16 | $(Q)$(AWK) -f $^ > $@ || { rm -f $@; /bin/false; } | 16 | $(Q)$(AWK) -f $^ > $@ || { rm -f $@; /bin/false; } |
diff --git a/arch/sh/tools/gen-mach-types b/arch/sh/tools/gen-mach-types index 65161e368353..f5ff7c5d8913 100644 --- a/arch/sh/tools/gen-mach-types +++ b/arch/sh/tools/gen-mach-types | |||
@@ -1,6 +1,6 @@ | |||
1 | #!/bin/awk | 1 | #!/bin/awk |
2 | # | 2 | # |
3 | # Awk script to generate include/asm-sh/machtypes.h | 3 | # Awk script to generate include/generated/machtypes.h |
4 | # Heavily based on arch/arm/tools/gen-mach-types | 4 | # Heavily based on arch/arm/tools/gen-mach-types |
5 | # | 5 | # |
6 | BEGIN { nr = 0 } | 6 | BEGIN { nr = 0 } |
diff --git a/arch/sparc/include/asm/asm-offsets.h b/arch/sparc/include/asm/asm-offsets.h new file mode 100644 index 000000000000..d370ee36a182 --- /dev/null +++ b/arch/sparc/include/asm/asm-offsets.h | |||
@@ -0,0 +1 @@ | |||
#include <generated/asm-offsets.h> | |||
diff --git a/arch/um/Makefile b/arch/um/Makefile index fc633dbacf84..fab8121d2b32 100644 --- a/arch/um/Makefile +++ b/arch/um/Makefile | |||
@@ -149,6 +149,6 @@ $(SHARED_HEADERS)/user_constants.h: $(ARCH_DIR)/sys-$(SUBARCH)/user-offsets.s | |||
149 | 149 | ||
150 | $(SHARED_HEADERS)/kern_constants.h: | 150 | $(SHARED_HEADERS)/kern_constants.h: |
151 | $(Q)mkdir -p $(dir $@) | 151 | $(Q)mkdir -p $(dir $@) |
152 | $(Q)echo '#include "../../../../include/asm/asm-offsets.h"' >$@ | 152 | $(Q)echo '#include "../../../../include/generated/asm-offsets.h"' >$@ |
153 | 153 | ||
154 | export SUBARCH USER_CFLAGS CFLAGS_NO_HARDENING OS HEADER_ARCH DEV_NULL_PATH | 154 | export SUBARCH USER_CFLAGS CFLAGS_NO_HARDENING OS HEADER_ARCH DEV_NULL_PATH |
diff --git a/arch/um/include/asm/asm-offsets.h b/arch/um/include/asm/asm-offsets.h new file mode 100644 index 000000000000..d370ee36a182 --- /dev/null +++ b/arch/um/include/asm/asm-offsets.h | |||
@@ -0,0 +1 @@ | |||
#include <generated/asm-offsets.h> | |||
diff --git a/arch/x86/boot/header.S b/arch/x86/boot/header.S index b31cc54b4641..93e689f4bd86 100644 --- a/arch/x86/boot/header.S +++ b/arch/x86/boot/header.S | |||
@@ -16,7 +16,7 @@ | |||
16 | */ | 16 | */ |
17 | 17 | ||
18 | #include <asm/segment.h> | 18 | #include <asm/segment.h> |
19 | #include <linux/utsrelease.h> | 19 | #include <generated/utsrelease.h> |
20 | #include <asm/boot.h> | 20 | #include <asm/boot.h> |
21 | #include <asm/e820.h> | 21 | #include <asm/e820.h> |
22 | #include <asm/page_types.h> | 22 | #include <asm/page_types.h> |
diff --git a/arch/x86/boot/version.c b/arch/x86/boot/version.c index 2723d9b5ce43..2b15aa488ffb 100644 --- a/arch/x86/boot/version.c +++ b/arch/x86/boot/version.c | |||
@@ -13,8 +13,8 @@ | |||
13 | */ | 13 | */ |
14 | 14 | ||
15 | #include "boot.h" | 15 | #include "boot.h" |
16 | #include <linux/utsrelease.h> | 16 | #include <generated/utsrelease.h> |
17 | #include <linux/compile.h> | 17 | #include <generated/compile.h> |
18 | 18 | ||
19 | const char kernel_version[] = | 19 | const char kernel_version[] = |
20 | UTS_RELEASE " (" LINUX_COMPILE_BY "@" LINUX_COMPILE_HOST ") " | 20 | UTS_RELEASE " (" LINUX_COMPILE_BY "@" LINUX_COMPILE_HOST ") " |
diff --git a/arch/x86/include/asm/asm-offsets.h b/arch/x86/include/asm/asm-offsets.h new file mode 100644 index 000000000000..d370ee36a182 --- /dev/null +++ b/arch/x86/include/asm/asm-offsets.h | |||
@@ -0,0 +1 @@ | |||
#include <generated/asm-offsets.h> | |||
diff --git a/arch/xtensa/include/asm/asm-offsets.h b/arch/xtensa/include/asm/asm-offsets.h new file mode 100644 index 000000000000..d370ee36a182 --- /dev/null +++ b/arch/xtensa/include/asm/asm-offsets.h | |||
@@ -0,0 +1 @@ | |||
#include <generated/asm-offsets.h> | |||
diff --git a/drivers/accessibility/braille/braille_console.c b/drivers/accessibility/braille/braille_console.c index d672cfe7ca59..cb423f5aef24 100644 --- a/drivers/accessibility/braille/braille_console.c +++ b/drivers/accessibility/braille/braille_console.c | |||
@@ -21,7 +21,6 @@ | |||
21 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. | 21 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. |
22 | */ | 22 | */ |
23 | 23 | ||
24 | #include <linux/autoconf.h> | ||
25 | #include <linux/kernel.h> | 24 | #include <linux/kernel.h> |
26 | #include <linux/module.h> | 25 | #include <linux/module.h> |
27 | #include <linux/moduleparam.h> | 26 | #include <linux/moduleparam.h> |
diff --git a/drivers/hid/hid-lg.h b/drivers/hid/hid-lg.h index 27ae750ca878..bf31592eaf79 100644 --- a/drivers/hid/hid-lg.h +++ b/drivers/hid/hid-lg.h | |||
@@ -1,8 +1,6 @@ | |||
1 | #ifndef __HID_LG_H | 1 | #ifndef __HID_LG_H |
2 | #define __HID_LG_H | 2 | #define __HID_LG_H |
3 | 3 | ||
4 | #include <linux/autoconf.h> | ||
5 | |||
6 | #ifdef CONFIG_LOGITECH_FF | 4 | #ifdef CONFIG_LOGITECH_FF |
7 | int lgff_init(struct hid_device *hdev); | 5 | int lgff_init(struct hid_device *hdev); |
8 | #else | 6 | #else |
diff --git a/drivers/net/wireless/iwlwifi/iwl-core.h b/drivers/net/wireless/iwlwifi/iwl-core.h index 675b7df632fc..27ca859e7453 100644 --- a/drivers/net/wireless/iwlwifi/iwl-core.h +++ b/drivers/net/wireless/iwlwifi/iwl-core.h | |||
@@ -63,7 +63,7 @@ | |||
63 | #ifndef __iwl_core_h__ | 63 | #ifndef __iwl_core_h__ |
64 | #define __iwl_core_h__ | 64 | #define __iwl_core_h__ |
65 | 65 | ||
66 | #include <linux/utsrelease.h> | 66 | #include <generated/utsrelease.h> |
67 | 67 | ||
68 | /************************ | 68 | /************************ |
69 | * forward declarations * | 69 | * forward declarations * |
diff --git a/drivers/platform/x86/compal-laptop.c b/drivers/platform/x86/compal-laptop.c index 11003bba10d3..1a387e79f719 100644 --- a/drivers/platform/x86/compal-laptop.c +++ b/drivers/platform/x86/compal-laptop.c | |||
@@ -51,7 +51,6 @@ | |||
51 | #include <linux/dmi.h> | 51 | #include <linux/dmi.h> |
52 | #include <linux/backlight.h> | 52 | #include <linux/backlight.h> |
53 | #include <linux/platform_device.h> | 53 | #include <linux/platform_device.h> |
54 | #include <linux/autoconf.h> | ||
55 | 54 | ||
56 | #define COMPAL_DRIVER_VERSION "0.2.6" | 55 | #define COMPAL_DRIVER_VERSION "0.2.6" |
57 | 56 | ||
diff --git a/drivers/staging/iio/ring_sw.h b/drivers/staging/iio/ring_sw.h index f0b86f02cd80..fd677f008365 100644 --- a/drivers/staging/iio/ring_sw.h +++ b/drivers/staging/iio/ring_sw.h | |||
@@ -29,7 +29,6 @@ | |||
29 | * driver requests - some may support multiple options */ | 29 | * driver requests - some may support multiple options */ |
30 | 30 | ||
31 | 31 | ||
32 | #include <linux/autoconf.h> | ||
33 | #include "iio.h" | 32 | #include "iio.h" |
34 | #include "ring_generic.h" | 33 | #include "ring_generic.h" |
35 | 34 | ||
diff --git a/drivers/staging/panel/panel.c b/drivers/staging/panel/panel.c index 4ce399b6d237..f98a52448eae 100644 --- a/drivers/staging/panel/panel.c +++ b/drivers/staging/panel/panel.c | |||
@@ -55,7 +55,7 @@ | |||
55 | #include <linux/list.h> | 55 | #include <linux/list.h> |
56 | #include <linux/notifier.h> | 56 | #include <linux/notifier.h> |
57 | #include <linux/reboot.h> | 57 | #include <linux/reboot.h> |
58 | #include <linux/utsrelease.h> | 58 | #include <generated/utsrelease.h> |
59 | 59 | ||
60 | #include <linux/io.h> | 60 | #include <linux/io.h> |
61 | #include <asm/uaccess.h> | 61 | #include <asm/uaccess.h> |
diff --git a/include/linux/Kbuild b/include/linux/Kbuild index f72914db2a11..756f831cbdd5 100644 --- a/include/linux/Kbuild +++ b/include/linux/Kbuild | |||
@@ -118,6 +118,7 @@ header-y += mtio.h | |||
118 | header-y += ncp_no.h | 118 | header-y += ncp_no.h |
119 | header-y += neighbour.h | 119 | header-y += neighbour.h |
120 | header-y += net_dropmon.h | 120 | header-y += net_dropmon.h |
121 | header-y += net_tstamp.h | ||
121 | header-y += netfilter_arp.h | 122 | header-y += netfilter_arp.h |
122 | header-y += netrom.h | 123 | header-y += netrom.h |
123 | header-y += nfs2.h | 124 | header-y += nfs2.h |
diff --git a/include/linux/mmdebug.h b/include/linux/mmdebug.h index 8a5509877192..ee24ef8ab616 100644 --- a/include/linux/mmdebug.h +++ b/include/linux/mmdebug.h | |||
@@ -1,8 +1,6 @@ | |||
1 | #ifndef LINUX_MM_DEBUG_H | 1 | #ifndef LINUX_MM_DEBUG_H |
2 | #define LINUX_MM_DEBUG_H 1 | 2 | #define LINUX_MM_DEBUG_H 1 |
3 | 3 | ||
4 | #include <linux/autoconf.h> | ||
5 | |||
6 | #ifdef CONFIG_DEBUG_VM | 4 | #ifdef CONFIG_DEBUG_VM |
7 | #define VM_BUG_ON(cond) BUG_ON(cond) | 5 | #define VM_BUG_ON(cond) BUG_ON(cond) |
8 | #else | 6 | #else |
diff --git a/include/linux/mmzone.h b/include/linux/mmzone.h index 6f7561730d88..30fe668c2542 100644 --- a/include/linux/mmzone.h +++ b/include/linux/mmzone.h | |||
@@ -15,7 +15,7 @@ | |||
15 | #include <linux/seqlock.h> | 15 | #include <linux/seqlock.h> |
16 | #include <linux/nodemask.h> | 16 | #include <linux/nodemask.h> |
17 | #include <linux/pageblock-flags.h> | 17 | #include <linux/pageblock-flags.h> |
18 | #include <linux/bounds.h> | 18 | #include <generated/bounds.h> |
19 | #include <asm/atomic.h> | 19 | #include <asm/atomic.h> |
20 | #include <asm/page.h> | 20 | #include <asm/page.h> |
21 | 21 | ||
diff --git a/include/linux/page-flags.h b/include/linux/page-flags.h index feee2ba8d06a..5b59f35dcb8f 100644 --- a/include/linux/page-flags.h +++ b/include/linux/page-flags.h | |||
@@ -8,7 +8,7 @@ | |||
8 | #include <linux/types.h> | 8 | #include <linux/types.h> |
9 | #ifndef __GENERATING_BOUNDS_H | 9 | #ifndef __GENERATING_BOUNDS_H |
10 | #include <linux/mm_types.h> | 10 | #include <linux/mm_types.h> |
11 | #include <linux/bounds.h> | 11 | #include <generated/bounds.h> |
12 | #endif /* !__GENERATING_BOUNDS_H */ | 12 | #endif /* !__GENERATING_BOUNDS_H */ |
13 | 13 | ||
14 | /* | 14 | /* |
diff --git a/include/linux/vermagic.h b/include/linux/vermagic.h index 79b9837d9ca0..cf97b5b9d1fe 100644 --- a/include/linux/vermagic.h +++ b/include/linux/vermagic.h | |||
@@ -1,4 +1,4 @@ | |||
1 | #include <linux/utsrelease.h> | 1 | #include <generated/utsrelease.h> |
2 | #include <linux/module.h> | 2 | #include <linux/module.h> |
3 | 3 | ||
4 | /* Simply sanity version stamp for modules. */ | 4 | /* Simply sanity version stamp for modules. */ |
diff --git a/init/Makefile b/init/Makefile index 4a243df426f7..0bf677aa0872 100644 --- a/init/Makefile +++ b/init/Makefile | |||
@@ -15,12 +15,8 @@ mounts-$(CONFIG_BLK_DEV_RAM) += do_mounts_rd.o | |||
15 | mounts-$(CONFIG_BLK_DEV_INITRD) += do_mounts_initrd.o | 15 | mounts-$(CONFIG_BLK_DEV_INITRD) += do_mounts_initrd.o |
16 | mounts-$(CONFIG_BLK_DEV_MD) += do_mounts_md.o | 16 | mounts-$(CONFIG_BLK_DEV_MD) += do_mounts_md.o |
17 | 17 | ||
18 | # files to be removed upon make clean | ||
19 | clean-files := ../include/linux/compile.h | ||
20 | |||
21 | # dependencies on generated files need to be listed explicitly | 18 | # dependencies on generated files need to be listed explicitly |
22 | 19 | $(obj)/version.o: include/generated/compile.h | |
23 | $(obj)/version.o: include/linux/compile.h | ||
24 | 20 | ||
25 | # compile.h changes depending on hostname, generation number, etc, | 21 | # compile.h changes depending on hostname, generation number, etc, |
26 | # so we regenerate it always. | 22 | # so we regenerate it always. |
@@ -30,7 +26,7 @@ $(obj)/version.o: include/linux/compile.h | |||
30 | chk_compile.h = : | 26 | chk_compile.h = : |
31 | quiet_chk_compile.h = echo ' CHK $@' | 27 | quiet_chk_compile.h = echo ' CHK $@' |
32 | silent_chk_compile.h = : | 28 | silent_chk_compile.h = : |
33 | include/linux/compile.h: FORCE | 29 | include/generated/compile.h: FORCE |
34 | @$($(quiet)chk_compile.h) | 30 | @$($(quiet)chk_compile.h) |
35 | $(Q)$(CONFIG_SHELL) $(srctree)/scripts/mkcompile_h $@ \ | 31 | $(Q)$(CONFIG_SHELL) $(srctree)/scripts/mkcompile_h $@ \ |
36 | "$(UTS_MACHINE)" "$(CONFIG_SMP)" "$(CONFIG_PREEMPT)" "$(CC) $(KBUILD_CFLAGS)" | 32 | "$(UTS_MACHINE)" "$(CONFIG_SMP)" "$(CONFIG_PREEMPT)" "$(CC) $(KBUILD_CFLAGS)" |
diff --git a/init/version.c b/init/version.c index 52a8b98642b8..adff586401a5 100644 --- a/init/version.c +++ b/init/version.c | |||
@@ -6,11 +6,11 @@ | |||
6 | * May be freely distributed as part of Linux. | 6 | * May be freely distributed as part of Linux. |
7 | */ | 7 | */ |
8 | 8 | ||
9 | #include <linux/compile.h> | 9 | #include <generated/compile.h> |
10 | #include <linux/module.h> | 10 | #include <linux/module.h> |
11 | #include <linux/uts.h> | 11 | #include <linux/uts.h> |
12 | #include <linux/utsname.h> | 12 | #include <linux/utsname.h> |
13 | #include <linux/utsrelease.h> | 13 | #include <generated/utsrelease.h> |
14 | #include <linux/version.h> | 14 | #include <linux/version.h> |
15 | 15 | ||
16 | #ifndef CONFIG_KALLSYMS | 16 | #ifndef CONFIG_KALLSYMS |
diff --git a/kernel/bounds.c b/kernel/bounds.c index 3c5301381837..98a51f26c136 100644 --- a/kernel/bounds.c +++ b/kernel/bounds.c | |||
@@ -12,7 +12,7 @@ | |||
12 | 12 | ||
13 | void foo(void) | 13 | void foo(void) |
14 | { | 14 | { |
15 | /* The enum constants to put into include/linux/bounds.h */ | 15 | /* The enum constants to put into include/generated/bounds.h */ |
16 | DEFINE(NR_PAGEFLAGS, __NR_PAGEFLAGS); | 16 | DEFINE(NR_PAGEFLAGS, __NR_PAGEFLAGS); |
17 | DEFINE(MAX_NR_ZONES, __MAX_NR_ZONES); | 17 | DEFINE(MAX_NR_ZONES, __MAX_NR_ZONES); |
18 | /* End of constants */ | 18 | /* End of constants */ |
diff --git a/kernel/kexec.c b/kernel/kexec.c index 433e9fcc1fc5..a9a93d9ee7a7 100644 --- a/kernel/kexec.c +++ b/kernel/kexec.c | |||
@@ -21,7 +21,7 @@ | |||
21 | #include <linux/hardirq.h> | 21 | #include <linux/hardirq.h> |
22 | #include <linux/elf.h> | 22 | #include <linux/elf.h> |
23 | #include <linux/elfcore.h> | 23 | #include <linux/elfcore.h> |
24 | #include <linux/utsrelease.h> | 24 | #include <generated/utsrelease.h> |
25 | #include <linux/utsname.h> | 25 | #include <linux/utsname.h> |
26 | #include <linux/numa.h> | 26 | #include <linux/numa.h> |
27 | #include <linux/suspend.h> | 27 | #include <linux/suspend.h> |
diff --git a/kernel/trace/trace.c b/kernel/trace/trace.c index 06ba26747d7e..8b9f20ab8eed 100644 --- a/kernel/trace/trace.c +++ b/kernel/trace/trace.c | |||
@@ -12,7 +12,7 @@ | |||
12 | * Copyright (C) 2004 William Lee Irwin III | 12 | * Copyright (C) 2004 William Lee Irwin III |
13 | */ | 13 | */ |
14 | #include <linux/ring_buffer.h> | 14 | #include <linux/ring_buffer.h> |
15 | #include <linux/utsrelease.h> | 15 | #include <generated/utsrelease.h> |
16 | #include <linux/stacktrace.h> | 16 | #include <linux/stacktrace.h> |
17 | #include <linux/writeback.h> | 17 | #include <linux/writeback.h> |
18 | #include <linux/kallsyms.h> | 18 | #include <linux/kallsyms.h> |
diff --git a/scripts/Kbuild.include b/scripts/Kbuild.include index c67e73ecd5be..ed2773edfe71 100644 --- a/scripts/Kbuild.include +++ b/scripts/Kbuild.include | |||
@@ -149,6 +149,12 @@ ld-option = $(call try-run,\ | |||
149 | # $(Q)$(MAKE) $(build)=dir | 149 | # $(Q)$(MAKE) $(build)=dir |
150 | build := -f $(if $(KBUILD_SRC),$(srctree)/)scripts/Makefile.build obj | 150 | build := -f $(if $(KBUILD_SRC),$(srctree)/)scripts/Makefile.build obj |
151 | 151 | ||
152 | ### | ||
153 | # Shorthand for $(Q)$(MAKE) -f scripts/Makefile.modbuiltin obj= | ||
154 | # Usage: | ||
155 | # $(Q)$(MAKE) $(modbuiltin)=dir | ||
156 | modbuiltin := -f $(if $(KBUILD_SRC),$(srctree)/)scripts/Makefile.modbuiltin obj | ||
157 | |||
152 | # Prefix -I with $(srctree) if it is not an absolute path. | 158 | # Prefix -I with $(srctree) if it is not an absolute path. |
153 | # skip if -I has no parameter | 159 | # skip if -I has no parameter |
154 | addtree = $(if $(patsubst -I%,%,$(1)), \ | 160 | addtree = $(if $(patsubst -I%,%,$(1)), \ |
diff --git a/scripts/Makefile.lib b/scripts/Makefile.lib index 224d85e72ef1..cd815ac2a50b 100644 --- a/scripts/Makefile.lib +++ b/scripts/Makefile.lib | |||
@@ -213,7 +213,7 @@ cmd_gzip = (cat $(filter-out FORCE,$^) | gzip -f -9 > $@) || \ | |||
213 | 213 | ||
214 | # Bzip2 and LZMA do not include size in file... so we have to fake that; | 214 | # Bzip2 and LZMA do not include size in file... so we have to fake that; |
215 | # append the size as a 32-bit littleendian number as gzip does. | 215 | # append the size as a 32-bit littleendian number as gzip does. |
216 | size_append = /bin/echo -ne $(shell \ | 216 | size_append = printf $(shell \ |
217 | dec_size=0; \ | 217 | dec_size=0; \ |
218 | for F in $1; do \ | 218 | for F in $1; do \ |
219 | fsize=$$(stat -c "%s" $$F); \ | 219 | fsize=$$(stat -c "%s" $$F); \ |
diff --git a/scripts/Makefile.modbuiltin b/scripts/Makefile.modbuiltin new file mode 100644 index 000000000000..102a276f6eea --- /dev/null +++ b/scripts/Makefile.modbuiltin | |||
@@ -0,0 +1,55 @@ | |||
1 | # ========================================================================== | ||
2 | # Generating modules.builtin | ||
3 | # ========================================================================== | ||
4 | |||
5 | src := $(obj) | ||
6 | |||
7 | PHONY := __modbuiltin | ||
8 | __modbuiltin: | ||
9 | |||
10 | -include include/config/auto.conf | ||
11 | # tristate.conf sets tristate variables to uppercase 'Y' or 'M' | ||
12 | # That way, we get the list of built-in modules in obj-Y | ||
13 | -include include/config/tristate.conf | ||
14 | |||
15 | include scripts/Kbuild.include | ||
16 | |||
17 | # The filename Kbuild has precedence over Makefile | ||
18 | kbuild-dir := $(if $(filter /%,$(src)),$(src),$(srctree)/$(src)) | ||
19 | kbuild-file := $(if $(wildcard $(kbuild-dir)/Kbuild),$(kbuild-dir)/Kbuild,$(kbuild-dir)/Makefile) | ||
20 | include $(kbuild-file) | ||
21 | |||
22 | include scripts/Makefile.lib | ||
23 | __subdir-Y := $(patsubst %/,%,$(filter %/, $(obj-Y))) | ||
24 | subdir-Y += $(__subdir-Y) | ||
25 | subdir-ym := $(sort $(subdir-y) $(subdir-Y) $(subdir-m)) | ||
26 | subdir-ym := $(addprefix $(obj)/,$(subdir-ym)) | ||
27 | obj-Y := $(addprefix $(obj)/,$(obj-Y)) | ||
28 | |||
29 | modbuiltin-subdirs := $(patsubst %,%/modules.builtin, $(subdir-ym)) | ||
30 | modbuiltin-mods := $(filter %.ko, $(obj-Y:.o=.ko)) | ||
31 | modbuiltin-target := $(obj)/modules.builtin | ||
32 | |||
33 | __modbuiltin: $(modbuiltin-target) $(subdir-ym) | ||
34 | @: | ||
35 | |||
36 | $(modbuiltin-target): $(subdir-ym) FORCE | ||
37 | $(Q)(for m in $(modbuiltin-mods); do echo kernel/$$m; done; \ | ||
38 | cat /dev/null $(modbuiltin-subdirs)) > $@ | ||
39 | |||
40 | PHONY += FORCE | ||
41 | |||
42 | FORCE: | ||
43 | |||
44 | # Descending | ||
45 | # --------------------------------------------------------------------------- | ||
46 | |||
47 | PHONY += $(subdir-ym) | ||
48 | $(subdir-ym): | ||
49 | $(Q)$(MAKE) $(modbuiltin)=$@ | ||
50 | |||
51 | |||
52 | # Declare the contents of the .PHONY variable as phony. We keep that | ||
53 | # information in a variable se we can use it in if_changed and friends. | ||
54 | |||
55 | .PHONY: $(PHONY) | ||
diff --git a/scripts/basic/fixdep.c b/scripts/basic/fixdep.c index 6bf21f83837d..ea26b23de082 100644 --- a/scripts/basic/fixdep.c +++ b/scripts/basic/fixdep.c | |||
@@ -16,15 +16,15 @@ | |||
16 | * tells make when to remake a file. | 16 | * tells make when to remake a file. |
17 | * | 17 | * |
18 | * To use this list as-is however has the drawback that virtually | 18 | * To use this list as-is however has the drawback that virtually |
19 | * every file in the kernel includes <linux/autoconf.h>. | 19 | * every file in the kernel includes autoconf.h. |
20 | * | 20 | * |
21 | * If the user re-runs make *config, linux/autoconf.h will be | 21 | * If the user re-runs make *config, autoconf.h will be |
22 | * regenerated. make notices that and will rebuild every file which | 22 | * regenerated. make notices that and will rebuild every file which |
23 | * includes autoconf.h, i.e. basically all files. This is extremely | 23 | * includes autoconf.h, i.e. basically all files. This is extremely |
24 | * annoying if the user just changed CONFIG_HIS_DRIVER from n to m. | 24 | * annoying if the user just changed CONFIG_HIS_DRIVER from n to m. |
25 | * | 25 | * |
26 | * So we play the same trick that "mkdep" played before. We replace | 26 | * So we play the same trick that "mkdep" played before. We replace |
27 | * the dependency on linux/autoconf.h by a dependency on every config | 27 | * the dependency on autoconf.h by a dependency on every config |
28 | * option which is mentioned in any of the listed prequisites. | 28 | * option which is mentioned in any of the listed prequisites. |
29 | * | 29 | * |
30 | * kconfig populates a tree in include/config/ with an empty file | 30 | * kconfig populates a tree in include/config/ with an empty file |
@@ -73,7 +73,7 @@ | |||
73 | * cmd_<target> = <cmdline> | 73 | * cmd_<target> = <cmdline> |
74 | * | 74 | * |
75 | * and then basically copies the .<target>.d file to stdout, in the | 75 | * and then basically copies the .<target>.d file to stdout, in the |
76 | * process filtering out the dependency on linux/autoconf.h and adding | 76 | * process filtering out the dependency on autoconf.h and adding |
77 | * dependencies on include/config/my/option.h for every | 77 | * dependencies on include/config/my/option.h for every |
78 | * CONFIG_MY_OPTION encountered in any of the prequisites. | 78 | * CONFIG_MY_OPTION encountered in any of the prequisites. |
79 | * | 79 | * |
@@ -324,7 +324,7 @@ static void parse_dep_file(void *map, size_t len) | |||
324 | p++; | 324 | p++; |
325 | } | 325 | } |
326 | memcpy(s, m, p-m); s[p-m] = 0; | 326 | memcpy(s, m, p-m); s[p-m] = 0; |
327 | if (strrcmp(s, "include/linux/autoconf.h") && | 327 | if (strrcmp(s, "include/generated/autoconf.h") && |
328 | strrcmp(s, "arch/um/include/uml-config.h") && | 328 | strrcmp(s, "arch/um/include/uml-config.h") && |
329 | strrcmp(s, ".ver")) { | 329 | strrcmp(s, ".ver")) { |
330 | printf(" %s \\\n", s); | 330 | printf(" %s \\\n", s); |
diff --git a/scripts/genksyms/keywords.c_shipped b/scripts/genksyms/keywords.c_shipped index 287467a2e8c7..8060e06798b3 100644 --- a/scripts/genksyms/keywords.c_shipped +++ b/scripts/genksyms/keywords.c_shipped | |||
@@ -1,4 +1,4 @@ | |||
1 | /* ANSI-C code produced by gperf version 3.0.3 */ | 1 | /* ANSI-C code produced by gperf version 3.0.4 */ |
2 | /* Command-line: gperf -L ANSI-C -a -C -E -g -H is_reserved_hash -k '1,3,$' -N is_reserved_word -p -t scripts/genksyms/keywords.gperf */ | 2 | /* Command-line: gperf -L ANSI-C -a -C -E -g -H is_reserved_hash -k '1,3,$' -N is_reserved_word -p -t scripts/genksyms/keywords.gperf */ |
3 | 3 | ||
4 | #if !((' ' == 32) && ('!' == 33) && ('"' == 34) && ('#' == 35) \ | 4 | #if !((' ' == 32) && ('!' == 33) && ('"' == 34) && ('#' == 35) \ |
@@ -34,7 +34,7 @@ struct resword; | |||
34 | static const struct resword *is_reserved_word(register const char *str, register unsigned int len); | 34 | static const struct resword *is_reserved_word(register const char *str, register unsigned int len); |
35 | #line 5 "scripts/genksyms/keywords.gperf" | 35 | #line 5 "scripts/genksyms/keywords.gperf" |
36 | struct resword { const char *name; int token; }; | 36 | struct resword { const char *name; int token; }; |
37 | /* maximum key range = 62, duplicates = 0 */ | 37 | /* maximum key range = 64, duplicates = 0 */ |
38 | 38 | ||
39 | #ifdef __GNUC__ | 39 | #ifdef __GNUC__ |
40 | __inline | 40 | __inline |
@@ -48,39 +48,39 @@ is_reserved_hash (register const char *str, register unsigned int len) | |||
48 | { | 48 | { |
49 | static const unsigned char asso_values[] = | 49 | static const unsigned char asso_values[] = |
50 | { | 50 | { |
51 | 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, | 51 | 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, |
52 | 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, | 52 | 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, |
53 | 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, | 53 | 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, |
54 | 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, | 54 | 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, |
55 | 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, | 55 | 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, |
56 | 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, | 56 | 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, |
57 | 65, 65, 65, 65, 65, 65, 65, 65, 65, 5, | 57 | 67, 67, 67, 67, 67, 67, 67, 67, 67, 0, |
58 | 65, 65, 65, 65, 65, 65, 35, 65, 65, 65, | 58 | 67, 67, 67, 67, 67, 67, 15, 67, 67, 67, |
59 | 0, 65, 65, 65, 65, 65, 65, 65, 65, 65, | 59 | 0, 67, 67, 67, 67, 67, 67, 67, 67, 67, |
60 | 65, 65, 65, 65, 65, 0, 65, 0, 65, 5, | 60 | 67, 67, 67, 67, 67, 0, 67, 0, 67, 5, |
61 | 20, 15, 10, 30, 65, 15, 65, 65, 20, 0, | 61 | 25, 20, 15, 30, 67, 15, 67, 67, 10, 0, |
62 | 10, 35, 20, 65, 10, 5, 0, 10, 5, 65, | 62 | 10, 40, 20, 67, 10, 5, 0, 10, 15, 67, |
63 | 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, | 63 | 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, |
64 | 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, | 64 | 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, |
65 | 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, | 65 | 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, |
66 | 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, | 66 | 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, |
67 | 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, | 67 | 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, |
68 | 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, | 68 | 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, |
69 | 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, | 69 | 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, |
70 | 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, | 70 | 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, |
71 | 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, | 71 | 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, |
72 | 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, | 72 | 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, |
73 | 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, | 73 | 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, |
74 | 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, | 74 | 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, |
75 | 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, | 75 | 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, |
76 | 65, 65, 65, 65, 65, 65 | 76 | 67, 67, 67, 67, 67, 67 |
77 | }; | 77 | }; |
78 | return len + asso_values[(unsigned char)str[2]] + asso_values[(unsigned char)str[0]] + asso_values[(unsigned char)str[len - 1]]; | 78 | return len + asso_values[(unsigned char)str[2]] + asso_values[(unsigned char)str[0]] + asso_values[(unsigned char)str[len - 1]]; |
79 | } | 79 | } |
80 | 80 | ||
81 | #ifdef __GNUC__ | 81 | #ifdef __GNUC__ |
82 | __inline | 82 | __inline |
83 | #ifdef __GNUC_STDC_INLINE__ | 83 | #if defined __GNUC_STDC_INLINE__ || defined __GNUC_GNU_INLINE__ |
84 | __attribute__ ((__gnu_inline__)) | 84 | __attribute__ ((__gnu_inline__)) |
85 | #endif | 85 | #endif |
86 | #endif | 86 | #endif |
@@ -89,116 +89,119 @@ is_reserved_word (register const char *str, register unsigned int len) | |||
89 | { | 89 | { |
90 | enum | 90 | enum |
91 | { | 91 | { |
92 | TOTAL_KEYWORDS = 43, | 92 | TOTAL_KEYWORDS = 45, |
93 | MIN_WORD_LENGTH = 3, | 93 | MIN_WORD_LENGTH = 3, |
94 | MAX_WORD_LENGTH = 24, | 94 | MAX_WORD_LENGTH = 24, |
95 | MIN_HASH_VALUE = 3, | 95 | MIN_HASH_VALUE = 3, |
96 | MAX_HASH_VALUE = 64 | 96 | MAX_HASH_VALUE = 66 |
97 | }; | 97 | }; |
98 | 98 | ||
99 | static const struct resword wordlist[] = | 99 | static const struct resword wordlist[] = |
100 | { | 100 | { |
101 | {""}, {""}, {""}, | 101 | {""}, {""}, {""}, |
102 | #line 28 "scripts/genksyms/keywords.gperf" | 102 | #line 30 "scripts/genksyms/keywords.gperf" |
103 | {"asm", ASM_KEYW}, | 103 | {"asm", ASM_KEYW}, |
104 | {""}, | 104 | {""}, |
105 | #line 10 "scripts/genksyms/keywords.gperf" | 105 | #line 12 "scripts/genksyms/keywords.gperf" |
106 | {"__asm", ASM_KEYW}, | 106 | {"__asm", ASM_KEYW}, |
107 | {""}, | 107 | {""}, |
108 | #line 11 "scripts/genksyms/keywords.gperf" | 108 | #line 13 "scripts/genksyms/keywords.gperf" |
109 | {"__asm__", ASM_KEYW}, | 109 | {"__asm__", ASM_KEYW}, |
110 | {""}, {""}, | 110 | {""}, {""}, |
111 | #line 54 "scripts/genksyms/keywords.gperf" | 111 | #line 56 "scripts/genksyms/keywords.gperf" |
112 | {"__typeof__", TYPEOF_KEYW}, | 112 | {"__typeof__", TYPEOF_KEYW}, |
113 | {""}, | 113 | {""}, |
114 | #line 14 "scripts/genksyms/keywords.gperf" | 114 | #line 16 "scripts/genksyms/keywords.gperf" |
115 | {"__const", CONST_KEYW}, | 115 | {"__const", CONST_KEYW}, |
116 | #line 13 "scripts/genksyms/keywords.gperf" | ||
117 | {"__attribute__", ATTRIBUTE_KEYW}, | ||
118 | #line 15 "scripts/genksyms/keywords.gperf" | 116 | #line 15 "scripts/genksyms/keywords.gperf" |
117 | {"__attribute__", ATTRIBUTE_KEYW}, | ||
118 | #line 17 "scripts/genksyms/keywords.gperf" | ||
119 | {"__const__", CONST_KEYW}, | 119 | {"__const__", CONST_KEYW}, |
120 | #line 20 "scripts/genksyms/keywords.gperf" | 120 | #line 22 "scripts/genksyms/keywords.gperf" |
121 | {"__signed__", SIGNED_KEYW}, | 121 | {"__signed__", SIGNED_KEYW}, |
122 | #line 46 "scripts/genksyms/keywords.gperf" | 122 | #line 48 "scripts/genksyms/keywords.gperf" |
123 | {"static", STATIC_KEYW}, | 123 | {"static", STATIC_KEYW}, |
124 | #line 22 "scripts/genksyms/keywords.gperf" | 124 | {""}, |
125 | {"__volatile__", VOLATILE_KEYW}, | 125 | #line 43 "scripts/genksyms/keywords.gperf" |
126 | #line 41 "scripts/genksyms/keywords.gperf" | ||
127 | {"int", INT_KEYW}, | 126 | {"int", INT_KEYW}, |
128 | #line 34 "scripts/genksyms/keywords.gperf" | 127 | #line 36 "scripts/genksyms/keywords.gperf" |
129 | {"char", CHAR_KEYW}, | 128 | {"char", CHAR_KEYW}, |
130 | #line 35 "scripts/genksyms/keywords.gperf" | 129 | #line 37 "scripts/genksyms/keywords.gperf" |
131 | {"const", CONST_KEYW}, | 130 | {"const", CONST_KEYW}, |
132 | #line 47 "scripts/genksyms/keywords.gperf" | 131 | #line 49 "scripts/genksyms/keywords.gperf" |
133 | {"struct", STRUCT_KEYW}, | 132 | {"struct", STRUCT_KEYW}, |
134 | #line 26 "scripts/genksyms/keywords.gperf" | 133 | #line 28 "scripts/genksyms/keywords.gperf" |
135 | {"__restrict__", RESTRICT_KEYW}, | 134 | {"__restrict__", RESTRICT_KEYW}, |
136 | #line 27 "scripts/genksyms/keywords.gperf" | 135 | #line 29 "scripts/genksyms/keywords.gperf" |
137 | {"restrict", RESTRICT_KEYW}, | 136 | {"restrict", RESTRICT_KEYW}, |
138 | #line 25 "scripts/genksyms/keywords.gperf" | 137 | #line 9 "scripts/genksyms/keywords.gperf" |
139 | {"_restrict", RESTRICT_KEYW}, | 138 | {"EXPORT_SYMBOL_GPL_FUTURE", EXPORT_SYMBOL_KEYW}, |
140 | #line 18 "scripts/genksyms/keywords.gperf" | 139 | #line 20 "scripts/genksyms/keywords.gperf" |
141 | {"__inline__", INLINE_KEYW}, | 140 | {"__inline__", INLINE_KEYW}, |
142 | #line 12 "scripts/genksyms/keywords.gperf" | ||
143 | {"__attribute", ATTRIBUTE_KEYW}, | ||
144 | {""}, | 141 | {""}, |
145 | #line 16 "scripts/genksyms/keywords.gperf" | 142 | #line 24 "scripts/genksyms/keywords.gperf" |
143 | {"__volatile__", VOLATILE_KEYW}, | ||
144 | #line 7 "scripts/genksyms/keywords.gperf" | ||
145 | {"EXPORT_SYMBOL", EXPORT_SYMBOL_KEYW}, | ||
146 | #line 27 "scripts/genksyms/keywords.gperf" | ||
147 | {"_restrict", RESTRICT_KEYW}, | ||
148 | {""}, | ||
149 | #line 14 "scripts/genksyms/keywords.gperf" | ||
150 | {"__attribute", ATTRIBUTE_KEYW}, | ||
151 | #line 8 "scripts/genksyms/keywords.gperf" | ||
152 | {"EXPORT_SYMBOL_GPL", EXPORT_SYMBOL_KEYW}, | ||
153 | #line 18 "scripts/genksyms/keywords.gperf" | ||
146 | {"__extension__", EXTENSION_KEYW}, | 154 | {"__extension__", EXTENSION_KEYW}, |
147 | #line 37 "scripts/genksyms/keywords.gperf" | 155 | #line 39 "scripts/genksyms/keywords.gperf" |
148 | {"enum", ENUM_KEYW}, | 156 | {"enum", ENUM_KEYW}, |
149 | #line 21 "scripts/genksyms/keywords.gperf" | 157 | #line 10 "scripts/genksyms/keywords.gperf" |
150 | {"__volatile", VOLATILE_KEYW}, | 158 | {"EXPORT_UNUSED_SYMBOL", EXPORT_SYMBOL_KEYW}, |
151 | #line 38 "scripts/genksyms/keywords.gperf" | 159 | #line 40 "scripts/genksyms/keywords.gperf" |
152 | {"extern", EXTERN_KEYW}, | 160 | {"extern", EXTERN_KEYW}, |
153 | {""}, | 161 | {""}, |
154 | #line 19 "scripts/genksyms/keywords.gperf" | 162 | #line 21 "scripts/genksyms/keywords.gperf" |
155 | {"__signed", SIGNED_KEYW}, | 163 | {"__signed", SIGNED_KEYW}, |
156 | #line 9 "scripts/genksyms/keywords.gperf" | 164 | #line 11 "scripts/genksyms/keywords.gperf" |
157 | {"EXPORT_SYMBOL_GPL_FUTURE", EXPORT_SYMBOL_KEYW}, | 165 | {"EXPORT_UNUSED_SYMBOL_GPL", EXPORT_SYMBOL_KEYW}, |
158 | {""}, | 166 | #line 51 "scripts/genksyms/keywords.gperf" |
159 | #line 53 "scripts/genksyms/keywords.gperf" | 167 | {"union", UNION_KEYW}, |
168 | #line 55 "scripts/genksyms/keywords.gperf" | ||
160 | {"typeof", TYPEOF_KEYW}, | 169 | {"typeof", TYPEOF_KEYW}, |
161 | #line 48 "scripts/genksyms/keywords.gperf" | 170 | #line 50 "scripts/genksyms/keywords.gperf" |
162 | {"typedef", TYPEDEF_KEYW}, | 171 | {"typedef", TYPEDEF_KEYW}, |
163 | #line 17 "scripts/genksyms/keywords.gperf" | 172 | #line 19 "scripts/genksyms/keywords.gperf" |
164 | {"__inline", INLINE_KEYW}, | 173 | {"__inline", INLINE_KEYW}, |
165 | #line 33 "scripts/genksyms/keywords.gperf" | 174 | #line 35 "scripts/genksyms/keywords.gperf" |
166 | {"auto", AUTO_KEYW}, | 175 | {"auto", AUTO_KEYW}, |
167 | #line 49 "scripts/genksyms/keywords.gperf" | 176 | #line 23 "scripts/genksyms/keywords.gperf" |
168 | {"union", UNION_KEYW}, | 177 | {"__volatile", VOLATILE_KEYW}, |
169 | {""}, {""}, | ||
170 | #line 50 "scripts/genksyms/keywords.gperf" | ||
171 | {"unsigned", UNSIGNED_KEYW}, | ||
172 | #line 51 "scripts/genksyms/keywords.gperf" | ||
173 | {"void", VOID_KEYW}, | ||
174 | #line 44 "scripts/genksyms/keywords.gperf" | ||
175 | {"short", SHORT_KEYW}, | ||
176 | {""}, {""}, | 178 | {""}, {""}, |
177 | #line 52 "scripts/genksyms/keywords.gperf" | 179 | #line 52 "scripts/genksyms/keywords.gperf" |
178 | {"volatile", VOLATILE_KEYW}, | 180 | {"unsigned", UNSIGNED_KEYW}, |
179 | {""}, | ||
180 | #line 39 "scripts/genksyms/keywords.gperf" | ||
181 | {"float", FLOAT_KEYW}, | ||
182 | #line 36 "scripts/genksyms/keywords.gperf" | ||
183 | {"double", DOUBLE_KEYW}, | ||
184 | {""}, | 181 | {""}, |
185 | #line 7 "scripts/genksyms/keywords.gperf" | 182 | #line 46 "scripts/genksyms/keywords.gperf" |
186 | {"EXPORT_SYMBOL", EXPORT_SYMBOL_KEYW}, | 183 | {"short", SHORT_KEYW}, |
187 | {""}, {""}, | 184 | #line 42 "scripts/genksyms/keywords.gperf" |
188 | #line 40 "scripts/genksyms/keywords.gperf" | ||
189 | {"inline", INLINE_KEYW}, | 185 | {"inline", INLINE_KEYW}, |
190 | #line 8 "scripts/genksyms/keywords.gperf" | ||
191 | {"EXPORT_SYMBOL_GPL", EXPORT_SYMBOL_KEYW}, | ||
192 | #line 43 "scripts/genksyms/keywords.gperf" | ||
193 | {"register", REGISTER_KEYW}, | ||
194 | {""}, | 186 | {""}, |
195 | #line 24 "scripts/genksyms/keywords.gperf" | 187 | #line 54 "scripts/genksyms/keywords.gperf" |
188 | {"volatile", VOLATILE_KEYW}, | ||
189 | #line 44 "scripts/genksyms/keywords.gperf" | ||
190 | {"long", LONG_KEYW}, | ||
191 | #line 26 "scripts/genksyms/keywords.gperf" | ||
196 | {"_Bool", BOOL_KEYW}, | 192 | {"_Bool", BOOL_KEYW}, |
197 | #line 45 "scripts/genksyms/keywords.gperf" | ||
198 | {"signed", SIGNED_KEYW}, | ||
199 | {""}, {""}, | 193 | {""}, {""}, |
200 | #line 42 "scripts/genksyms/keywords.gperf" | 194 | #line 45 "scripts/genksyms/keywords.gperf" |
201 | {"long", LONG_KEYW} | 195 | {"register", REGISTER_KEYW}, |
196 | #line 53 "scripts/genksyms/keywords.gperf" | ||
197 | {"void", VOID_KEYW}, | ||
198 | #line 41 "scripts/genksyms/keywords.gperf" | ||
199 | {"float", FLOAT_KEYW}, | ||
200 | #line 38 "scripts/genksyms/keywords.gperf" | ||
201 | {"double", DOUBLE_KEYW}, | ||
202 | {""}, {""}, {""}, {""}, | ||
203 | #line 47 "scripts/genksyms/keywords.gperf" | ||
204 | {"signed", SIGNED_KEYW} | ||
202 | }; | 205 | }; |
203 | 206 | ||
204 | if (len <= MAX_WORD_LENGTH && len >= MIN_WORD_LENGTH) | 207 | if (len <= MAX_WORD_LENGTH && len >= MIN_WORD_LENGTH) |
diff --git a/scripts/genksyms/keywords.gperf b/scripts/genksyms/keywords.gperf index 8fe977a4d57b..e6349acb6f2f 100644 --- a/scripts/genksyms/keywords.gperf +++ b/scripts/genksyms/keywords.gperf | |||
@@ -7,6 +7,8 @@ struct resword { const char *name; int token; } | |||
7 | EXPORT_SYMBOL, EXPORT_SYMBOL_KEYW | 7 | EXPORT_SYMBOL, EXPORT_SYMBOL_KEYW |
8 | EXPORT_SYMBOL_GPL, EXPORT_SYMBOL_KEYW | 8 | EXPORT_SYMBOL_GPL, EXPORT_SYMBOL_KEYW |
9 | EXPORT_SYMBOL_GPL_FUTURE, EXPORT_SYMBOL_KEYW | 9 | EXPORT_SYMBOL_GPL_FUTURE, EXPORT_SYMBOL_KEYW |
10 | EXPORT_UNUSED_SYMBOL, EXPORT_SYMBOL_KEYW | ||
11 | EXPORT_UNUSED_SYMBOL_GPL, EXPORT_SYMBOL_KEYW | ||
10 | __asm, ASM_KEYW | 12 | __asm, ASM_KEYW |
11 | __asm__, ASM_KEYW | 13 | __asm__, ASM_KEYW |
12 | __attribute, ATTRIBUTE_KEYW | 14 | __attribute, ATTRIBUTE_KEYW |
diff --git a/scripts/headers.sh b/scripts/headers.sh index 0308ecc10d5b..1ddcdd38d97f 100755 --- a/scripts/headers.sh +++ b/scripts/headers.sh | |||
@@ -8,8 +8,6 @@ do_command() | |||
8 | { | 8 | { |
9 | if [ -f ${srctree}/arch/$2/include/asm/Kbuild ]; then | 9 | if [ -f ${srctree}/arch/$2/include/asm/Kbuild ]; then |
10 | make ARCH=$2 KBUILD_HEADERS=$1 headers_$1 | 10 | make ARCH=$2 KBUILD_HEADERS=$1 headers_$1 |
11 | elif [ -f ${srctree}/include/asm-$2/Kbuild ]; then | ||
12 | make ARCH=$2 KBUILD_HEADERS=$1 headers_$1 | ||
13 | else | 11 | else |
14 | printf "Ignoring arch: %s\n" ${arch} | 12 | printf "Ignoring arch: %s\n" ${arch} |
15 | fi | 13 | fi |
diff --git a/scripts/kconfig/Makefile b/scripts/kconfig/Makefile index 80599e3a7994..999e8a7d5bf7 100644 --- a/scripts/kconfig/Makefile +++ b/scripts/kconfig/Makefile | |||
@@ -27,6 +27,7 @@ oldconfig: $(obj)/conf | |||
27 | $< -o $(Kconfig) | 27 | $< -o $(Kconfig) |
28 | 28 | ||
29 | silentoldconfig: $(obj)/conf | 29 | silentoldconfig: $(obj)/conf |
30 | $(Q)mkdir -p include/generated | ||
30 | $< -s $(Kconfig) | 31 | $< -s $(Kconfig) |
31 | 32 | ||
32 | localmodconfig: $(obj)/streamline_config.pl $(obj)/conf | 33 | localmodconfig: $(obj)/streamline_config.pl $(obj)/conf |
diff --git a/scripts/kconfig/confdata.c b/scripts/kconfig/confdata.c index b55e72ff2fc6..c4dec80cfd8e 100644 --- a/scripts/kconfig/confdata.c +++ b/scripts/kconfig/confdata.c | |||
@@ -677,7 +677,7 @@ int conf_write_autoconf(void) | |||
677 | struct symbol *sym; | 677 | struct symbol *sym; |
678 | const char *str; | 678 | const char *str; |
679 | const char *name; | 679 | const char *name; |
680 | FILE *out, *out_h; | 680 | FILE *out, *tristate, *out_h; |
681 | time_t now; | 681 | time_t now; |
682 | int i, l; | 682 | int i, l; |
683 | 683 | ||
@@ -692,9 +692,16 @@ int conf_write_autoconf(void) | |||
692 | if (!out) | 692 | if (!out) |
693 | return 1; | 693 | return 1; |
694 | 694 | ||
695 | tristate = fopen(".tmpconfig_tristate", "w"); | ||
696 | if (!tristate) { | ||
697 | fclose(out); | ||
698 | return 1; | ||
699 | } | ||
700 | |||
695 | out_h = fopen(".tmpconfig.h", "w"); | 701 | out_h = fopen(".tmpconfig.h", "w"); |
696 | if (!out_h) { | 702 | if (!out_h) { |
697 | fclose(out); | 703 | fclose(out); |
704 | fclose(tristate); | ||
698 | return 1; | 705 | return 1; |
699 | } | 706 | } |
700 | 707 | ||
@@ -707,6 +714,9 @@ int conf_write_autoconf(void) | |||
707 | "# %s" | 714 | "# %s" |
708 | "#\n", | 715 | "#\n", |
709 | sym_get_string_value(sym), ctime(&now)); | 716 | sym_get_string_value(sym), ctime(&now)); |
717 | fprintf(tristate, "#\n" | ||
718 | "# Automatically generated - do not edit\n" | ||
719 | "\n"); | ||
710 | fprintf(out_h, "/*\n" | 720 | fprintf(out_h, "/*\n" |
711 | " * Automatically generated C config: don't edit\n" | 721 | " * Automatically generated C config: don't edit\n" |
712 | " * Linux kernel version: %s\n" | 722 | " * Linux kernel version: %s\n" |
@@ -727,10 +737,14 @@ int conf_write_autoconf(void) | |||
727 | break; | 737 | break; |
728 | case mod: | 738 | case mod: |
729 | fprintf(out, "CONFIG_%s=m\n", sym->name); | 739 | fprintf(out, "CONFIG_%s=m\n", sym->name); |
740 | fprintf(tristate, "CONFIG_%s=M\n", sym->name); | ||
730 | fprintf(out_h, "#define CONFIG_%s_MODULE 1\n", sym->name); | 741 | fprintf(out_h, "#define CONFIG_%s_MODULE 1\n", sym->name); |
731 | break; | 742 | break; |
732 | case yes: | 743 | case yes: |
733 | fprintf(out, "CONFIG_%s=y\n", sym->name); | 744 | fprintf(out, "CONFIG_%s=y\n", sym->name); |
745 | if (sym->type == S_TRISTATE) | ||
746 | fprintf(tristate, "CONFIG_%s=Y\n", | ||
747 | sym->name); | ||
734 | fprintf(out_h, "#define CONFIG_%s 1\n", sym->name); | 748 | fprintf(out_h, "#define CONFIG_%s 1\n", sym->name); |
735 | break; | 749 | break; |
736 | } | 750 | } |
@@ -772,13 +786,19 @@ int conf_write_autoconf(void) | |||
772 | } | 786 | } |
773 | } | 787 | } |
774 | fclose(out); | 788 | fclose(out); |
789 | fclose(tristate); | ||
775 | fclose(out_h); | 790 | fclose(out_h); |
776 | 791 | ||
777 | name = getenv("KCONFIG_AUTOHEADER"); | 792 | name = getenv("KCONFIG_AUTOHEADER"); |
778 | if (!name) | 793 | if (!name) |
779 | name = "include/linux/autoconf.h"; | 794 | name = "include/generated/autoconf.h"; |
780 | if (rename(".tmpconfig.h", name)) | 795 | if (rename(".tmpconfig.h", name)) |
781 | return 1; | 796 | return 1; |
797 | name = getenv("KCONFIG_TRISTATE"); | ||
798 | if (!name) | ||
799 | name = "include/config/tristate.conf"; | ||
800 | if (rename(".tmpconfig_tristate", name)) | ||
801 | return 1; | ||
782 | name = conf_get_autoconfig_name(); | 802 | name = conf_get_autoconfig_name(); |
783 | /* | 803 | /* |
784 | * This must be the last step, kbuild has a dependency on auto.conf | 804 | * This must be the last step, kbuild has a dependency on auto.conf |
diff --git a/scripts/mkcompile_h b/scripts/mkcompile_h index bce3d0fe6fbd..23dbad80cce9 100755 --- a/scripts/mkcompile_h +++ b/scripts/mkcompile_h | |||
@@ -14,7 +14,7 @@ vecho() { [ "${quiet}" = "silent_" ] || echo "$@" ; } | |||
14 | # So "sudo make install" won't change the "compiled by <user>" | 14 | # So "sudo make install" won't change the "compiled by <user>" |
15 | # do "compiled by root" | 15 | # do "compiled by root" |
16 | 16 | ||
17 | if [ -r $TARGET -a ! -O include/linux/autoconf.h ]; then | 17 | if [ -r $TARGET -a ! -O include/generated/autoconf.h ]; then |
18 | vecho " SKIPPED $TARGET" | 18 | vecho " SKIPPED $TARGET" |
19 | exit 0 | 19 | exit 0 |
20 | fi | 20 | fi |
diff --git a/scripts/mod/modpost.c b/scripts/mod/modpost.c index 6c4ffc767b91..20923613467c 100644 --- a/scripts/mod/modpost.c +++ b/scripts/mod/modpost.c | |||
@@ -15,7 +15,7 @@ | |||
15 | #include <stdio.h> | 15 | #include <stdio.h> |
16 | #include <ctype.h> | 16 | #include <ctype.h> |
17 | #include "modpost.h" | 17 | #include "modpost.h" |
18 | #include "../../include/linux/autoconf.h" | 18 | #include "../../include/generated/autoconf.h" |
19 | #include "../../include/linux/license.h" | 19 | #include "../../include/linux/license.h" |
20 | 20 | ||
21 | /* Some toolchains use a `_' prefix for all user symbols. */ | 21 | /* Some toolchains use a `_' prefix for all user symbols. */ |
diff --git a/scripts/package/Makefile b/scripts/package/Makefile index f67cc885c807..62fcc3a7f4d3 100644 --- a/scripts/package/Makefile +++ b/scripts/package/Makefile | |||
@@ -77,9 +77,27 @@ clean-files += $(objtree)/binkernel.spec | |||
77 | 77 | ||
78 | # Deb target | 78 | # Deb target |
79 | # --------------------------------------------------------------------------- | 79 | # --------------------------------------------------------------------------- |
80 | quiet_cmd_builddeb = BUILDDEB | ||
81 | cmd_builddeb = set -e; \ | ||
82 | test `id -u` = 0 || \ | ||
83 | test -n "$(KBUILD_PKG_ROOTCMD)" || { \ | ||
84 | which fakeroot >/dev/null 2>&1 && \ | ||
85 | KBUILD_PKG_ROOTCMD="fakeroot -u"; \ | ||
86 | } || { \ | ||
87 | echo; \ | ||
88 | echo "builddeb must be run as root (or using fakeroot)."; \ | ||
89 | echo "KBUILD_PKG_ROOTCMD is unset and fakeroot not found."; \ | ||
90 | echo "Try setting KBUILD_PKG_ROOTCMD to a command to acquire"; \ | ||
91 | echo "root privileges (e.g., 'fakeroot -u' or 'sudo')."; \ | ||
92 | false; \ | ||
93 | } && \ | ||
94 | \ | ||
95 | $$KBUILD_PKG_ROOTCMD $(CONFIG_SHELL) \ | ||
96 | $(srctree)/scripts/package/builddeb | ||
97 | |||
80 | deb-pkg: FORCE | 98 | deb-pkg: FORCE |
81 | $(MAKE) KBUILD_SRC= | 99 | $(MAKE) KBUILD_SRC= |
82 | $(CONFIG_SHELL) $(srctree)/scripts/package/builddeb | 100 | $(call cmd,builddeb) |
83 | 101 | ||
84 | clean-dirs += $(objtree)/debian/ | 102 | clean-dirs += $(objtree)/debian/ |
85 | 103 | ||
diff --git a/scripts/package/buildtar b/scripts/package/buildtar index b1fd48db1640..51b2aa0acb82 100644 --- a/scripts/package/buildtar +++ b/scripts/package/buildtar | |||
@@ -101,7 +101,11 @@ esac | |||
101 | # | 101 | # |
102 | ( | 102 | ( |
103 | cd "${tmpdir}" | 103 | cd "${tmpdir}" |
104 | tar cf - . | ${compress} > "${tarball}${file_ext}" | 104 | opts= |
105 | if tar --owner=root --group=root --help >/dev/null 2>&1; then | ||
106 | opts="--owner=root --group=root" | ||
107 | fi | ||
108 | tar cf - . $opts | ${compress} > "${tarball}${file_ext}" | ||
105 | ) | 109 | ) |
106 | 110 | ||
107 | echo "Tarball successfully created in ${tarball}${file_ext}" | 111 | echo "Tarball successfully created in ${tarball}${file_ext}" |
diff --git a/scripts/tags.sh b/scripts/tags.sh index d52f7a01557c..1a0c44d7c4a7 100755 --- a/scripts/tags.sh +++ b/scripts/tags.sh | |||
@@ -89,7 +89,13 @@ all_defconfigs() | |||
89 | 89 | ||
90 | docscope() | 90 | docscope() |
91 | { | 91 | { |
92 | (echo \-k; echo \-q; all_sources) > cscope.files | 92 | # always use absolute paths for cscope, as recommended by cscope |
93 | # upstream | ||
94 | case "$tree" in | ||
95 | /*) ;; | ||
96 | *) tree=$PWD/$tree ;; | ||
97 | esac | ||
98 | (cd /; echo \-k; echo \-q; all_sources) > cscope.files | ||
93 | cscope -b -f cscope.out | 99 | cscope -b -f cscope.out |
94 | } | 100 | } |
95 | 101 | ||
diff --git a/scripts/unifdef.c b/scripts/unifdef.c index 30d459fb0709..44d39785e50d 100644 --- a/scripts/unifdef.c +++ b/scripts/unifdef.c | |||
@@ -1,13 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | * Copyright (c) 2002 - 2005 Tony Finch <dot@dotat.at>. All rights reserved. | 2 | * Copyright (c) 2002 - 2009 Tony Finch <dot@dotat.at> |
3 | * | ||
4 | * This code is derived from software contributed to Berkeley by Dave Yost. | ||
5 | * It was rewritten to support ANSI C by Tony Finch. The original version of | ||
6 | * unifdef carried the following copyright notice. None of its code remains | ||
7 | * in this version (though some of the names remain). | ||
8 | * | ||
9 | * Copyright (c) 1985, 1993 | ||
10 | * The Regents of the University of California. All rights reserved. | ||
11 | * | 3 | * |
12 | * Redistribution and use in source and binary forms, with or without | 4 | * Redistribution and use in source and binary forms, with or without |
13 | * modification, are permitted provided that the following conditions | 5 | * modification, are permitted provided that the following conditions |
@@ -31,23 +23,20 @@ | |||
31 | * SUCH DAMAGE. | 23 | * SUCH DAMAGE. |
32 | */ | 24 | */ |
33 | 25 | ||
34 | #include <sys/cdefs.h> | 26 | /* |
27 | * This code was derived from software contributed to Berkeley by Dave Yost. | ||
28 | * It was rewritten to support ANSI C by Tony Finch. The original version | ||
29 | * of unifdef carried the 4-clause BSD copyright licence. None of its code | ||
30 | * remains in this version (though some of the names remain) so it now | ||
31 | * carries a more liberal licence. | ||
32 | * | ||
33 | * The latest version is available from http://dotat.at/prog/unifdef | ||
34 | */ | ||
35 | 35 | ||
36 | #ifndef lint | 36 | static const char * const copyright[] = { |
37 | #if 0 | 37 | "@(#) Copyright (c) 2002 - 2009 Tony Finch <dot@dotat.at>\n", |
38 | static const char copyright[] = | 38 | "$dotat: unifdef/unifdef.c,v 1.190 2009/11/27 17:21:26 fanf2 Exp $", |
39 | "@(#) Copyright (c) 1985, 1993\n\ | 39 | }; |
40 | The Regents of the University of California. All rights reserved.\n"; | ||
41 | #endif | ||
42 | #ifdef __IDSTRING | ||
43 | __IDSTRING(Berkeley, "@(#)unifdef.c 8.1 (Berkeley) 6/6/93"); | ||
44 | __IDSTRING(NetBSD, "$NetBSD: unifdef.c,v 1.8 2000/07/03 02:51:36 matt Exp $"); | ||
45 | __IDSTRING(dotat, "$dotat: things/unifdef.c,v 1.171 2005/03/08 12:38:48 fanf2 Exp $"); | ||
46 | #endif | ||
47 | #endif /* not lint */ | ||
48 | #ifdef __FBSDID | ||
49 | __FBSDID("$FreeBSD: /repoman/r/ncvs/src/usr.bin/unifdef/unifdef.c,v 1.20 2005/05/21 09:55:09 ru Exp $"); | ||
50 | #endif | ||
51 | 40 | ||
52 | /* | 41 | /* |
53 | * unifdef - remove ifdef'ed lines | 42 | * unifdef - remove ifdef'ed lines |
@@ -72,8 +61,6 @@ __FBSDID("$FreeBSD: /repoman/r/ncvs/src/usr.bin/unifdef/unifdef.c,v 1.20 2005/05 | |||
72 | #include <string.h> | 61 | #include <string.h> |
73 | #include <unistd.h> | 62 | #include <unistd.h> |
74 | 63 | ||
75 | size_t strlcpy(char *dst, const char *src, size_t siz); | ||
76 | |||
77 | /* types of input lines: */ | 64 | /* types of input lines: */ |
78 | typedef enum { | 65 | typedef enum { |
79 | LT_TRUEI, /* a true #if with ignore flag */ | 66 | LT_TRUEI, /* a true #if with ignore flag */ |
@@ -90,6 +77,7 @@ typedef enum { | |||
90 | LT_DODGY_LAST = LT_DODGY + LT_ENDIF, | 77 | LT_DODGY_LAST = LT_DODGY + LT_ENDIF, |
91 | LT_PLAIN, /* ordinary line */ | 78 | LT_PLAIN, /* ordinary line */ |
92 | LT_EOF, /* end of file */ | 79 | LT_EOF, /* end of file */ |
80 | LT_ERROR, /* unevaluable #if */ | ||
93 | LT_COUNT | 81 | LT_COUNT |
94 | } Linetype; | 82 | } Linetype; |
95 | 83 | ||
@@ -100,7 +88,7 @@ static char const * const linetype_name[] = { | |||
100 | "DODGY IF", "DODGY TRUE", "DODGY FALSE", | 88 | "DODGY IF", "DODGY TRUE", "DODGY FALSE", |
101 | "DODGY ELIF", "DODGY ELTRUE", "DODGY ELFALSE", | 89 | "DODGY ELIF", "DODGY ELTRUE", "DODGY ELFALSE", |
102 | "DODGY ELSE", "DODGY ENDIF", | 90 | "DODGY ELSE", "DODGY ENDIF", |
103 | "PLAIN", "EOF" | 91 | "PLAIN", "EOF", "ERROR" |
104 | }; | 92 | }; |
105 | 93 | ||
106 | /* state of #if processing */ | 94 | /* state of #if processing */ |
@@ -168,11 +156,13 @@ static char const * const linestate_name[] = { | |||
168 | * Globals. | 156 | * Globals. |
169 | */ | 157 | */ |
170 | 158 | ||
159 | static bool compblank; /* -B: compress blank lines */ | ||
160 | static bool lnblank; /* -b: blank deleted lines */ | ||
171 | static bool complement; /* -c: do the complement */ | 161 | static bool complement; /* -c: do the complement */ |
172 | static bool debugging; /* -d: debugging reports */ | 162 | static bool debugging; /* -d: debugging reports */ |
173 | static bool iocccok; /* -e: fewer IOCCC errors */ | 163 | static bool iocccok; /* -e: fewer IOCCC errors */ |
164 | static bool strictlogic; /* -K: keep ambiguous #ifs */ | ||
174 | static bool killconsts; /* -k: eval constant #ifs */ | 165 | static bool killconsts; /* -k: eval constant #ifs */ |
175 | static bool lnblank; /* -l: blank deleted lines */ | ||
176 | static bool lnnum; /* -n: add #line directives */ | 166 | static bool lnnum; /* -n: add #line directives */ |
177 | static bool symlist; /* -s: output symbol list */ | 167 | static bool symlist; /* -s: output symbol list */ |
178 | static bool text; /* -t: this is a text file */ | 168 | static bool text; /* -t: this is a text file */ |
@@ -196,7 +186,9 @@ static bool ignoring[MAXDEPTH]; /* ignore comments state */ | |||
196 | static int stifline[MAXDEPTH]; /* start of current #if */ | 186 | static int stifline[MAXDEPTH]; /* start of current #if */ |
197 | static int depth; /* current #if nesting */ | 187 | static int depth; /* current #if nesting */ |
198 | static int delcount; /* count of deleted lines */ | 188 | static int delcount; /* count of deleted lines */ |
199 | static bool keepthis; /* don't delete constant #if */ | 189 | static unsigned blankcount; /* count of blank lines */ |
190 | static unsigned blankmax; /* maximum recent blankcount */ | ||
191 | static bool constexpr; /* constant #if expression */ | ||
200 | 192 | ||
201 | static int exitstat; /* program exit status */ | 193 | static int exitstat; /* program exit status */ |
202 | 194 | ||
@@ -206,13 +198,14 @@ static void done(void); | |||
206 | static void error(const char *); | 198 | static void error(const char *); |
207 | static int findsym(const char *); | 199 | static int findsym(const char *); |
208 | static void flushline(bool); | 200 | static void flushline(bool); |
209 | static Linetype get_line(void); | 201 | static Linetype parseline(void); |
210 | static Linetype ifeval(const char **); | 202 | static Linetype ifeval(const char **); |
211 | static void ignoreoff(void); | 203 | static void ignoreoff(void); |
212 | static void ignoreon(void); | 204 | static void ignoreon(void); |
213 | static void keywordedit(const char *); | 205 | static void keywordedit(const char *); |
214 | static void nest(void); | 206 | static void nest(void); |
215 | static void process(void); | 207 | static void process(void); |
208 | static const char *skipargs(const char *); | ||
216 | static const char *skipcomment(const char *); | 209 | static const char *skipcomment(const char *); |
217 | static const char *skipsym(const char *); | 210 | static const char *skipsym(const char *); |
218 | static void state(Ifstate); | 211 | static void state(Ifstate); |
@@ -220,7 +213,7 @@ static int strlcmp(const char *, const char *, size_t); | |||
220 | static void unnest(void); | 213 | static void unnest(void); |
221 | static void usage(void); | 214 | static void usage(void); |
222 | 215 | ||
223 | #define endsym(c) (!isalpha((unsigned char)c) && !isdigit((unsigned char)c) && c != '_') | 216 | #define endsym(c) (!isalnum((unsigned char)c) && c != '_') |
224 | 217 | ||
225 | /* | 218 | /* |
226 | * The main program. | 219 | * The main program. |
@@ -230,7 +223,7 @@ main(int argc, char *argv[]) | |||
230 | { | 223 | { |
231 | int opt; | 224 | int opt; |
232 | 225 | ||
233 | while ((opt = getopt(argc, argv, "i:D:U:I:cdeklnst")) != -1) | 226 | while ((opt = getopt(argc, argv, "i:D:U:I:BbcdeKklnst")) != -1) |
234 | switch (opt) { | 227 | switch (opt) { |
235 | case 'i': /* treat stuff controlled by these symbols as text */ | 228 | case 'i': /* treat stuff controlled by these symbols as text */ |
236 | /* | 229 | /* |
@@ -255,6 +248,13 @@ main(int argc, char *argv[]) | |||
255 | case 'I': | 248 | case 'I': |
256 | /* no-op for compatibility with cpp */ | 249 | /* no-op for compatibility with cpp */ |
257 | break; | 250 | break; |
251 | case 'B': /* compress blank lines around removed section */ | ||
252 | compblank = true; | ||
253 | break; | ||
254 | case 'b': /* blank deleted lines instead of omitting them */ | ||
255 | case 'l': /* backwards compatibility */ | ||
256 | lnblank = true; | ||
257 | break; | ||
258 | case 'c': /* treat -D as -U and vice versa */ | 258 | case 'c': /* treat -D as -U and vice versa */ |
259 | complement = true; | 259 | complement = true; |
260 | break; | 260 | break; |
@@ -264,12 +264,12 @@ main(int argc, char *argv[]) | |||
264 | case 'e': /* fewer errors from dodgy lines */ | 264 | case 'e': /* fewer errors from dodgy lines */ |
265 | iocccok = true; | 265 | iocccok = true; |
266 | break; | 266 | break; |
267 | case 'K': /* keep ambiguous #ifs */ | ||
268 | strictlogic = true; | ||
269 | break; | ||
267 | case 'k': /* process constant #ifs */ | 270 | case 'k': /* process constant #ifs */ |
268 | killconsts = true; | 271 | killconsts = true; |
269 | break; | 272 | break; |
270 | case 'l': /* blank deleted lines instead of omitting them */ | ||
271 | lnblank = true; | ||
272 | break; | ||
273 | case 'n': /* add #line directive after deleted lines */ | 273 | case 'n': /* add #line directive after deleted lines */ |
274 | lnnum = true; | 274 | lnnum = true; |
275 | break; | 275 | break; |
@@ -284,6 +284,8 @@ main(int argc, char *argv[]) | |||
284 | } | 284 | } |
285 | argc -= optind; | 285 | argc -= optind; |
286 | argv += optind; | 286 | argv += optind; |
287 | if (compblank && lnblank) | ||
288 | errx(2, "-B and -b are mutually exclusive"); | ||
287 | if (argc > 1) { | 289 | if (argc > 1) { |
288 | errx(2, "can only do one file"); | 290 | errx(2, "can only do one file"); |
289 | } else if (argc == 1 && strcmp(*argv, "-") != 0) { | 291 | } else if (argc == 1 && strcmp(*argv, "-") != 0) { |
@@ -302,7 +304,7 @@ main(int argc, char *argv[]) | |||
302 | static void | 304 | static void |
303 | usage(void) | 305 | usage(void) |
304 | { | 306 | { |
305 | fprintf(stderr, "usage: unifdef [-cdeklnst] [-Ipath]" | 307 | fprintf(stderr, "usage: unifdef [-BbcdeKknst] [-Ipath]" |
306 | " [-Dsym[=val]] [-Usym] [-iDsym[=val]] [-iUsym] ... [file]\n"); | 308 | " [-Dsym[=val]] [-Usym] [-iDsym[=val]] [-iUsym] ... [file]\n"); |
307 | exit(2); | 309 | exit(2); |
308 | } | 310 | } |
@@ -383,46 +385,46 @@ static state_fn * const trans_table[IS_COUNT][LT_COUNT] = { | |||
383 | /* IS_OUTSIDE */ | 385 | /* IS_OUTSIDE */ |
384 | { Itrue, Ifalse,Fpass, Ftrue, Ffalse,Eelif, Eelif, Eelif, Eelse, Eendif, | 386 | { Itrue, Ifalse,Fpass, Ftrue, Ffalse,Eelif, Eelif, Eelif, Eelse, Eendif, |
385 | Oiffy, Oiffy, Fpass, Oif, Oif, Eelif, Eelif, Eelif, Eelse, Eendif, | 387 | Oiffy, Oiffy, Fpass, Oif, Oif, Eelif, Eelif, Eelif, Eelse, Eendif, |
386 | print, done }, | 388 | print, done, abort }, |
387 | /* IS_FALSE_PREFIX */ | 389 | /* IS_FALSE_PREFIX */ |
388 | { Idrop, Idrop, Fdrop, Fdrop, Fdrop, Mpass, Strue, Sfalse,Selse, Dendif, | 390 | { Idrop, Idrop, Fdrop, Fdrop, Fdrop, Mpass, Strue, Sfalse,Selse, Dendif, |
389 | Idrop, Idrop, Fdrop, Fdrop, Fdrop, Mpass, Eioccc,Eioccc,Eioccc,Eioccc, | 391 | Idrop, Idrop, Fdrop, Fdrop, Fdrop, Mpass, Eioccc,Eioccc,Eioccc,Eioccc, |
390 | drop, Eeof }, | 392 | drop, Eeof, abort }, |
391 | /* IS_TRUE_PREFIX */ | 393 | /* IS_TRUE_PREFIX */ |
392 | { Itrue, Ifalse,Fpass, Ftrue, Ffalse,Dfalse,Dfalse,Dfalse,Delse, Dendif, | 394 | { Itrue, Ifalse,Fpass, Ftrue, Ffalse,Dfalse,Dfalse,Dfalse,Delse, Dendif, |
393 | Oiffy, Oiffy, Fpass, Oif, Oif, Eioccc,Eioccc,Eioccc,Eioccc,Eioccc, | 395 | Oiffy, Oiffy, Fpass, Oif, Oif, Eioccc,Eioccc,Eioccc,Eioccc,Eioccc, |
394 | print, Eeof }, | 396 | print, Eeof, abort }, |
395 | /* IS_PASS_MIDDLE */ | 397 | /* IS_PASS_MIDDLE */ |
396 | { Itrue, Ifalse,Fpass, Ftrue, Ffalse,Pelif, Mtrue, Delif, Pelse, Pendif, | 398 | { Itrue, Ifalse,Fpass, Ftrue, Ffalse,Pelif, Mtrue, Delif, Pelse, Pendif, |
397 | Oiffy, Oiffy, Fpass, Oif, Oif, Pelif, Oelif, Oelif, Pelse, Pendif, | 399 | Oiffy, Oiffy, Fpass, Oif, Oif, Pelif, Oelif, Oelif, Pelse, Pendif, |
398 | print, Eeof }, | 400 | print, Eeof, abort }, |
399 | /* IS_FALSE_MIDDLE */ | 401 | /* IS_FALSE_MIDDLE */ |
400 | { Idrop, Idrop, Fdrop, Fdrop, Fdrop, Pelif, Mtrue, Delif, Pelse, Pendif, | 402 | { Idrop, Idrop, Fdrop, Fdrop, Fdrop, Pelif, Mtrue, Delif, Pelse, Pendif, |
401 | Idrop, Idrop, Fdrop, Fdrop, Fdrop, Eioccc,Eioccc,Eioccc,Eioccc,Eioccc, | 403 | Idrop, Idrop, Fdrop, Fdrop, Fdrop, Eioccc,Eioccc,Eioccc,Eioccc,Eioccc, |
402 | drop, Eeof }, | 404 | drop, Eeof, abort }, |
403 | /* IS_TRUE_MIDDLE */ | 405 | /* IS_TRUE_MIDDLE */ |
404 | { Itrue, Ifalse,Fpass, Ftrue, Ffalse,Melif, Melif, Melif, Melse, Pendif, | 406 | { Itrue, Ifalse,Fpass, Ftrue, Ffalse,Melif, Melif, Melif, Melse, Pendif, |
405 | Oiffy, Oiffy, Fpass, Oif, Oif, Eioccc,Eioccc,Eioccc,Eioccc,Pendif, | 407 | Oiffy, Oiffy, Fpass, Oif, Oif, Eioccc,Eioccc,Eioccc,Eioccc,Pendif, |
406 | print, Eeof }, | 408 | print, Eeof, abort }, |
407 | /* IS_PASS_ELSE */ | 409 | /* IS_PASS_ELSE */ |
408 | { Itrue, Ifalse,Fpass, Ftrue, Ffalse,Eelif, Eelif, Eelif, Eelse, Pendif, | 410 | { Itrue, Ifalse,Fpass, Ftrue, Ffalse,Eelif, Eelif, Eelif, Eelse, Pendif, |
409 | Oiffy, Oiffy, Fpass, Oif, Oif, Eelif, Eelif, Eelif, Eelse, Pendif, | 411 | Oiffy, Oiffy, Fpass, Oif, Oif, Eelif, Eelif, Eelif, Eelse, Pendif, |
410 | print, Eeof }, | 412 | print, Eeof, abort }, |
411 | /* IS_FALSE_ELSE */ | 413 | /* IS_FALSE_ELSE */ |
412 | { Idrop, Idrop, Fdrop, Fdrop, Fdrop, Eelif, Eelif, Eelif, Eelse, Dendif, | 414 | { Idrop, Idrop, Fdrop, Fdrop, Fdrop, Eelif, Eelif, Eelif, Eelse, Dendif, |
413 | Idrop, Idrop, Fdrop, Fdrop, Fdrop, Eelif, Eelif, Eelif, Eelse, Eioccc, | 415 | Idrop, Idrop, Fdrop, Fdrop, Fdrop, Eelif, Eelif, Eelif, Eelse, Eioccc, |
414 | drop, Eeof }, | 416 | drop, Eeof, abort }, |
415 | /* IS_TRUE_ELSE */ | 417 | /* IS_TRUE_ELSE */ |
416 | { Itrue, Ifalse,Fpass, Ftrue, Ffalse,Eelif, Eelif, Eelif, Eelse, Dendif, | 418 | { Itrue, Ifalse,Fpass, Ftrue, Ffalse,Eelif, Eelif, Eelif, Eelse, Dendif, |
417 | Oiffy, Oiffy, Fpass, Oif, Oif, Eelif, Eelif, Eelif, Eelse, Eioccc, | 419 | Oiffy, Oiffy, Fpass, Oif, Oif, Eelif, Eelif, Eelif, Eelse, Eioccc, |
418 | print, Eeof }, | 420 | print, Eeof, abort }, |
419 | /* IS_FALSE_TRAILER */ | 421 | /* IS_FALSE_TRAILER */ |
420 | { Idrop, Idrop, Fdrop, Fdrop, Fdrop, Dfalse,Dfalse,Dfalse,Delse, Dendif, | 422 | { Idrop, Idrop, Fdrop, Fdrop, Fdrop, Dfalse,Dfalse,Dfalse,Delse, Dendif, |
421 | Idrop, Idrop, Fdrop, Fdrop, Fdrop, Dfalse,Dfalse,Dfalse,Delse, Eioccc, | 423 | Idrop, Idrop, Fdrop, Fdrop, Fdrop, Dfalse,Dfalse,Dfalse,Delse, Eioccc, |
422 | drop, Eeof } | 424 | drop, Eeof, abort } |
423 | /*TRUEI FALSEI IF TRUE FALSE ELIF ELTRUE ELFALSE ELSE ENDIF | 425 | /*TRUEI FALSEI IF TRUE FALSE ELIF ELTRUE ELFALSE ELSE ENDIF |
424 | TRUEI FALSEI IF TRUE FALSE ELIF ELTRUE ELFALSE ELSE ENDIF (DODGY) | 426 | TRUEI FALSEI IF TRUE FALSE ELIF ELTRUE ELFALSE ELSE ENDIF (DODGY) |
425 | PLAIN EOF */ | 427 | PLAIN EOF ERROR */ |
426 | }; | 428 | }; |
427 | 429 | ||
428 | /* | 430 | /* |
@@ -463,9 +465,11 @@ keywordedit(const char *replacement) | |||
463 | static void | 465 | static void |
464 | nest(void) | 466 | nest(void) |
465 | { | 467 | { |
466 | depth += 1; | 468 | if (depth > MAXDEPTH-1) |
467 | if (depth >= MAXDEPTH) | 469 | abort(); /* bug */ |
470 | if (depth == MAXDEPTH-1) | ||
468 | error("Too many levels of nesting"); | 471 | error("Too many levels of nesting"); |
472 | depth += 1; | ||
469 | stifline[depth] = linenum; | 473 | stifline[depth] = linenum; |
470 | } | 474 | } |
471 | static void | 475 | static void |
@@ -490,15 +494,23 @@ flushline(bool keep) | |||
490 | if (symlist) | 494 | if (symlist) |
491 | return; | 495 | return; |
492 | if (keep ^ complement) { | 496 | if (keep ^ complement) { |
493 | if (lnnum && delcount > 0) | 497 | bool blankline = tline[strspn(tline, " \t\n")] == '\0'; |
494 | printf("#line %d\n", linenum); | 498 | if (blankline && compblank && blankcount != blankmax) { |
495 | fputs(tline, stdout); | 499 | delcount += 1; |
496 | delcount = 0; | 500 | blankcount += 1; |
501 | } else { | ||
502 | if (lnnum && delcount > 0) | ||
503 | printf("#line %d\n", linenum); | ||
504 | fputs(tline, stdout); | ||
505 | delcount = 0; | ||
506 | blankmax = blankcount = blankline ? blankcount + 1 : 0; | ||
507 | } | ||
497 | } else { | 508 | } else { |
498 | if (lnblank) | 509 | if (lnblank) |
499 | putc('\n', stdout); | 510 | putc('\n', stdout); |
500 | exitstat = 1; | 511 | exitstat = 1; |
501 | delcount += 1; | 512 | delcount += 1; |
513 | blankcount = 0; | ||
502 | } | 514 | } |
503 | } | 515 | } |
504 | 516 | ||
@@ -510,9 +522,12 @@ process(void) | |||
510 | { | 522 | { |
511 | Linetype lineval; | 523 | Linetype lineval; |
512 | 524 | ||
525 | /* When compressing blank lines, act as if the file | ||
526 | is preceded by a large number of blank lines. */ | ||
527 | blankmax = blankcount = 1000; | ||
513 | for (;;) { | 528 | for (;;) { |
514 | linenum++; | 529 | linenum++; |
515 | lineval = get_line(); | 530 | lineval = parseline(); |
516 | trans_table[ifstate[depth]][lineval](); | 531 | trans_table[ifstate[depth]][lineval](); |
517 | debug("process %s -> %s depth %d", | 532 | debug("process %s -> %s depth %d", |
518 | linetype_name[lineval], | 533 | linetype_name[lineval], |
@@ -526,7 +541,7 @@ process(void) | |||
526 | * help from skipcomment(). | 541 | * help from skipcomment(). |
527 | */ | 542 | */ |
528 | static Linetype | 543 | static Linetype |
529 | get_line(void) | 544 | parseline(void) |
530 | { | 545 | { |
531 | const char *cp; | 546 | const char *cp; |
532 | int cursym; | 547 | int cursym; |
@@ -595,9 +610,21 @@ get_line(void) | |||
595 | if (incomment) | 610 | if (incomment) |
596 | linestate = LS_DIRTY; | 611 | linestate = LS_DIRTY; |
597 | } | 612 | } |
598 | /* skipcomment should have changed the state */ | 613 | /* skipcomment normally changes the state, except |
599 | if (linestate == LS_HASH) | 614 | if the last line of the file lacks a newline, or |
600 | abort(); /* bug */ | 615 | if there is too much whitespace in a directive */ |
616 | if (linestate == LS_HASH) { | ||
617 | size_t len = cp - tline; | ||
618 | if (fgets(tline + len, MAXLINE - len, input) == NULL) { | ||
619 | /* append the missing newline */ | ||
620 | tline[len+0] = '\n'; | ||
621 | tline[len+1] = '\0'; | ||
622 | cp++; | ||
623 | linestate = LS_START; | ||
624 | } else { | ||
625 | linestate = LS_DIRTY; | ||
626 | } | ||
627 | } | ||
601 | } | 628 | } |
602 | if (linestate == LS_DIRTY) { | 629 | if (linestate == LS_DIRTY) { |
603 | while (*cp != '\0') | 630 | while (*cp != '\0') |
@@ -610,17 +637,40 @@ get_line(void) | |||
610 | 637 | ||
611 | /* | 638 | /* |
612 | * These are the binary operators that are supported by the expression | 639 | * These are the binary operators that are supported by the expression |
613 | * evaluator. Note that if support for division is added then we also | 640 | * evaluator. |
614 | * need short-circuiting booleans because of divide-by-zero. | ||
615 | */ | 641 | */ |
616 | static int op_lt(int a, int b) { return (a < b); } | 642 | static Linetype op_strict(int *p, int v, Linetype at, Linetype bt) { |
617 | static int op_gt(int a, int b) { return (a > b); } | 643 | if(at == LT_IF || bt == LT_IF) return (LT_IF); |
618 | static int op_le(int a, int b) { return (a <= b); } | 644 | return (*p = v, v ? LT_TRUE : LT_FALSE); |
619 | static int op_ge(int a, int b) { return (a >= b); } | 645 | } |
620 | static int op_eq(int a, int b) { return (a == b); } | 646 | static Linetype op_lt(int *p, Linetype at, int a, Linetype bt, int b) { |
621 | static int op_ne(int a, int b) { return (a != b); } | 647 | return op_strict(p, a < b, at, bt); |
622 | static int op_or(int a, int b) { return (a || b); } | 648 | } |
623 | static int op_and(int a, int b) { return (a && b); } | 649 | static Linetype op_gt(int *p, Linetype at, int a, Linetype bt, int b) { |
650 | return op_strict(p, a > b, at, bt); | ||
651 | } | ||
652 | static Linetype op_le(int *p, Linetype at, int a, Linetype bt, int b) { | ||
653 | return op_strict(p, a <= b, at, bt); | ||
654 | } | ||
655 | static Linetype op_ge(int *p, Linetype at, int a, Linetype bt, int b) { | ||
656 | return op_strict(p, a >= b, at, bt); | ||
657 | } | ||
658 | static Linetype op_eq(int *p, Linetype at, int a, Linetype bt, int b) { | ||
659 | return op_strict(p, a == b, at, bt); | ||
660 | } | ||
661 | static Linetype op_ne(int *p, Linetype at, int a, Linetype bt, int b) { | ||
662 | return op_strict(p, a != b, at, bt); | ||
663 | } | ||
664 | static Linetype op_or(int *p, Linetype at, int a, Linetype bt, int b) { | ||
665 | if (!strictlogic && (at == LT_TRUE || bt == LT_TRUE)) | ||
666 | return (*p = 1, LT_TRUE); | ||
667 | return op_strict(p, a || b, at, bt); | ||
668 | } | ||
669 | static Linetype op_and(int *p, Linetype at, int a, Linetype bt, int b) { | ||
670 | if (!strictlogic && (at == LT_FALSE || bt == LT_FALSE)) | ||
671 | return (*p = 0, LT_FALSE); | ||
672 | return op_strict(p, a && b, at, bt); | ||
673 | } | ||
624 | 674 | ||
625 | /* | 675 | /* |
626 | * An evaluation function takes three arguments, as follows: (1) a pointer to | 676 | * An evaluation function takes three arguments, as follows: (1) a pointer to |
@@ -629,8 +679,8 @@ static int op_and(int a, int b) { return (a && b); } | |||
629 | * value of the expression; and (3) a pointer to a char* that points to the | 679 | * value of the expression; and (3) a pointer to a char* that points to the |
630 | * expression to be evaluated and that is updated to the end of the expression | 680 | * expression to be evaluated and that is updated to the end of the expression |
631 | * when evaluation is complete. The function returns LT_FALSE if the value of | 681 | * when evaluation is complete. The function returns LT_FALSE if the value of |
632 | * the expression is zero, LT_TRUE if it is non-zero, or LT_IF if the | 682 | * the expression is zero, LT_TRUE if it is non-zero, LT_IF if the expression |
633 | * expression could not be evaluated. | 683 | * depends on an unknown symbol, or LT_ERROR if there is a parse failure. |
634 | */ | 684 | */ |
635 | struct ops; | 685 | struct ops; |
636 | 686 | ||
@@ -649,7 +699,7 @@ static const struct ops { | |||
649 | eval_fn *inner; | 699 | eval_fn *inner; |
650 | struct op { | 700 | struct op { |
651 | const char *str; | 701 | const char *str; |
652 | int (*fn)(int, int); | 702 | Linetype (*fn)(int *, Linetype, int, Linetype, int); |
653 | } op[5]; | 703 | } op[5]; |
654 | } eval_ops[] = { | 704 | } eval_ops[] = { |
655 | { eval_table, { { "||", op_or } } }, | 705 | { eval_table, { { "||", op_or } } }, |
@@ -664,8 +714,8 @@ static const struct ops { | |||
664 | 714 | ||
665 | /* | 715 | /* |
666 | * Function for evaluating the innermost parts of expressions, | 716 | * Function for evaluating the innermost parts of expressions, |
667 | * viz. !expr (expr) defined(symbol) symbol number | 717 | * viz. !expr (expr) number defined(symbol) symbol |
668 | * We reset the keepthis flag when we find a non-constant subexpression. | 718 | * We reset the constexpr flag in the last two cases. |
669 | */ | 719 | */ |
670 | static Linetype | 720 | static Linetype |
671 | eval_unary(const struct ops *ops, int *valp, const char **cpp) | 721 | eval_unary(const struct ops *ops, int *valp, const char **cpp) |
@@ -673,68 +723,83 @@ eval_unary(const struct ops *ops, int *valp, const char **cpp) | |||
673 | const char *cp; | 723 | const char *cp; |
674 | char *ep; | 724 | char *ep; |
675 | int sym; | 725 | int sym; |
726 | bool defparen; | ||
727 | Linetype lt; | ||
676 | 728 | ||
677 | cp = skipcomment(*cpp); | 729 | cp = skipcomment(*cpp); |
678 | if (*cp == '!') { | 730 | if (*cp == '!') { |
679 | debug("eval%d !", ops - eval_ops); | 731 | debug("eval%d !", ops - eval_ops); |
680 | cp++; | 732 | cp++; |
681 | if (eval_unary(ops, valp, &cp) == LT_IF) { | 733 | lt = eval_unary(ops, valp, &cp); |
682 | *cpp = cp; | 734 | if (lt == LT_ERROR) |
683 | return (LT_IF); | 735 | return (LT_ERROR); |
736 | if (lt != LT_IF) { | ||
737 | *valp = !*valp; | ||
738 | lt = *valp ? LT_TRUE : LT_FALSE; | ||
684 | } | 739 | } |
685 | *valp = !*valp; | ||
686 | } else if (*cp == '(') { | 740 | } else if (*cp == '(') { |
687 | cp++; | 741 | cp++; |
688 | debug("eval%d (", ops - eval_ops); | 742 | debug("eval%d (", ops - eval_ops); |
689 | if (eval_table(eval_ops, valp, &cp) == LT_IF) | 743 | lt = eval_table(eval_ops, valp, &cp); |
690 | return (LT_IF); | 744 | if (lt == LT_ERROR) |
745 | return (LT_ERROR); | ||
691 | cp = skipcomment(cp); | 746 | cp = skipcomment(cp); |
692 | if (*cp++ != ')') | 747 | if (*cp++ != ')') |
693 | return (LT_IF); | 748 | return (LT_ERROR); |
694 | } else if (isdigit((unsigned char)*cp)) { | 749 | } else if (isdigit((unsigned char)*cp)) { |
695 | debug("eval%d number", ops - eval_ops); | 750 | debug("eval%d number", ops - eval_ops); |
696 | *valp = strtol(cp, &ep, 0); | 751 | *valp = strtol(cp, &ep, 0); |
752 | if (ep == cp) | ||
753 | return (LT_ERROR); | ||
754 | lt = *valp ? LT_TRUE : LT_FALSE; | ||
697 | cp = skipsym(cp); | 755 | cp = skipsym(cp); |
698 | } else if (strncmp(cp, "defined", 7) == 0 && endsym(cp[7])) { | 756 | } else if (strncmp(cp, "defined", 7) == 0 && endsym(cp[7])) { |
699 | cp = skipcomment(cp+7); | 757 | cp = skipcomment(cp+7); |
700 | debug("eval%d defined", ops - eval_ops); | 758 | debug("eval%d defined", ops - eval_ops); |
701 | if (*cp++ != '(') | 759 | if (*cp == '(') { |
702 | return (LT_IF); | 760 | cp = skipcomment(cp+1); |
703 | cp = skipcomment(cp); | 761 | defparen = true; |
762 | } else { | ||
763 | defparen = false; | ||
764 | } | ||
704 | sym = findsym(cp); | 765 | sym = findsym(cp); |
705 | cp = skipsym(cp); | 766 | if (sym < 0) { |
706 | cp = skipcomment(cp); | 767 | lt = LT_IF; |
707 | if (*cp++ != ')') | 768 | } else { |
708 | return (LT_IF); | ||
709 | if (sym >= 0) | ||
710 | *valp = (value[sym] != NULL); | 769 | *valp = (value[sym] != NULL); |
711 | else { | 770 | lt = *valp ? LT_TRUE : LT_FALSE; |
712 | *cpp = cp; | ||
713 | return (LT_IF); | ||
714 | } | 771 | } |
715 | keepthis = false; | 772 | cp = skipsym(cp); |
773 | cp = skipcomment(cp); | ||
774 | if (defparen && *cp++ != ')') | ||
775 | return (LT_ERROR); | ||
776 | constexpr = false; | ||
716 | } else if (!endsym(*cp)) { | 777 | } else if (!endsym(*cp)) { |
717 | debug("eval%d symbol", ops - eval_ops); | 778 | debug("eval%d symbol", ops - eval_ops); |
718 | sym = findsym(cp); | 779 | sym = findsym(cp); |
719 | if (sym < 0) | 780 | cp = skipsym(cp); |
720 | return (LT_IF); | 781 | if (sym < 0) { |
721 | if (value[sym] == NULL) | 782 | lt = LT_IF; |
783 | cp = skipargs(cp); | ||
784 | } else if (value[sym] == NULL) { | ||
722 | *valp = 0; | 785 | *valp = 0; |
723 | else { | 786 | lt = LT_FALSE; |
787 | } else { | ||
724 | *valp = strtol(value[sym], &ep, 0); | 788 | *valp = strtol(value[sym], &ep, 0); |
725 | if (*ep != '\0' || ep == value[sym]) | 789 | if (*ep != '\0' || ep == value[sym]) |
726 | return (LT_IF); | 790 | return (LT_ERROR); |
791 | lt = *valp ? LT_TRUE : LT_FALSE; | ||
792 | cp = skipargs(cp); | ||
727 | } | 793 | } |
728 | cp = skipsym(cp); | 794 | constexpr = false; |
729 | keepthis = false; | ||
730 | } else { | 795 | } else { |
731 | debug("eval%d bad expr", ops - eval_ops); | 796 | debug("eval%d bad expr", ops - eval_ops); |
732 | return (LT_IF); | 797 | return (LT_ERROR); |
733 | } | 798 | } |
734 | 799 | ||
735 | *cpp = cp; | 800 | *cpp = cp; |
736 | debug("eval%d = %d", ops - eval_ops, *valp); | 801 | debug("eval%d = %d", ops - eval_ops, *valp); |
737 | return (*valp ? LT_TRUE : LT_FALSE); | 802 | return (lt); |
738 | } | 803 | } |
739 | 804 | ||
740 | /* | 805 | /* |
@@ -746,11 +811,13 @@ eval_table(const struct ops *ops, int *valp, const char **cpp) | |||
746 | const struct op *op; | 811 | const struct op *op; |
747 | const char *cp; | 812 | const char *cp; |
748 | int val; | 813 | int val; |
749 | Linetype lhs, rhs; | 814 | Linetype lt, rt; |
750 | 815 | ||
751 | debug("eval%d", ops - eval_ops); | 816 | debug("eval%d", ops - eval_ops); |
752 | cp = *cpp; | 817 | cp = *cpp; |
753 | lhs = ops->inner(ops+1, valp, &cp); | 818 | lt = ops->inner(ops+1, valp, &cp); |
819 | if (lt == LT_ERROR) | ||
820 | return (LT_ERROR); | ||
754 | for (;;) { | 821 | for (;;) { |
755 | cp = skipcomment(cp); | 822 | cp = skipcomment(cp); |
756 | for (op = ops->op; op->str != NULL; op++) | 823 | for (op = ops->op; op->str != NULL; op++) |
@@ -760,32 +827,16 @@ eval_table(const struct ops *ops, int *valp, const char **cpp) | |||
760 | break; | 827 | break; |
761 | cp += strlen(op->str); | 828 | cp += strlen(op->str); |
762 | debug("eval%d %s", ops - eval_ops, op->str); | 829 | debug("eval%d %s", ops - eval_ops, op->str); |
763 | rhs = ops->inner(ops+1, &val, &cp); | 830 | rt = ops->inner(ops+1, &val, &cp); |
764 | if (op->fn == op_and && (lhs == LT_FALSE || rhs == LT_FALSE)) { | 831 | if (rt == LT_ERROR) |
765 | debug("eval%d: and always false", ops - eval_ops); | 832 | return (LT_ERROR); |
766 | if (lhs == LT_IF) | 833 | lt = op->fn(valp, lt, *valp, rt, val); |
767 | *valp = val; | ||
768 | lhs = LT_FALSE; | ||
769 | continue; | ||
770 | } | ||
771 | if (op->fn == op_or && (lhs == LT_TRUE || rhs == LT_TRUE)) { | ||
772 | debug("eval%d: or always true", ops - eval_ops); | ||
773 | if (lhs == LT_IF) | ||
774 | *valp = val; | ||
775 | lhs = LT_TRUE; | ||
776 | continue; | ||
777 | } | ||
778 | if (rhs == LT_IF) | ||
779 | lhs = LT_IF; | ||
780 | if (lhs != LT_IF) | ||
781 | *valp = op->fn(*valp, val); | ||
782 | } | 834 | } |
783 | 835 | ||
784 | *cpp = cp; | 836 | *cpp = cp; |
785 | debug("eval%d = %d", ops - eval_ops, *valp); | 837 | debug("eval%d = %d", ops - eval_ops, *valp); |
786 | if (lhs != LT_IF) | 838 | debug("eval%d lt = %s", ops - eval_ops, linetype_name[lt]); |
787 | lhs = (*valp ? LT_TRUE : LT_FALSE); | 839 | return (lt); |
788 | return lhs; | ||
789 | } | 840 | } |
790 | 841 | ||
791 | /* | 842 | /* |
@@ -796,17 +847,14 @@ eval_table(const struct ops *ops, int *valp, const char **cpp) | |||
796 | static Linetype | 847 | static Linetype |
797 | ifeval(const char **cpp) | 848 | ifeval(const char **cpp) |
798 | { | 849 | { |
799 | const char *cp = *cpp; | ||
800 | int ret; | 850 | int ret; |
801 | int val; | 851 | int val = 0; |
802 | 852 | ||
803 | debug("eval %s", *cpp); | 853 | debug("eval %s", *cpp); |
804 | keepthis = killconsts ? false : true; | 854 | constexpr = killconsts ? false : true; |
805 | ret = eval_table(eval_ops, &val, &cp); | 855 | ret = eval_table(eval_ops, &val, cpp); |
806 | if (ret != LT_IF) | ||
807 | *cpp = cp; | ||
808 | debug("eval = %d", val); | 856 | debug("eval = %d", val); |
809 | return (keepthis ? LT_IF : ret); | 857 | return (constexpr ? LT_IF : ret == LT_ERROR ? LT_IF : ret); |
810 | } | 858 | } |
811 | 859 | ||
812 | /* | 860 | /* |
@@ -918,6 +966,31 @@ skipcomment(const char *cp) | |||
918 | } | 966 | } |
919 | 967 | ||
920 | /* | 968 | /* |
969 | * Skip macro arguments. | ||
970 | */ | ||
971 | static const char * | ||
972 | skipargs(const char *cp) | ||
973 | { | ||
974 | const char *ocp = cp; | ||
975 | int level = 0; | ||
976 | cp = skipcomment(cp); | ||
977 | if (*cp != '(') | ||
978 | return (cp); | ||
979 | do { | ||
980 | if (*cp == '(') | ||
981 | level++; | ||
982 | if (*cp == ')') | ||
983 | level--; | ||
984 | cp = skipcomment(cp+1); | ||
985 | } while (level != 0 && *cp != '\0'); | ||
986 | if (level == 0) | ||
987 | return (cp); | ||
988 | else | ||
989 | /* Rewind and re-detect the syntax error later. */ | ||
990 | return (ocp); | ||
991 | } | ||
992 | |||
993 | /* | ||
921 | * Skip over an identifier. | 994 | * Skip over an identifier. |
922 | */ | 995 | */ |
923 | static const char * | 996 | static const char * |
@@ -929,7 +1002,7 @@ skipsym(const char *cp) | |||
929 | } | 1002 | } |
930 | 1003 | ||
931 | /* | 1004 | /* |
932 | * Look for the symbol in the symbol table. If is is found, we return | 1005 | * Look for the symbol in the symbol table. If it is found, we return |
933 | * the symbol table index, else we return -1. | 1006 | * the symbol table index, else we return -1. |
934 | */ | 1007 | */ |
935 | static int | 1008 | static int |
diff --git a/usr/gen_init_cpio.c b/usr/gen_init_cpio.c index 83b3dde1a83b..b2b3c2d1cf8b 100644 --- a/usr/gen_init_cpio.c +++ b/usr/gen_init_cpio.c | |||
@@ -354,7 +354,10 @@ static int cpio_mkfile(const char *name, const char *location, | |||
354 | push_pad(); | 354 | push_pad(); |
355 | 355 | ||
356 | if (size) { | 356 | if (size) { |
357 | fwrite(filebuf, size, 1, stdout); | 357 | if (fwrite(filebuf, size, 1, stdout) != 1) { |
358 | fprintf(stderr, "writing filebuf failed\n"); | ||
359 | goto error; | ||
360 | } | ||
358 | offset += size; | 361 | offset += size; |
359 | push_pad(); | 362 | push_pad(); |
360 | } | 363 | } |