diff options
-rw-r--r-- | Makefile | 2 | ||||
-rw-r--r-- | arch/arm/boot/Makefile | 6 | ||||
-rw-r--r-- | arch/microblaze/boot/Makefile | 2 | ||||
-rw-r--r-- | arch/openrisc/boot/Makefile | 4 | ||||
-rw-r--r-- | arch/powerpc/boot/Makefile | 4 | ||||
-rw-r--r-- | scripts/Makefile.lib | 8 | ||||
-rw-r--r-- | scripts/dtc/dtc.c | 21 | ||||
-rw-r--r-- | scripts/dtc/srcpos.c | 4 | ||||
-rw-r--r-- | scripts/dtc/srcpos.h | 1 | ||||
-rw-r--r-- | scripts/genksyms/Makefile | 1 |
10 files changed, 40 insertions, 13 deletions
@@ -312,7 +312,7 @@ endif | |||
312 | # If the user is running make -s (silent mode), suppress echoing of | 312 | # If the user is running make -s (silent mode), suppress echoing of |
313 | # commands | 313 | # commands |
314 | 314 | ||
315 | ifneq ($(findstring s,$(MAKEFLAGS)),) | 315 | ifneq ($(filter s% -s%,$(MAKEFLAGS)),) |
316 | quiet=silent_ | 316 | quiet=silent_ |
317 | endif | 317 | endif |
318 | 318 | ||
diff --git a/arch/arm/boot/Makefile b/arch/arm/boot/Makefile index 5df26a9976a..fc871e719aa 100644 --- a/arch/arm/boot/Makefile +++ b/arch/arm/boot/Makefile | |||
@@ -59,9 +59,11 @@ $(obj)/zImage: $(obj)/compressed/vmlinux FORCE | |||
59 | 59 | ||
60 | endif | 60 | endif |
61 | 61 | ||
62 | targets += $(dtb-y) | ||
63 | |||
62 | # Rule to build device tree blobs | 64 | # Rule to build device tree blobs |
63 | $(obj)/%.dtb: $(src)/dts/%.dts | 65 | $(obj)/%.dtb: $(src)/dts/%.dts FORCE |
64 | $(call cmd,dtc) | 66 | $(call if_changed_dep,dtc) |
65 | 67 | ||
66 | $(obj)/dtbs: $(addprefix $(obj)/, $(dtb-y)) | 68 | $(obj)/dtbs: $(addprefix $(obj)/, $(dtb-y)) |
67 | 69 | ||
diff --git a/arch/microblaze/boot/Makefile b/arch/microblaze/boot/Makefile index 4c4e58ef0cb..0c796cf8158 100644 --- a/arch/microblaze/boot/Makefile +++ b/arch/microblaze/boot/Makefile | |||
@@ -53,6 +53,6 @@ $(obj)/simpleImage.%: vmlinux FORCE | |||
53 | DTC_FLAGS := -p 1024 | 53 | DTC_FLAGS := -p 1024 |
54 | 54 | ||
55 | $(obj)/%.dtb: $(src)/dts/%.dts FORCE | 55 | $(obj)/%.dtb: $(src)/dts/%.dts FORCE |
56 | $(call cmd,dtc) | 56 | $(call if_changed_dep,dtc) |
57 | 57 | ||
58 | clean-files += *.dtb simpleImage.*.unstrip linux.bin.ub | 58 | clean-files += *.dtb simpleImage.*.unstrip linux.bin.ub |
diff --git a/arch/openrisc/boot/Makefile b/arch/openrisc/boot/Makefile index 98ca185097a..09958358601 100644 --- a/arch/openrisc/boot/Makefile +++ b/arch/openrisc/boot/Makefile | |||
@@ -11,5 +11,5 @@ clean-files := *.dtb.S | |||
11 | 11 | ||
12 | #DTC_FLAGS ?= -p 1024 | 12 | #DTC_FLAGS ?= -p 1024 |
13 | 13 | ||
14 | $(obj)/%.dtb: $(src)/dts/%.dts | 14 | $(obj)/%.dtb: $(src)/dts/%.dts FORCE |
15 | $(call cmd,dtc) | 15 | $(call if_changed_dep,dtc) |
diff --git a/arch/powerpc/boot/Makefile b/arch/powerpc/boot/Makefile index 15986e70799..8844a17ce8e 100644 --- a/arch/powerpc/boot/Makefile +++ b/arch/powerpc/boot/Makefile | |||
@@ -345,8 +345,8 @@ $(obj)/treeImage.%: vmlinux $(obj)/%.dtb $(wrapperbits) | |||
345 | $(call if_changed,wrap,treeboot-$*,,$(obj)/$*.dtb) | 345 | $(call if_changed,wrap,treeboot-$*,,$(obj)/$*.dtb) |
346 | 346 | ||
347 | # Rule to build device tree blobs | 347 | # Rule to build device tree blobs |
348 | $(obj)/%.dtb: $(src)/dts/%.dts | 348 | $(obj)/%.dtb: $(src)/dts/%.dts FORCE |
349 | $(call cmd,dtc) | 349 | $(call if_changed_dep,dtc) |
350 | 350 | ||
351 | # If there isn't a platform selected then just strip the vmlinux. | 351 | # If there isn't a platform selected then just strip the vmlinux. |
352 | ifeq (,$(image-y)) | 352 | ifeq (,$(image-y)) |
diff --git a/scripts/Makefile.lib b/scripts/Makefile.lib index 5d986d9adf1..00c368c6e99 100644 --- a/scripts/Makefile.lib +++ b/scripts/Makefile.lib | |||
@@ -93,9 +93,9 @@ obj-dirs := $(addprefix $(obj)/,$(obj-dirs)) | |||
93 | # already | 93 | # already |
94 | # $(modname_flags) #defines KBUILD_MODNAME as the name of the module it will | 94 | # $(modname_flags) #defines KBUILD_MODNAME as the name of the module it will |
95 | # end up in (or would, if it gets compiled in) | 95 | # end up in (or would, if it gets compiled in) |
96 | # Note: It's possible that one object gets potentially linked into more | 96 | # Note: Files that end up in two or more modules are compiled without the |
97 | # than one module. In that case KBUILD_MODNAME will be set to foo_bar, | 97 | # KBUILD_MODNAME definition. The reason is that any made-up name would |
98 | # where foo and bar are the name of the modules. | 98 | # differ in different configs. |
99 | name-fix = $(subst $(comma),_,$(subst -,_,$1)) | 99 | name-fix = $(subst $(comma),_,$(subst -,_,$1)) |
100 | basename_flags = -D"KBUILD_BASENAME=KBUILD_STR($(call name-fix,$(basetarget)))" | 100 | basename_flags = -D"KBUILD_BASENAME=KBUILD_STR($(call name-fix,$(basetarget)))" |
101 | modname_flags = $(if $(filter 1,$(words $(modname))),\ | 101 | modname_flags = $(if $(filter 1,$(words $(modname))),\ |
@@ -264,7 +264,7 @@ $(obj)/%.dtb.S: $(obj)/%.dtb | |||
264 | $(call cmd,dt_S_dtb) | 264 | $(call cmd,dt_S_dtb) |
265 | 265 | ||
266 | quiet_cmd_dtc = DTC $@ | 266 | quiet_cmd_dtc = DTC $@ |
267 | cmd_dtc = $(objtree)/scripts/dtc/dtc -O dtb -o $@ -b 0 $(DTC_FLAGS) $< | 267 | cmd_dtc = $(objtree)/scripts/dtc/dtc -O dtb -o $@ -b 0 $(DTC_FLAGS) -d $(depfile) $< |
268 | 268 | ||
269 | # Bzip2 | 269 | # Bzip2 |
270 | # --------------------------------------------------------------------------- | 270 | # --------------------------------------------------------------------------- |
diff --git a/scripts/dtc/dtc.c b/scripts/dtc/dtc.c index cbc0193098e..451c92d31b1 100644 --- a/scripts/dtc/dtc.c +++ b/scripts/dtc/dtc.c | |||
@@ -71,6 +71,7 @@ static void __attribute__ ((noreturn)) usage(void) | |||
71 | fprintf(stderr, "\t\t\tasm - assembler source\n"); | 71 | fprintf(stderr, "\t\t\tasm - assembler source\n"); |
72 | fprintf(stderr, "\t-V <output version>\n"); | 72 | fprintf(stderr, "\t-V <output version>\n"); |
73 | fprintf(stderr, "\t\tBlob version to produce, defaults to %d (relevant for dtb\n\t\tand asm output only)\n", DEFAULT_FDT_VERSION); | 73 | fprintf(stderr, "\t\tBlob version to produce, defaults to %d (relevant for dtb\n\t\tand asm output only)\n", DEFAULT_FDT_VERSION); |
74 | fprintf(stderr, "\t-d <output dependency file>\n"); | ||
74 | fprintf(stderr, "\t-R <number>\n"); | 75 | fprintf(stderr, "\t-R <number>\n"); |
75 | fprintf(stderr, "\t\tMake space for <number> reserve map entries (relevant for \n\t\tdtb and asm output only)\n"); | 76 | fprintf(stderr, "\t\tMake space for <number> reserve map entries (relevant for \n\t\tdtb and asm output only)\n"); |
76 | fprintf(stderr, "\t-S <bytes>\n"); | 77 | fprintf(stderr, "\t-S <bytes>\n"); |
@@ -99,6 +100,7 @@ int main(int argc, char *argv[]) | |||
99 | const char *inform = "dts"; | 100 | const char *inform = "dts"; |
100 | const char *outform = "dts"; | 101 | const char *outform = "dts"; |
101 | const char *outname = "-"; | 102 | const char *outname = "-"; |
103 | const char *depname = NULL; | ||
102 | int force = 0, check = 0, sort = 0; | 104 | int force = 0, check = 0, sort = 0; |
103 | const char *arg; | 105 | const char *arg; |
104 | int opt; | 106 | int opt; |
@@ -111,7 +113,8 @@ int main(int argc, char *argv[]) | |||
111 | minsize = 0; | 113 | minsize = 0; |
112 | padsize = 0; | 114 | padsize = 0; |
113 | 115 | ||
114 | while ((opt = getopt(argc, argv, "hI:O:o:V:R:S:p:fcqb:vH:s")) != EOF) { | 116 | while ((opt = getopt(argc, argv, "hI:O:o:V:d:R:S:p:fcqb:vH:s")) |
117 | != EOF) { | ||
115 | switch (opt) { | 118 | switch (opt) { |
116 | case 'I': | 119 | case 'I': |
117 | inform = optarg; | 120 | inform = optarg; |
@@ -125,6 +128,9 @@ int main(int argc, char *argv[]) | |||
125 | case 'V': | 128 | case 'V': |
126 | outversion = strtol(optarg, NULL, 0); | 129 | outversion = strtol(optarg, NULL, 0); |
127 | break; | 130 | break; |
131 | case 'd': | ||
132 | depname = optarg; | ||
133 | break; | ||
128 | case 'R': | 134 | case 'R': |
129 | reservenum = strtol(optarg, NULL, 0); | 135 | reservenum = strtol(optarg, NULL, 0); |
130 | break; | 136 | break; |
@@ -188,6 +194,14 @@ int main(int argc, char *argv[]) | |||
188 | fprintf(stderr, "DTC: %s->%s on file \"%s\"\n", | 194 | fprintf(stderr, "DTC: %s->%s on file \"%s\"\n", |
189 | inform, outform, arg); | 195 | inform, outform, arg); |
190 | 196 | ||
197 | if (depname) { | ||
198 | depfile = fopen(depname, "w"); | ||
199 | if (!depfile) | ||
200 | die("Couldn't open dependency file %s: %s\n", depname, | ||
201 | strerror(errno)); | ||
202 | fprintf(depfile, "%s:", outname); | ||
203 | } | ||
204 | |||
191 | if (streq(inform, "dts")) | 205 | if (streq(inform, "dts")) |
192 | bi = dt_from_source(arg); | 206 | bi = dt_from_source(arg); |
193 | else if (streq(inform, "fs")) | 207 | else if (streq(inform, "fs")) |
@@ -197,6 +211,11 @@ int main(int argc, char *argv[]) | |||
197 | else | 211 | else |
198 | die("Unknown input format \"%s\"\n", inform); | 212 | die("Unknown input format \"%s\"\n", inform); |
199 | 213 | ||
214 | if (depfile) { | ||
215 | fputc('\n', depfile); | ||
216 | fclose(depfile); | ||
217 | } | ||
218 | |||
200 | if (cmdline_boot_cpuid != -1) | 219 | if (cmdline_boot_cpuid != -1) |
201 | bi->boot_cpuid_phys = cmdline_boot_cpuid; | 220 | bi->boot_cpuid_phys = cmdline_boot_cpuid; |
202 | 221 | ||
diff --git a/scripts/dtc/srcpos.c b/scripts/dtc/srcpos.c index 2dbc874288c..36a38e9f1a2 100644 --- a/scripts/dtc/srcpos.c +++ b/scripts/dtc/srcpos.c | |||
@@ -40,6 +40,7 @@ static char *dirname(const char *path) | |||
40 | return NULL; | 40 | return NULL; |
41 | } | 41 | } |
42 | 42 | ||
43 | FILE *depfile; /* = NULL */ | ||
43 | struct srcfile_state *current_srcfile; /* = NULL */ | 44 | struct srcfile_state *current_srcfile; /* = NULL */ |
44 | 45 | ||
45 | /* Detect infinite include recursion. */ | 46 | /* Detect infinite include recursion. */ |
@@ -67,6 +68,9 @@ FILE *srcfile_relative_open(const char *fname, char **fullnamep) | |||
67 | strerror(errno)); | 68 | strerror(errno)); |
68 | } | 69 | } |
69 | 70 | ||
71 | if (depfile) | ||
72 | fprintf(depfile, " %s", fullname); | ||
73 | |||
70 | if (fullnamep) | 74 | if (fullnamep) |
71 | *fullnamep = fullname; | 75 | *fullnamep = fullname; |
72 | else | 76 | else |
diff --git a/scripts/dtc/srcpos.h b/scripts/dtc/srcpos.h index bd7966e56a5..ce980cafe58 100644 --- a/scripts/dtc/srcpos.h +++ b/scripts/dtc/srcpos.h | |||
@@ -30,6 +30,7 @@ struct srcfile_state { | |||
30 | struct srcfile_state *prev; | 30 | struct srcfile_state *prev; |
31 | }; | 31 | }; |
32 | 32 | ||
33 | extern FILE *depfile; /* = NULL */ | ||
33 | extern struct srcfile_state *current_srcfile; /* = NULL */ | 34 | extern struct srcfile_state *current_srcfile; /* = NULL */ |
34 | 35 | ||
35 | FILE *srcfile_relative_open(const char *fname, char **fullnamep); | 36 | FILE *srcfile_relative_open(const char *fname, char **fullnamep); |
diff --git a/scripts/genksyms/Makefile b/scripts/genksyms/Makefile index a5510903e87..aca33b98bf6 100644 --- a/scripts/genksyms/Makefile +++ b/scripts/genksyms/Makefile | |||
@@ -11,3 +11,4 @@ HOSTCFLAGS_lex.lex.o := -I$(src) | |||
11 | # dependencies on generated files need to be listed explicitly | 11 | # dependencies on generated files need to be listed explicitly |
12 | $(obj)/lex.lex.o: $(obj)/keywords.hash.c $(obj)/parse.tab.h | 12 | $(obj)/lex.lex.o: $(obj)/keywords.hash.c $(obj)/parse.tab.h |
13 | 13 | ||
14 | clean-files := keywords.hash.c lex.lex.c parse.tab.c parse.tab.h | ||