From f6163cfb1238bc3a40ceaeb76daa960d9af51765 Mon Sep 17 00:00:00 2001 From: tzafrir Date: Mon, 31 Mar 2008 23:57:06 +0000 Subject: Fix 'make clean' when there's no kernel tree. Partial backport of r4082 from 1.4. git-svn-id: http://svn.digium.com/svn/zaptel/branches/1.2@4117 5390a7c7-147a-4af0-8ec9-7488f05a26cb --- Makefile | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'Makefile') diff --git a/Makefile b/Makefile index a250938..ad2cd13 100644 --- a/Makefile +++ b/Makefile @@ -41,6 +41,16 @@ ifndef KSRC endif KINCLUDES:=$(KSRC)/include +# We use the kernel's .config file as an indication that the KSRC +# directory is indeed a valid and configured kernel source (or partial +# source) directory. +KCONFIG:=$(KSRC)/.config +ifneq (,$(wildcard $(KCONFIG))) + HAS_KSRC=yes +else + HAS_KSRC=no +endif + ifeq (2.6,$(shell echo $(KVERS) | cut -d. -f1-2)) BUILDVER:=linux26 else @@ -556,7 +566,9 @@ clean: rm -f patgen pattest patlooptest hdlcstress hdlctest hdlcgen hdlcverify timertest rm -f *.o ztcfg tzdriver sethdlc sethdlc-new rm -f $(TZOBJS) $(LIBTONEZONE_SO) *.lo +ifeq (yes,$(HAS_KSRC)) $(MAKE) -C $(KSRC) SUBDIRS=$(PWD) clean +endif $(MAKE) -C wct4xxp clean $(MAKE) -C wctc4xxp clean rm -rf .tmp_versions -- cgit v1.2.3