summaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authortzafrir <tzafrir@5390a7c7-147a-4af0-8ec9-7488f05a26cb>2008-03-31 23:57:06 +0000
committertzafrir <tzafrir@5390a7c7-147a-4af0-8ec9-7488f05a26cb>2008-03-31 23:57:06 +0000
commitf6163cfb1238bc3a40ceaeb76daa960d9af51765 (patch)
tree4cf78a76e3096b4827e4c746254fb694dd74eee1 /Makefile
parent95535e51a3d69e1c81830afd0dc922028bc813ae (diff)
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
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile12
1 files changed, 12 insertions, 0 deletions
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