diff options
author | tzafrir <tzafrir@5390a7c7-147a-4af0-8ec9-7488f05a26cb> | 2008-03-09 14:30:23 +0000 |
---|---|---|
committer | tzafrir <tzafrir@5390a7c7-147a-4af0-8ec9-7488f05a26cb> | 2008-03-09 14:30:23 +0000 |
commit | 918ddfcaa4e55946e662d3b4b2766e92084c43c6 (patch) | |
tree | 0b1c4cd2a6b3d31ccf89e33d960dd778153629bf | |
parent | eb31d608831bdc6f8e425f995e82c723d1abb3c8 (diff) |
The main Makefile now knows if we don't have kernel source.
* Nicer handling of situations where we don't have kernel source and
don't really need it ('make clean', mainly).
* The test for hotplug firmware is now from the same .config file. No
more strange message about autoconf.h .
git-svn-id: http://svn.digium.com/svn/zaptel/branches/1.4@3976 5390a7c7-147a-4af0-8ec9-7488f05a26cb
-rw-r--r-- | Makefile | 18 |
1 files changed, 16 insertions, 2 deletions
@@ -41,6 +41,13 @@ endif KVERS_MAJ:=$(shell echo $(KVERS) | cut -d. -f1-2) KINCLUDES:=$(KSRC)/include +KCONFIG:=$(KSRC)/.config +ifneq (,$(wildcard $(KCONFIG))) + HAS_KSRC=yes +else + HAS_KSRC=no +endif + ifeq ($(KVERS_MAJ),2.4) BUILDVER:=linux24 else @@ -54,7 +61,9 @@ ifeq ($(BUILDVER),linux26) DYNFS=yes UDEVRULES=yes endif - HOTPLUG_FIRMWARE:=$(shell if grep CONFIG_FW_LOADER $(KINCLUDES)/linux/autoconf.h | grep -q undef; then echo "no"; else echo "yes"; fi) + ifeq (yes,$(HAS_KSRC)) + HOTPLUG_FIRMWARE:=$(shell if grep '^CONFIG_FW_LOADER=[ym]' $(KCONFIG); then echo "no"; else echo "yes"; fi) + endif endif # If the file .zaptel.makeopts is present in your home directory, you can @@ -276,7 +285,10 @@ programs: libs utils utils: $(BINS) utils-subdirs modules: prereq - @if [ -z "$(KSRC)" -o ! -d "$(KSRC)" ]; then echo "You do not appear to have the sources for the $(KVERS) kernel installed."; exit 1 ; fi +ifeq (no,$(HAS_KSRC)) + echo "You do not appear to have the sources for the $(KVERS) kernel installed." + exit 1 +endif $(KMAKE) modules version.h: @@ -555,7 +567,9 @@ clean: rm -f $(BINS) rm -f *.o ztcfg tzdriver sethdlc sethdlc-new rm -f $(LTZ_SO) $(LTZ_A) *.lo +ifeq (yes,$(HAS_KSRC)) $(KMAKE) clean +endif @for dir in $(SUBDIRS_UTILS_ALL); do \ $(MAKE) -C $$dir clean; \ done |