summaryrefslogtreecommitdiff
path: root/drivers/ipoe/CMakeLists.txt
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/ipoe/CMakeLists.txt')
-rw-r--r--drivers/ipoe/CMakeLists.txt19
1 files changed, 19 insertions, 0 deletions
diff --git a/drivers/ipoe/CMakeLists.txt b/drivers/ipoe/CMakeLists.txt
new file mode 100644
index 00000000..fb5a51e4
--- /dev/null
+++ b/drivers/ipoe/CMakeLists.txt
@@ -0,0 +1,19 @@
+if (NOT DEFINED KDIR)
+ set(KDIR "/usr/src/linux")
+endif (NOT DEFINED KDIR)
+
+ADD_CUSTOM_COMMAND(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/driver/ipoe.ko
+ COMMAND rm -rf ${CMAKE_CURRENT_BINARY_DIR}/driver
+ COMMAND mkdir ${CMAKE_CURRENT_BINARY_DIR}/driver
+ COMMAND ln -sf ${CMAKE_CURRENT_SOURCE_DIR}/* ${CMAKE_CURRENT_BINARY_DIR}/driver
+ COMMAND make -C ${KDIR} M=${CMAKE_CURRENT_BINARY_DIR}/driver modules
+ DEPENDS ipoe.c ipoe.h
+)
+
+ADD_CUSTOM_TARGET(isg_drv ALL
+ DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/driver/ipoe.ko
+)
+
+
+INSTALL(CODE "EXECUTE_PROCESS(COMMAND make -C ${KDIR} M=${CMAKE_CURRENT_BINARY_DIR}/drivers/ipoe modules_install)")
+