]> git.neil.brown.name Git - history.git/commitdiff
kbuild: dependency generation fixes
authorKai Germaschewski <kai@tp1.ruhr-uni-bochum.de>
Thu, 6 Jun 2002 11:10:17 +0000 (06:10 -0500)
committerKai Germaschewski <kai@tp1.ruhr-uni-bochum.de>
Thu, 6 Jun 2002 11:10:17 +0000 (06:10 -0500)
o Fix a bug in fixdep.c, which could cause segfaults
o Make sure that we build fixdep first of all, since
  we need it to build host programs.

Makefile
Rules.make
scripts/Makefile
scripts/fixdep.c

index 2c2a223cd185e944ae05ea9a64287019d99598ad..c17280a5fe25ea2b36fe3404168a47296eac8ccd 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -279,8 +279,9 @@ include/asm:
 #      Split autoconf.h into include/linux/config/*
 
 include/config/MARKER: scripts/split-include include/linux/autoconf.h
-       scripts/split-include include/linux/autoconf.h include/config
-       @ touch include/config/MARKER
+       @echo 'Splitting include/linux/autoconf.h -> include/config'
+       @scripts/split-include include/linux/autoconf.h include/config
+       @touch $@
 
 #      if .config is newer than include/linux/autoconf.h, someone tinkered
 #      with it and forgot to run make oldconfig
@@ -527,7 +528,7 @@ xconfig:
        wish -f scripts/kconfig.tk
 
 menuconfig:
-       @$(MAKE) -C scripts/lxdialog all
+       @$(MAKE) -C scripts lxdialog
        $(CONFIG_SHELL) scripts/Menuconfig arch/$(ARCH)/config.in
 
 config:
index 61693e25c586b856a2cd1cec0fa7d9c42f008d37..abf9843645c302f5b07373593fdd1de959a09e10 100644 (file)
@@ -225,7 +225,6 @@ $(multi-used-m) : %.o: $(multi-objs-m) FORCE
        $(call if_changed,cmd_link_multi)
 
 # Compile programs on the host
-# FIXME: handle dependencies
 # ===========================================================================
 
 host-progs-single     := $(foreach m,$(host-progs),$(if $($(m)-objs),,$(m)))
index 11509a5bfd74ba43129778a3d82097067df89214..51dc632e28297ef252a3d723493d40d60f5cb1a2 100644 (file)
@@ -44,8 +44,20 @@ doc-progs: docproc
 
 # ---------------------------------------------------------------------------
 
+.PHONY: lxdialog
+
+lxdialog:
+       $(MAKE) -C lxdialog all
+
+# ---------------------------------------------------------------------------
+
 host-progs := fixdep split-include docproc tkparse
 
 tkparse-objs := tkparse.o tkcond.o tkgen.o
 
+# fixdep is needed to compile other host programs
+
+split-include docproc $(tkparse-objs) lxdialog: fixdep
+
+
 include $(TOPDIR)/Rules.make
index d3a4c534cef658de8e849eb9fc7009aa75e96856..5762759145354fb713b712f135e3c87d0b3c1af5 100644 (file)
@@ -307,13 +307,12 @@ void parse_dep_file(void *map, size_t len)
        clear_config();
 
        while (m < end) {
-               while (*m == ' ' || *m == '\\' || *m == '\n')
+               while (m < end && (*m == ' ' || *m == '\\' || *m == '\n'))
                        m++;
-
-               p = strchr(m, ' ');
-               if (!p) {
-                       p = end;
-                       while (!isalpha(*p)) p--;
+               p = m;
+               while (p < end && *p != ' ') p++;
+               if (p == end) {
+                       do p--; while (!isalnum(*p));
                        p++;
                }
                memcpy(s, m, p-m); s[p-m] = 0;