examples/msr/Makefile
changeset 232 f6594a07cdda
parent 224 4828e5e419bf
child 246 0bf7c769de06
equal deleted inserted replaced
231:767548c75bf3 232:f6594a07cdda
     1 #------------------------------------------------------------------------------
     1 #------------------------------------------------------------------------------
     2 #
     2 #
     3 #  Makefile
     3 #  Makefile
       
     4 #
       
     5 #  Sample module for use with IgH MSR library.
     4 #
     6 #
     5 #  $Id$
     7 #  $Id$
     6 #
     8 #
     7 #  Copyright (C) 2006  Florian Pose, Ingenieurgemeinschaft IgH
     9 #  Copyright (C) 2006  Florian Pose, Ingenieurgemeinschaft IgH
     8 #
    10 #
    21 #  along with the IgH EtherCAT Master; if not, write to the Free Software
    23 #  along with the IgH EtherCAT Master; if not, write to the Free Software
    22 #  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
    24 #  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
    23 #
    25 #
    24 #------------------------------------------------------------------------------
    26 #------------------------------------------------------------------------------
    25 
    27 
    26 ifneq ($(KERNELRELEASE),)
    28 MODULE := ec_msr_sample
    27 
    29 
    28 #------------------------------------------------------------------------------
    30 #------------------------------------------------------------------------------
    29 #  kbuild section
    31 #  kbuild section
    30 #------------------------------------------------------------------------------
    32 #------------------------------------------------------------------------------
    31 
    33 
    32 ifneq ($(wildcard $(src)/rt.conf),)
    34 ifneq ($(KERNELRELEASE),)
    33 include $(src)/rt.conf
       
    34 else
       
    35 MODULENAME := rt
       
    36 endif
       
    37 
    35 
    38 obj-m := $(MODULENAME).o
    36 obj-m := $(MODULE).o
    39 
    37 
    40 $(MODULENAME)-objs := msr_rt.o \
    38 $(MODULE)-objs := msr_sample.o \
    41 			rt_lib/msr-core/msr_lists.o \
    39 			rt_lib/msr-core/msr_lists.o \
    42 			rt_lib/msr-core/msr_main.o \
    40 			rt_lib/msr-core/msr_main.o \
    43 			rt_lib/msr-core/msr_charbuf.o \
    41 			rt_lib/msr-core/msr_charbuf.o \
    44 			rt_lib/msr-core/msr_reg.o \
    42 			rt_lib/msr-core/msr_reg.o \
    45 			rt_lib/msr-core/msr_interpreter.o \
    43 			rt_lib/msr-core/msr_interpreter.o \
    50 			rt_lib/msr-utils/msr_time.o \
    48 			rt_lib/msr-utils/msr_time.o \
    51 			rt_lib/msr-math/msr_base64.o \
    49 			rt_lib/msr-math/msr_base64.o \
    52 			rt_lib/msr-math/msr_hex_bin.o \
    50 			rt_lib/msr-math/msr_hex_bin.o \
    53 			libm.o
    51 			libm.o
    54 
    52 
    55 EXTRA_CFLAGS := -I$(src)/rt_lib/msr-include -D_SIMULATION \
    53 EXTRA_CFLAGS := -I$(src)/rt_lib/msr-include -I/usr/realtime/include \
    56 		-I/usr/include -mhard-float \
    54 		-D_SIMULATION -mhard-float
    57 		-DSVNREV=$(shell svnversion $(src)) -DUSER=$(USER)
       
    58 
       
    59 #------------------------------------------------------------------------------
       
    60 
       
    61 else
       
    62 
    55 
    63 #------------------------------------------------------------------------------
    56 #------------------------------------------------------------------------------
    64 #  default section
    57 #  default section
    65 #------------------------------------------------------------------------------
    58 #------------------------------------------------------------------------------
    66 
    59 
    67 ifneq ($(wildcard rt.conf),)
       
    68 include rt.conf
       
    69 else
    60 else
    70 MODULENAME := msr_rt
    61 
       
    62 ifneq ($(wildcard kernel.conf),)
       
    63 include kernel.conf
       
    64 else
    71 KERNEL := $(shell uname -r)
    65 KERNEL := $(shell uname -r)
    72 endif
    66 endif
    73 
    67 
    74 KERNELDIR := /lib/modules/$(KERNEL)/build
    68 KERNELDIR := /lib/modules/$(KERNEL)/build
    75 
    69 
    78 
    72 
    79 clean:
    73 clean:
    80 	$(MAKE) -C $(KERNELDIR) M=`pwd` clean
    74 	$(MAKE) -C $(KERNELDIR) M=`pwd` clean
    81 
    75 
    82 install:
    76 install:
    83 	@./install.sh $(MODULENAME) $(KERNEL)
    77 	@./install.sh $(MODULE) $(KERNEL)
       
    78 
       
    79 endif
    84 
    80 
    85 #------------------------------------------------------------------------------
    81 #------------------------------------------------------------------------------
    86 
       
    87 endif