summaryrefslogtreecommitdiff
path: root/Kbuild
diff options
context:
space:
mode:
authortzafrir <tzafrir@5390a7c7-147a-4af0-8ec9-7488f05a26cb>2008-01-19 15:50:31 +0000
committertzafrir <tzafrir@5390a7c7-147a-4af0-8ec9-7488f05a26cb>2008-01-19 15:50:31 +0000
commit21797cd3d683c34b0d59255fb9a0e9ea48c69c36 (patch)
tree329f9f27614de746c09e0acb6050413c38c9b772 /Kbuild
parent023c65c2b38b5a1c74fc42d6b5600c84ec9bd627 (diff)
Some more separation of kernel build Makefile from original one. This is
a small change functionality-wise but makes it much simpler to move things around. It also fixes the major issue of issue #11141, with only xpp issue left for proper kernel 2.6.24 support. git-svn-id: http://svn.digium.com/svn/zaptel/branches/1.4@3706 5390a7c7-147a-4af0-8ec9-7488f05a26cb
Diffstat (limited to 'Kbuild')
-rw-r--r--Kbuild50
1 files changed, 50 insertions, 0 deletions
diff --git a/Kbuild b/Kbuild
new file mode 100644
index 0000000..fdd8d39
--- /dev/null
+++ b/Kbuild
@@ -0,0 +1,50 @@
+ifdef ECHO_CAN_NAME
+ ECHO_CAN_CFLAGS := -DECHO_CAN_FROMENV -DECHO_CAN_$(ECHO_CAN_NAME)
+endif
+
+obj-m := $(KBUILD_OBJ_M)
+
+EXTRA_CFLAGS := -I$(src) -DSTANDALONE_ZAPATA
+EXTRA_CFLAGS += $(ECHO_CAN_CFLAGS)
+
+# fix typo present in CentOS and RHEL 2.6.9 kernels
+BAD_KERNELS_VERS := 22 34 34.0.1 34.0.2
+BAD_KERNELS := $(foreach ver,$(BAD_KERNELS_VERS),2.6.9-$(ver).EL 2.6.9-$(ver).ELsmp)
+ifneq (,$(filter $(KVERS),$(BAD_KERNELS)))
+EXTRA_CFLAGS+=-Drw_lock_t=rwlock_t
+endif
+
+zaptel-objs := zaptel-base.o
+
+ifeq ($(HPEC_PRESENT),yes)
+ifeq ($(ARCH),i386)
+zaptel-objs += hpec/hpec_x86_32.o
+endif
+
+ifeq ($(ARCH),x86_64)
+zaptel-objs += hpec/hpec_x86_64.o
+endif
+
+EXTRA_CFLAGS += -DECHO_CAN_HPEC -I$(src)/hpec
+endif
+
+
+# set CONFIG_ZAPTEL_MMX for a number of CPU types.
+# Right now this part is not enabled, unless you build with
+# ZAPTEL_MMX_AUTO=something .
+ZAPMMX_WHITELIST_i386 = M586MMX M686 MPENTIUMII MPENTIUMIII MPENTIUMM \
+ MPENTIUM4 MVIAC3_2
+
+ZAPMMX_WHITELIST_x86_64 =
+
+# A list of configuration variables to test: CONFIG_M686 , etc.
+ZAPMMX_CONFIG_VARS := $(ZAPMMX_WHITELIST_$(ARCH):%=CONFIG_%)
+
+# expand them:
+ZAPMMX_CONFIG_VALS := $(strip $(foreach var,$(ZAPMMX_CONFIG_VARS),$(var)) )
+ifneq (,$(ZAPTEL_MMX_AUTO))
+ ifneq (,$(ZAPMMX_CONFIG_VALS))
+ # TODO: make that
+ CFLAGS_zaptel-base.o += -DCONFIG_ZAPTEL_MMX
+ endif
+endif