1 ###############################################################################
4 # @brief Generic definitions to build Linux drivers.
6 # @author Yury GEORGIEVSKIY, CERN.
8 # @date Created on 07/04/2009
10 # Should be included by the driver Makefile && Kbuild.
11 # CDCM and driver utils Kbuilds are using it as well.
12 ###############################################################################
16 # Fall here only on the 1st level of make.
17 # Allow us to compile with local kernels
18 ifeq ($(KSRC), /usr/src/kernels)
19 override KVER := $(KVER)-$(shell uname -m)
21 override KSRC := $(KSRC)/$(KVER)
24 # Set default kernel version
25 # TODO. Define default in paramount.mk
28 KSRC := /acc/sys/$(CPU)/usr/src/kernels/$(KVER)
31 abs2rel = $(shell $(ROOTDIR)/makefiles/abs2rel.sh $(1) $(2))
33 # That's our default target when none is given on the command line
37 # Compiled files goes here
38 OBJDIR = $(CPU)/$(KVER)
42 # Filter out all objects files from current directory - getting rid
43 # of ',name.c' backup files
51 DRVRSRCFILES = $(wildcard $(M)/*.c)
52 FLTSRCFILES = $(filter-out $(M)/$(comma)%, $(filter $(addprefix %, $(SRCSFXS)),$(DRVRSRCFILES)))
53 OBJFILES = $(addsuffix $(EXTOBJ),$(notdir $(basename $(FLTSRCFILES))))
55 # Absolutely needed pathes
56 # Not using [ccflags-y] _ONLY_ to be able to compile with 2.6.9
57 # [ccflags-y] should be used when 2.6.9 is not used anymore
58 EXTRA_CFLAGS += -I$(ROOTDIR)/include