Add receipe and makefile fro netifd and uci.
This commit is contained in:
46
src/3P/netifd/builders/cmake/CMakeLists.txt
Normal file
46
src/3P/netifd/builders/cmake/CMakeLists.txt
Normal file
@@ -0,0 +1,46 @@
|
||||
cmake_minimum_required (VERSION 3.0)
|
||||
|
||||
project (netifd)
|
||||
|
||||
ADD_DEFINITIONS(-Os -Wall -Werror --std=gnu99 -Wmissing-declarations)
|
||||
|
||||
set (CMAKE_MODULE_PATH "${MODULE_PATH}")
|
||||
|
||||
set(DISABLE_TARGET_OPTIMIZATION ON)
|
||||
|
||||
include (br)
|
||||
|
||||
file (
|
||||
GLOB_RECURSE
|
||||
source_files
|
||||
|
||||
$ENV{SRC_DIR}/src/3P/netifd/main.c
|
||||
$ENV{SRC_DIR}/src/3P/netifd/utils.c
|
||||
$ENV{SRC_DIR}/src/3P/netifd/system.c
|
||||
$ENV{SRC_DIR}/src/3P/netifd/tunnel.c
|
||||
$ENV{SRC_DIR}/src/3P/netifd/handler.c
|
||||
$ENV{SRC_DIR}/src/3P/netifd/interface.c
|
||||
$ENV{SRC_DIR}/src/3P/netifd/interface-ip.c
|
||||
$ENV{SRC_DIR}/src/3P/netifd/interface-event.c
|
||||
$ENV{SRC_DIR}/src/3P/netifd/iprule.c
|
||||
$ENV{SRC_DIR}/src/3P/netifd/proto.c
|
||||
$ENV{SRC_DIR}/src/3P/netifd/proto-static.c
|
||||
$ENV{SRC_DIR}/src/3P/netifd/proto-shell.c
|
||||
$ENV{SRC_DIR}/src/3P/netifd/config.c
|
||||
$ENV{SRC_DIR}/src/3P/netifd/device.c
|
||||
$ENV{SRC_DIR}/src/3P/netifd/bridge.c
|
||||
$ENV{SRC_DIR}/src/3P/netifd/vlan.c
|
||||
$ENV{SRC_DIR}/src/3P/netifd/alias.c
|
||||
$ENV{SRC_DIR}/src/3P/netifd/macvlan.c
|
||||
$ENV{SRC_DIR}/src/3P/netifd/ubus.c
|
||||
$ENV{SRC_DIR}/src/3P/netifd/vlandev.c
|
||||
$ENV{SRC_DIR}/src/3P/netifd/wireless.c
|
||||
|
||||
$ENV{SRC_DIR}/src/3P/netifd/system-linux.c
|
||||
)
|
||||
|
||||
|
||||
add_executable (netifd ${source_files})
|
||||
target_link_libraries (netifd ubox ubus json-c blobmsg_json)
|
||||
|
||||
install (TARGETS netifd RUNTIME DESTINATION ../sbin)
|
||||
47
src/3P/uci/builders/cmake/CMakeLists.txt
Normal file
47
src/3P/uci/builders/cmake/CMakeLists.txt
Normal file
@@ -0,0 +1,47 @@
|
||||
cmake_minimum_required(VERSION 3.0)
|
||||
|
||||
project (uci)
|
||||
|
||||
set (CMAKE_MODULE_PATH "${MODULE_PATH}")
|
||||
|
||||
set(DISABLE_TARGET_OPTIMIZATION ON)
|
||||
|
||||
include (br)
|
||||
|
||||
include_directories ($ENV{SRC_DIR}/src/3P/uci)
|
||||
|
||||
ADD_DEFINITIONS (-Werror --std=gnu99 -Wmissing-declarations)
|
||||
|
||||
CONFIGURE_FILE ($ENV{SRC_DIR}/src/3P/uci/uci_config.h.in $ENV{SRC_DIR}/src/3P/uci/uci_config.h )
|
||||
|
||||
# uci library
|
||||
file (
|
||||
GLOB_RECURSE
|
||||
lib_source_files
|
||||
|
||||
$ENV{SRC_DIR}/src/3P/uci/libuci.c
|
||||
$ENV{SRC_DIR}/src/3P/uci/file.c
|
||||
$ENV{SRC_DIR}/src/3P/uci/util.c
|
||||
$ENV{SRC_DIR}/src/3P/uci/delta.c
|
||||
$ENV{SRC_DIR}/src/3P/uci/parse.c
|
||||
$ENV{SRC_DIR}/src/3P/uci/blob.c
|
||||
)
|
||||
|
||||
# Library
|
||||
add_library (uci SHARED ${lib_source_files})
|
||||
target_link_libraries (uci LINK_PUBLIC ubox)
|
||||
|
||||
target_include_directories (uci PUBLIC ${CMAKE_CURRENT_SOURCE_DIR})
|
||||
|
||||
install (TARGETS uci LIBRARY DESTINATION local/lib)
|
||||
|
||||
file (GLOB uci_headers $ENV{SRC_DIR}/src/3P/uci/*.h)
|
||||
install (FILES ${uci_headers} DESTINATION include/uci)
|
||||
|
||||
|
||||
# cmd line tool.
|
||||
add_executable (uci_cli $ENV{SRC_DIR}/src/3P/uci/cli.c)
|
||||
set_target_properties (uci_cli PROPERTIES OUTPUT_NAME uci)
|
||||
target_link_libraries (uci_cli LINK_PUBLIC uci ubox blobmsg_json)
|
||||
|
||||
install (TARGETS uci_cli RUNTIME DESTINATION bin)
|
||||
Reference in New Issue
Block a user