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:
# 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:
......
......@@ -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)))
......
......@@ -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
......@@ -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;
......
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