Commit b28ae717 authored by Kai Germaschewski's avatar Kai Germaschewski

kbuild: dependency generation fixes

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.
parent f85cd0e8
...@@ -279,8 +279,9 @@ include/asm: ...@@ -279,8 +279,9 @@ include/asm:
# Split autoconf.h into include/linux/config/* # Split autoconf.h into include/linux/config/*
include/config/MARKER: scripts/split-include include/linux/autoconf.h include/config/MARKER: scripts/split-include include/linux/autoconf.h
scripts/split-include include/linux/autoconf.h include/config @echo 'Splitting include/linux/autoconf.h -> include/config'
@ touch include/config/MARKER @scripts/split-include include/linux/autoconf.h include/config
@touch $@
# if .config is newer than include/linux/autoconf.h, someone tinkered # if .config is newer than include/linux/autoconf.h, someone tinkered
# with it and forgot to run make oldconfig # with it and forgot to run make oldconfig
...@@ -527,7 +528,7 @@ xconfig: ...@@ -527,7 +528,7 @@ xconfig:
wish -f scripts/kconfig.tk wish -f scripts/kconfig.tk
menuconfig: menuconfig:
@$(MAKE) -C scripts/lxdialog all @$(MAKE) -C scripts lxdialog
$(CONFIG_SHELL) scripts/Menuconfig arch/$(ARCH)/config.in $(CONFIG_SHELL) scripts/Menuconfig arch/$(ARCH)/config.in
config: config:
......
...@@ -225,7 +225,6 @@ $(multi-used-m) : %.o: $(multi-objs-m) FORCE ...@@ -225,7 +225,6 @@ $(multi-used-m) : %.o: $(multi-objs-m) FORCE
$(call if_changed,cmd_link_multi) $(call if_changed,cmd_link_multi)
# Compile programs on the host # Compile programs on the host
# FIXME: handle dependencies
# =========================================================================== # ===========================================================================
host-progs-single := $(foreach m,$(host-progs),$(if $($(m)-objs),,$(m))) host-progs-single := $(foreach m,$(host-progs),$(if $($(m)-objs),,$(m)))
......
...@@ -44,8 +44,20 @@ doc-progs: docproc ...@@ -44,8 +44,20 @@ doc-progs: docproc
# --------------------------------------------------------------------------- # ---------------------------------------------------------------------------
.PHONY: lxdialog
lxdialog:
$(MAKE) -C lxdialog all
# ---------------------------------------------------------------------------
host-progs := fixdep split-include docproc tkparse host-progs := fixdep split-include docproc tkparse
tkparse-objs := tkparse.o tkcond.o tkgen.o 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 include $(TOPDIR)/Rules.make
...@@ -307,13 +307,12 @@ void parse_dep_file(void *map, size_t len) ...@@ -307,13 +307,12 @@ void parse_dep_file(void *map, size_t len)
clear_config(); clear_config();
while (m < end) { while (m < end) {
while (*m == ' ' || *m == '\\' || *m == '\n') while (m < end && (*m == ' ' || *m == '\\' || *m == '\n'))
m++; m++;
p = m;
p = strchr(m, ' '); while (p < end && *p != ' ') p++;
if (!p) { if (p == end) {
p = end; do p--; while (!isalnum(*p));
while (!isalpha(*p)) p--;
p++; p++;
} }
memcpy(s, m, p-m); s[p-m] = 0; memcpy(s, m, p-m); s[p-m] = 0;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment