summaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorcitats <citats@5390a7c7-147a-4af0-8ec9-7488f05a26cb>2004-03-19 09:49:29 +0000
committercitats <citats@5390a7c7-147a-4af0-8ec9-7488f05a26cb>2004-03-19 09:49:29 +0000
commit3d40c3796d40024703685ec69d3abbaccbf9c88c (patch)
tree92b9fb3fd7f654adbae586e339df77b6e1331ff2 /Makefile
parentd750a2c6207f8e6fb650e1921a03b44010364ea5 (diff)
Autodetect 2.6 vs 2.4 when building zaptel modules.
Don't require 'make linux26' anymore git-svn-id: http://svn.digium.com/svn/zaptel/trunk@329 5390a7c7-147a-4af0-8ec9-7488f05a26cb
Diffstat (limited to 'Makefile')
-rwxr-xr-xMakefile11
1 files changed, 8 insertions, 3 deletions
diff --git a/Makefile b/Makefile
index 99ec1c6..5a7062d 100755
--- a/Makefile
+++ b/Makefile
@@ -49,17 +49,22 @@ MODULESO=$(shell for x in $(MODULES); do echo "$$x.o "; done )
MODULESKO=$(shell for x in $(MODULES); do echo "$$x.ko "; done )
ZTTOOL=$(shell if [ -f /usr/include/newt.h ]; then echo zttool; fi)
+BINS=ztcfg torisatool makefw ztmonitor ztspeed $(ZTTOOL)
+
#PRIMARY=wcfxsusb
PRIMARY=torisa
#PRIMARY=wcfxo
PWD=$(shell pwd)
-all: $(MODULESO) ztcfg torisatool makefw ztmonitor ztspeed $(ZTTOOL)
+BUILDVER=$(shell if uname -r | grep -q ^2.6; then echo "linux26"; else echo "linux24"; fi)
+all: $(BUILDVER)
+
+linux24: $(MODULESO) $(BINS)
linux26:
-linux26: prereq ztcfg torisatool makefw ztmonitor ztspeed $(ZTTOOL)
+linux26: prereq $(BINS)
@if ! [ -d /usr/src/linux-2.6 ]; then echo "Link /usr/src/linux-2.6 to your kernel sources first!"; exit 1 ; fi
- make -C /usr/src/linux-2.6 SUBDIRS=$(PWD) modules
+ @make -C /usr/src/linux-2.6 SUBDIRS=$(PWD) modules
obj-m := $(MODULESO)