forked from OpenEtherCATsociety/SOEM
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Mikael Heden
committed
Jul 9, 2015
1 parent
57c648a
commit 77da52b
Showing
58 changed files
with
207 additions
and
1,275 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
cmake_minimum_required(VERSION 2.8.4) | ||
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/cmake/Modules") | ||
project(SOEM C) | ||
|
||
set(CMAKE_INSTALL_PREFIX ${CMAKE_SOURCE_DIR}/install) | ||
|
||
message("CMAKE_SYSTEM_NAME is ${CMAKE_SYSTEM_NAME}") | ||
|
||
if(WIN32) | ||
set(OS "win32") | ||
include_directories(oshw/win32/wpcap/Include) | ||
link_directories(${CMAKE_SOURCE_DIR}/oshw/win32/wpcap/Lib) | ||
elseif(UNIX) | ||
set(OS "linux") | ||
elseif(${CMAKE_SYSTEM_NAME} MATCHES "rt-kernel") | ||
set(OS "rtk") | ||
message("ARCH is ${ARCH}") | ||
message("BSP is ${BSP}") | ||
include_directories(oshw/${OS}/${ARCH}) | ||
add_definitions("-Wno-unused-but-set-variable") | ||
add_definitions("-Wno-unused-function") | ||
add_definitions("-Wno-format") | ||
endif() | ||
|
||
message("OS is ${OS}") | ||
|
||
include_directories(soem) | ||
include_directories(osal) | ||
include_directories(osal/${OS}) | ||
include_directories(oshw/${OS}) | ||
|
||
if (MSVC) | ||
set(CMAKE_C_FLAGS_RELEASE "/D _CRT_SECURE_NO_WARNINGS /EHsc") | ||
set(CMAKE_C_FLAGS_DEBUG "/D _CRT_SECURE_NO_WARNINGS /EHsc /ZI /Od") | ||
endif() | ||
|
||
file(GLOB SOEM_SOURCES soem/*.c) | ||
file(GLOB OSAL_SOURCES osal/${OS}/*.c) | ||
file(GLOB OSHW_SOURCES oshw/${OS}/*.c) | ||
|
||
if(WIN32) | ||
set(SOEM_SOURCES ${SOEM_SOURCES}) | ||
endif() | ||
|
||
file(GLOB SOEM_HEADERS soem/*.h) | ||
file(GLOB OSAL_HEADERS osal/osal.h osal/${OS}/*.h) | ||
file(GLOB OSHW_HEADERS oshw/${OS}/*.h) | ||
|
||
if(${CMAKE_SYSTEM_NAME} MATCHES "rt-kernel") | ||
file(GLOB OSHW_ARCHSOURCES oshw/${OS}/${ARCH}/*.c) | ||
endif() | ||
|
||
add_library(soem STATIC ${SOEM_SOURCES} ${OSAL_SOURCES} ${OSHW_SOURCES} ${OSHW_ARCHSOURCES}) | ||
if(WIN32) | ||
target_link_libraries(soem wpcap.lib Packet.lib Ws2_32.lib Winmm.lib ${HDF5_LIBRARIES}) | ||
elseif(UNIX) | ||
target_link_libraries(soem pthread rt) | ||
endif() | ||
|
||
install(TARGETS soem DESTINATION bin) | ||
install(FILES ${SOEM_HEADERS} ${OSAL_HEADERS} ${OSHW_HEADERS} DESTINATION include) | ||
|
||
add_subdirectory(test/linux/slaveinfo) | ||
add_subdirectory(test/linux/eepromtool) | ||
add_subdirectory(test/linux/simple_test) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
BUILDING | ||
======== | ||
|
||
Prerequisites for all platforms | ||
------------------------------- | ||
|
||
* CMake 2.8.0 or later | ||
|
||
|
||
Windows (Visual Studio) | ||
----------------------- | ||
|
||
* Start a Visual Studio command prompt then: | ||
$ mkdir build | ||
$ cd build | ||
$ cmake .. -G "NMake Makefiles" | ||
$ nmake | ||
|
||
Linux | ||
----- | ||
|
||
$ mkdir build | ||
$ cmake .. | ||
$ make |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
|
||
message("rt-kernel-C.cmake") | ||
|
||
# Determine toolchain | ||
include(CMakeForceCompiler) | ||
|
||
if(${ARCH} MATCHES "kinetis") | ||
cmake_force_c_compiler(arm-eabi-gcc GNU) | ||
cmake_force_cxx_compiler(arm-eabi-g++ GNU) | ||
elseif(${ARCH} MATCHES "bfin") | ||
cmake_force_c_compiler(bfin-elf-gcc GNU) | ||
cmake_force_cxx_compiler(bfin-elf-g++ GNU) | ||
endif() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
|
||
set(MACHINE "-mcpu=bf537") | ||
set(LDFLAGS "-T${RT_KERNEL_PATH}/bsp/${BSP}/${BSP}.ld") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
|
||
message("rt-kernel-gcc-kinetis.cmake") | ||
|
||
#SET_PROPERTY(GLOBAL PROPERTY ARCH kinetis) | ||
#SET_PROPERTY(GLOBAL PROPERTY BSP twrk60) | ||
|
||
set(MACHINE "-mfpu=vfp -mcpu=cortex-m3 -mthumb") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
|
||
message("rt-kernel-gcc.cmake") | ||
|
||
set(CMAKE_C_OUTPUT_EXTENSION .o) | ||
set_property(GLOBAL PROPERTY TARGET_SUPPORTS_SHARED_LIBS FALSE) | ||
|
||
set(CFLAGS "${CFLAGS} -Wall -Wextra -Wno-unused-parameter -Werror") | ||
set(CFLAGS "${CFLAGS} -fomit-frame-pointer -fno-strict-aliasing -fshort-wchar") | ||
#set(CFLAGS" ${CFLAGS} -B$(GCC_PATH)/libexec/gcc") | ||
|
||
set(CXXFLAGS "${CXXFLAGS} -fno-rtti -fno-exceptions") | ||
|
||
set(LDFLAGS "${LDFLAGS} -nostartfiles") | ||
|
||
set(CMAKE_C_FLAGS "${CFLAGS} ${MACHINE}" CACHE STRING "") | ||
set(CMAKE_EXE_LINKER_FLAGS "${MACHINE} ${LDFLAGS}" CACHE STRING "") | ||
|
||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
if(__RTK_CMAKE_INCLUDED) | ||
return() | ||
endif() | ||
set(__RTK_CMAKE_INCLUDED TRUE) | ||
message("rt-kernel.cmake") | ||
|
||
include_directories( | ||
${RT_KERNEL_PATH}/include | ||
${RT_KERNEL_PATH}/include/kern | ||
${RT_KERNEL_PATH}/kern | ||
${RT_KERNEL_PATH}/include/drivers | ||
${RT_KERNEL_PATH}/include/arch/${ARCH} | ||
${RT_KERNEL_PATH}/bsp/${BSP}/include | ||
${RT_KERNEL_PATH}/lwip/src/include | ||
${RT_KERNEL_PATH}/lwip/src/include/ipv4 | ||
) | ||
|
||
link_directories( | ||
${RT_KERNEL_PATH}/lib/${ARCH} | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
|
||
message("rt-kernel-kinetis.cmake") | ||
|
||
set(CMAKE_SYSTEM_NAME rt-kernel) | ||
set(CMAKE_SYSTEM_VERSION 1) | ||
set(CMAKE_SYSTEM_PROCESSOR bfin) | ||
|
||
set(ARCH bfin CACHE STRING "Architecture") | ||
set(BSP stamp537 CACHE STRING "Board") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
|
||
message("rt-kernel-kinetis.cmake") | ||
|
||
set(CMAKE_SYSTEM_NAME rt-kernel) | ||
set(CMAKE_SYSTEM_VERSION 1) | ||
set(CMAKE_SYSTEM_PROCESSOR kinetis) | ||
|
||
set(ARCH kinetis CACHE STRING "Architecture") | ||
set(BSP twrk60 CACHE STRING "Board") |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.