From 603d8c0adb0f7576f92fc435c69be9406dc60762 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fernando=20Luis=20V=C3=A1zquez=20Cao?= Date: Mon, 12 Dec 2011 12:17:21 +0900 Subject: scripts/genksyms: clean lex/yacc generated files Add "keywords.hash.c", "lex.lex.c", "parse.tab.c" and "parse.tab.h" to clean-list so that they get automagically deleted at clean/mrproper time. Signed-off-by: Fernando Luis Vazquez Cao Signed-off-by: Michal Marek --- scripts/genksyms/Makefile | 1 + 1 file changed, 1 insertion(+) (limited to 'scripts') 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) # dependencies on generated files need to be listed explicitly $(obj)/lex.lex.o: $(obj)/keywords.hash.c $(obj)/parse.tab.h +clean-files := keywords.hash.c lex.lex.c parse.tab.c parse.tab.h -- cgit v1.2.3 From 5bb0571bfddcdcd3fbf42a58fcce4d0b743fe62f Mon Sep 17 00:00:00 2001 From: Michal Marek Date: Sun, 8 Jan 2012 21:54:43 +0100 Subject: kbuild: Fix comment in Makefile.lib KBUILD_MODNAME is not defined for files that are linked into multiple modules, and trying to change reality to match documentation would result in all sorts of trouble. E.g. options for built-in modules would be called either foo_bar.param, foo.param, or bar.param, depending on the configuration. So just change the comment. Signed-off-by: Michal Marek --- scripts/Makefile.lib | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'scripts') diff --git a/scripts/Makefile.lib b/scripts/Makefile.lib index 5d986d9adf1..2ce2e2194f2 100644 --- a/scripts/Makefile.lib +++ b/scripts/Makefile.lib @@ -93,9 +93,9 @@ obj-dirs := $(addprefix $(obj)/,$(obj-dirs)) # already # $(modname_flags) #defines KBUILD_MODNAME as the name of the module it will # end up in (or would, if it gets compiled in) -# Note: It's possible that one object gets potentially linked into more -# than one module. In that case KBUILD_MODNAME will be set to foo_bar, -# where foo and bar are the name of the modules. +# Note: Files that end up in two or more modules are compiled without the +# KBUILD_MODNAME definition. The reason is that any made-up name would +# differ in different configs. name-fix = $(subst $(comma),_,$(subst -,_,$1)) basename_flags = -D"KBUILD_BASENAME=KBUILD_STR($(call name-fix,$(basetarget)))" modname_flags = $(if $(filter 1,$(words $(modname))),\ -- cgit v1.2.3 From 136ec2049fea65aed0446d04ab7cfff2ae3070f1 Mon Sep 17 00:00:00 2001 From: Stephen Warren Date: Tue, 10 Jan 2012 17:27:52 -0700 Subject: dtc: Implement -d option to write out a dependency file This will allow callers to rebuild .dtb files when any of the /include/d .dtsi files are modified, not just the top-level .dts file. Signed-off-by: Stephen Warren Signed-off-by: Michal Marek --- scripts/dtc/dtc.c | 21 ++++++++++++++++++++- scripts/dtc/srcpos.c | 4 ++++ scripts/dtc/srcpos.h | 1 + 3 files changed, 25 insertions(+), 1 deletion(-) (limited to 'scripts') 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) fprintf(stderr, "\t\t\tasm - assembler source\n"); fprintf(stderr, "\t-V \n"); fprintf(stderr, "\t\tBlob version to produce, defaults to %d (relevant for dtb\n\t\tand asm output only)\n", DEFAULT_FDT_VERSION); + fprintf(stderr, "\t-d \n"); fprintf(stderr, "\t-R \n"); fprintf(stderr, "\t\tMake space for reserve map entries (relevant for \n\t\tdtb and asm output only)\n"); fprintf(stderr, "\t-S \n"); @@ -99,6 +100,7 @@ int main(int argc, char *argv[]) const char *inform = "dts"; const char *outform = "dts"; const char *outname = "-"; + const char *depname = NULL; int force = 0, check = 0, sort = 0; const char *arg; int opt; @@ -111,7 +113,8 @@ int main(int argc, char *argv[]) minsize = 0; padsize = 0; - while ((opt = getopt(argc, argv, "hI:O:o:V:R:S:p:fcqb:vH:s")) != EOF) { + while ((opt = getopt(argc, argv, "hI:O:o:V:d:R:S:p:fcqb:vH:s")) + != EOF) { switch (opt) { case 'I': inform = optarg; @@ -125,6 +128,9 @@ int main(int argc, char *argv[]) case 'V': outversion = strtol(optarg, NULL, 0); break; + case 'd': + depname = optarg; + break; case 'R': reservenum = strtol(optarg, NULL, 0); break; @@ -188,6 +194,14 @@ int main(int argc, char *argv[]) fprintf(stderr, "DTC: %s->%s on file \"%s\"\n", inform, outform, arg); + if (depname) { + depfile = fopen(depname, "w"); + if (!depfile) + die("Couldn't open dependency file %s: %s\n", depname, + strerror(errno)); + fprintf(depfile, "%s:", outname); + } + if (streq(inform, "dts")) bi = dt_from_source(arg); else if (streq(inform, "fs")) @@ -197,6 +211,11 @@ int main(int argc, char *argv[]) else die("Unknown input format \"%s\"\n", inform); + if (depfile) { + fputc('\n', depfile); + fclose(depfile); + } + if (cmdline_boot_cpuid != -1) bi->boot_cpuid_phys = cmdline_boot_cpuid; 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) return NULL; } +FILE *depfile; /* = NULL */ struct srcfile_state *current_srcfile; /* = NULL */ /* Detect infinite include recursion. */ @@ -67,6 +68,9 @@ FILE *srcfile_relative_open(const char *fname, char **fullnamep) strerror(errno)); } + if (depfile) + fprintf(depfile, " %s", fullname); + if (fullnamep) *fullnamep = fullname; 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 { struct srcfile_state *prev; }; +extern FILE *depfile; /* = NULL */ extern struct srcfile_state *current_srcfile; /* = NULL */ FILE *srcfile_relative_open(const char *fname, char **fullnamep); -- cgit v1.2.3 From 7c43185138cf523b0810ffd2c9e18e2ecb356730 Mon Sep 17 00:00:00 2001 From: Stephen Warren Date: Mon, 9 Jan 2012 11:38:15 -0700 Subject: Kbuild: Use dtc's -d (dependency) option This hooks dtc into Kbuild's dependency system. Thus, for example, "make dtbs" will rebuild tegra-harmony.dtb if only tegra20.dtsi has changed yet tegra-harmony.dts has not. The previous lack of this feature recently caused me to have very confusing "git bisect" results. For ARM, it's obvious what to add to $(targets). I'm not familiar enough with other architectures to know what to add there. Powerpc appears to already add various .dtb files into $(targets), but the other archs may need something added to $(targets) to work. Signed-off-by: Stephen Warren Acked-by: Shawn Guo [mmarek: Dropped arch/c6x part to avoid merging commits from the middle of the merge window] Signed-off-by: Michal Marek --- scripts/Makefile.lib | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'scripts') diff --git a/scripts/Makefile.lib b/scripts/Makefile.lib index 2ce2e2194f2..00c368c6e99 100644 --- a/scripts/Makefile.lib +++ b/scripts/Makefile.lib @@ -264,7 +264,7 @@ $(obj)/%.dtb.S: $(obj)/%.dtb $(call cmd,dt_S_dtb) quiet_cmd_dtc = DTC $@ -cmd_dtc = $(objtree)/scripts/dtc/dtc -O dtb -o $@ -b 0 $(DTC_FLAGS) $< +cmd_dtc = $(objtree)/scripts/dtc/dtc -O dtb -o $@ -b 0 $(DTC_FLAGS) -d $(depfile) $< # Bzip2 # --------------------------------------------------------------------------- -- cgit v1.2.3