devices/Kbuild
changeset 582 39f1704b0c99
parent 581 99623f8a8493
child 584 150c8a1caf25
equal deleted inserted replaced
581:99623f8a8493 582:39f1704b0c99
    31 #
    31 #
    32 #------------------------------------------------------------------------------
    32 #------------------------------------------------------------------------------
    33 
    33 
    34 include $(src)/../config.kbuild
    34 include $(src)/../config.kbuild
    35 
    35 
    36 EC_8139TOO_OBJ = 8139too-$(EC_8139TOO_KERNEL)-ethercat.o
       
    37 EC_E100_OBJ = e100-$(EC_E100_KERNEL)-ethercat.o
       
    38 EC_FORCEDETH_OBJ = forcedeth-$(EC_FORCEDETH_KERNEL)-ethercat.o
       
    39 
       
    40 obj-m := ec_8139too.o
       
    41 ifeq ($(ENABLE_E100),1)
       
    42 	obj-m += ec_e100.o
       
    43 endif
       
    44 ifeq ($(ENABLE_FORCEDETH),1)
       
    45 	obj-m += ec_forcedeth.o
       
    46 endif
       
    47 
       
    48 ec_8139too-objs := $(EC_8139TOO_OBJ)
       
    49 ec_e100-objs := $(EC_E100_OBJ)
       
    50 ec_forcedeth-objs := $(EC_FORCEDETH_OBJ)
       
    51 
       
    52 REV := $(shell if test -s $(src)/../svnrevision; then \
    36 REV := $(shell if test -s $(src)/../svnrevision; then \
    53 		cat $(src)/../svnrevision; \
    37 		cat $(src)/../svnrevision; \
    54 	else \
    38 	else \
    55 		svnversion $(src)/.. 2>/dev/null || echo "unknown"; \
    39 		svnversion $(src)/.. 2>/dev/null || echo "unknown"; \
    56 	fi)
    40 	fi)
    57 
    41 
    58 CFLAGS_$(EC_8139TOO_OBJ) = -DSVNREV=$(REV)
    42 ifeq ($(EC_ENABLE_8139TOO),1)
    59 CFLAGS_$(EC_E100_OBJ) = -DSVNREV=$(REV)
    43 	obj-m += ec_8139too.o
    60 CFLAGS_$(EC_FORCEDETH_OBJ) = -DSVNREV=$(REV)
    44 	ec_8139too-objs := 8139too-$(EC_8139TOO_KERNEL)-ethercat.o
       
    45 	CFLAGS_$(EC_8139TOO_OBJ) = -DSVNREV=$(REV)
       
    46 endif
       
    47 
       
    48 ifeq ($(EC_ENABLE_E100),1)
       
    49 	obj-m += ec_e100.o
       
    50 	ec_e100-objs := e100-$(EC_E100_KERNEL)-ethercat.o
       
    51 	CFLAGS_$(EC_E100_OBJ) = -DSVNREV=$(REV)
       
    52 endif
       
    53 
       
    54 ifeq ($(EC_ENABLE_FORCEDETH),1)
       
    55 	obj-m += ec_forcedeth.o
       
    56 	ec_forcedeth-objs := forcedeth-$(EC_FORCEDETH_KERNEL)-ethercat.o
       
    57 	CFLAGS_$(EC_FORCEDETH_OBJ) = -DSVNREV=$(REV)
       
    58 endif
    61 
    59 
    62 #------------------------------------------------------------------------------
    60 #------------------------------------------------------------------------------