aboutsummaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorOlof Johansson <olof@lixom.net>2013-04-18 09:19:26 -0700
committerOlof Johansson <olof@lixom.net>2013-04-18 09:21:20 -0700
commitda0851fe3a8ebc416ab61ce50ef2fb3c3d7375c9 (patch)
tree833778d45f2327702f8abc89d236e71ab3b0e291 /scripts
parent7fa7ed8e1c93dda575021f177a3f6957dc98b28f (diff)
parent4b23185ff5e1c2ada2845002a034e8840ab98b63 (diff)
Merge tag 'imx-dt-3.10' of git://git.linaro.org/people/shawnguo/linux-2.6 into next/dt
From Shawn Guo: The imx device tree changes for 3.10: * The huge diff stat is introduced by the pinctrl changes. With DTC macro support ready, we're moving those huge mount of data about pins out of pinctrl driver. * Device tree source updates for GPI, LDB, SRC, cpufreq-cpu0. * Initial imx6dl device tree support * Board level DTS changes for some imx27 and imx51 platforms. * tag 'imx-dt-3.10' of git://git.linaro.org/people/shawnguo/linux-2.6: (605 commits) ARM: dts: imx6dl-wandboard: Add USB Host support ARM: dts: imx51 cpu node ARM: dts: Add missing imx27-phytec-phycore dtb target ARM: dts: Add NFC support for i.MX27 Phytec PCM038 module ARM: i.MX51: Add PATA support ARM: dts: Add initial support for Wandboard Dual-Lite ARM: dts: imx: add initial imx6dl-sabreauto support ARM: dts: imx: add initial imx6dl-sabresd support ARM: dts: imx: make sabreauto and sabresd common pinctrl: add pinctrl driver for imx6sl pinctrl: add pinctrl driver for imx6dl ARM: dts: imx53: fix SD2_DATA1 pad AUDMUX_AUD4 configuration ARM: dts: MicroSys sbc6x support (i.MX6) ARM i.MX5: Add System Reset Controller (SRC) support for i.MX51 and i.MX53 ARM i.MX5: Add system reset controller (SRC) to i.MX51 and i.MX53 device tree ARM i.MX6q: Link system reset controller (SRC) to IPU in DT ARM i.MX6q: Add LDB device to device tree ARM: imx5 DT init cpufreq-cpu0 device ARM: imx27 DT init cpufreq-cpu0 device ARM i.MX53: Add LDB device to device tree ... Signed-off-by: Olof Johansson <olof@lixom.net>
Diffstat (limited to 'scripts')
-rw-r--r--scripts/Makefile.lib17
-rw-r--r--scripts/basic/fixdep.c93
2 files changed, 68 insertions, 42 deletions
diff --git a/scripts/Makefile.lib b/scripts/Makefile.lib
index 07125e697d7..3e73dfd838c 100644
--- a/scripts/Makefile.lib
+++ b/scripts/Makefile.lib
@@ -156,9 +156,9 @@ cpp_flags = -Wp,-MD,$(depfile) $(NOSTDINC_FLAGS) $(LINUXINCLUDE) \
ld_flags = $(LDFLAGS) $(ldflags-y)
-dtc_cpp_flags = -Wp,-MD,$(depfile) -nostdinc \
+dtc_cpp_flags = -Wp,-MD,$(depfile).pre -nostdinc \
-I$(srctree)/arch/$(SRCARCH)/boot/dts \
- -I$(srctree)/arch/$(SRCARCH)/include/dts \
+ -I$(srctree)/arch/$(SRCARCH)/boot/dts/include \
-undef -D__DTS__
# Finds the multi-part object the current object will be linked into
@@ -269,20 +269,17 @@ $(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) -d $(depfile) $<
+cmd_dtc = $(CPP) $(dtc_cpp_flags) -x assembler-with-cpp -o $(dtc-tmp) $< ; \
+ $(objtree)/scripts/dtc/dtc -O dtb -o $@ -b 0 \
+ -i $(srctree)/arch/$(SRCARCH)/boot/dts $(DTC_FLAGS) \
+ -d $(depfile).dtc $(dtc-tmp) ; \
+ cat $(depfile).pre $(depfile).dtc > $(depfile)
$(obj)/%.dtb: $(src)/%.dts FORCE
$(call if_changed_dep,dtc)
dtc-tmp = $(subst $(comma),_,$(dot-target).dts)
-quiet_cmd_dtc_cpp = DTC+CPP $@
-cmd_dtc_cpp = $(CPP) $(dtc_cpp_flags) -x assembler-with-cpp -o $(dtc-tmp) $< ; \
- $(objtree)/scripts/dtc/dtc -O dtb -o $@ -b 0 $(DTC_FLAGS) $(dtc-tmp)
-
-$(obj)/%.dtb: $(src)/%.dtsp FORCE
- $(call if_changed_dep,dtc_cpp)
-
# Bzip2
# ---------------------------------------------------------------------------
diff --git a/scripts/basic/fixdep.c b/scripts/basic/fixdep.c
index 7f6425e24ce..078fe1d64e7 100644
--- a/scripts/basic/fixdep.c
+++ b/scripts/basic/fixdep.c
@@ -320,49 +320,78 @@ static void parse_dep_file(void *map, size_t len)
char *end = m + len;
char *p;
char s[PATH_MAX];
- int first;
-
- p = strchr(m, ':');
- if (!p) {
- fprintf(stderr, "fixdep: parse error\n");
- exit(1);
- }
- memcpy(s, m, p-m); s[p-m] = 0;
- m = p+1;
+ int is_target;
+ int saw_any_target = 0;
+ int is_first_dep = 0;
clear_config();
- first = 1;
while (m < end) {
+ /* Skip any "white space" */
while (m < end && (*m == ' ' || *m == '\\' || *m == '\n'))
m++;
+ /* Find next "white space" */
p = m;
- while (p < end && *p != ' ') p++;
- if (p == end) {
- do p--; while (!isalnum(*p));
+ while (p < end && *p != ' ' && *p != '\\' && *p != '\n')
p++;
+ /* Is the token we found a target name? */
+ is_target = (*(p-1) == ':');
+ /* Don't write any target names into the dependency file */
+ if (is_target) {
+ /* The /next/ file is the first dependency */
+ is_first_dep = 1;
+ } else {
+ /* Save this token/filename */
+ memcpy(s, m, p-m);
+ s[p - m] = 0;
+
+ /* Ignore certain dependencies */
+ if (strrcmp(s, "include/generated/autoconf.h") &&
+ strrcmp(s, "arch/um/include/uml-config.h") &&
+ strrcmp(s, "include/linux/kconfig.h") &&
+ strrcmp(s, ".ver")) {
+ /*
+ * Do not list the source file as dependency,
+ * so that kbuild is not confused if a .c file
+ * is rewritten into .S or vice versa. Storing
+ * it in source_* is needed for modpost to
+ * compute srcversions.
+ */
+ if (is_first_dep) {
+ /*
+ * If processing the concatenation of
+ * multiple dependency files, only
+ * process the first target name, which
+ * will be the original source name,
+ * and ignore any other target names,
+ * which will be intermediate temporary
+ * files.
+ */
+ if (!saw_any_target) {
+ saw_any_target = 1;
+ printf("source_%s := %s\n\n",
+ target, s);
+ printf("deps_%s := \\\n",
+ target);
+ }
+ is_first_dep = 0;
+ } else
+ printf(" %s \\\n", s);
+ do_config_file(s);
+ }
}
- memcpy(s, m, p-m); s[p-m] = 0;
- if (strrcmp(s, "include/generated/autoconf.h") &&
- strrcmp(s, "arch/um/include/uml-config.h") &&
- strrcmp(s, "include/linux/kconfig.h") &&
- strrcmp(s, ".ver")) {
- /*
- * Do not list the source file as dependency, so that
- * kbuild is not confused if a .c file is rewritten
- * into .S or vice versa. Storing it in source_* is
- * needed for modpost to compute srcversions.
- */
- if (first) {
- printf("source_%s := %s\n\n", target, s);
- printf("deps_%s := \\\n", target);
- } else
- printf(" %s \\\n", s);
- do_config_file(s);
- }
- first = 0;
+ /*
+ * Start searching for next token immediately after the first
+ * "whitespace" character that follows this token.
+ */
m = p + 1;
}
+
+ if (!saw_any_target) {
+ fprintf(stderr, "fixdep: parse error; no targets found\n");
+ exit(1);
+ }
+
printf("\n%s: $(deps_%s)\n\n", target, target);
printf("$(deps_%s):\n", target);
}