1 cmake_minimum_required(VERSION 2.6)
4 INCLUDE(GNUInstallDirs)
5 ADD_DEFINITIONS(-Os -ggdb -Wall -Werror --std=gnu99 -Wmissing-declarations)
7 SET(CMAKE_SHARED_LIBRARY_LINK_C_FLAGS "")
10 INCLUDE_DIRECTORIES(/opt/local/include)
11 LINK_DIRECTORIES(/opt/local/lib)
15 ADD_LIBRARY(setlbf SHARED service/setlbf.c)
16 INSTALL(TARGETS setlbf
17 LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
21 SET(SOURCES procd.c signal.c state.c inittab.c rcS.c ubus.c system.c
22 service/service.c service/instance.c service/validate.c service/trigger.c service/watch.c
25 SET(SOURCES ${SOURCES} watchdog.c plug/coldplug.c plug/hotplug.c)
28 SET(LIBS ubox ubus json-c blobmsg_json json_script)
31 ADD_DEFINITIONS(-DDEBUG -g3)
35 ADD_DEFINITIONS(-DEARLY_PATH="${EARLY_PATH}")
39 ADD_DEFINITIONS(-DZRAM_TMPFS)
40 SET(SOURCES_ZRAM initd/zram.c)
44 add_subdirectory(upgraded)
47 ADD_EXECUTABLE(procd ${SOURCES})
48 TARGET_LINK_LIBRARIES(procd ${LIBS})
50 RUNTIME DESTINATION ${CMAKE_INSTALL_SBINDIR}
54 ADD_DEFINITIONS(-DDISABLE_INIT)
56 ADD_EXECUTABLE(init initd/init.c initd/early.c initd/preinit.c initd/mkdev.c watchdog.c
57 utils/utils.c ${SOURCES_ZRAM})
58 TARGET_LINK_LIBRARIES(init ${LIBS})
60 RUNTIME DESTINATION ${CMAKE_INSTALL_SBINDIR}
63 ADD_EXECUTABLE(udevtrigger plug/udevtrigger.c)
64 INSTALL(TARGETS udevtrigger
65 RUNTIME DESTINATION ${CMAKE_INSTALL_SBINDIR}
70 ADD_EXECUTABLE(askfirst utils/askfirst.c)
71 INSTALL(TARGETS askfirst
72 RUNTIME DESTINATION ${CMAKE_INSTALL_SBINDIR}
76 OUTPUT syscall-names.h
77 COMMAND ./make_syscall_h.sh ${CMAKE_C_COMPILER} > ./syscall-names.h
78 DEPENDS ./make_syscall_h.sh
80 ADD_CUSTOM_TARGET(syscall-names-h DEPENDS syscall-names.h)
83 OUTPUT capabilities-names.h
84 COMMAND ./make_capabilities_h.sh ${CMAKE_C_COMPILER} > ./capabilities-names.h
85 DEPENDS ./make_capabilities_h.sh
87 ADD_CUSTOM_TARGET(capabilities-names-h DEPENDS capabilities-names.h)
90 ADD_LIBRARY(preload-seccomp SHARED jail/preload.c jail/seccomp.c)
91 TARGET_LINK_LIBRARIES(preload-seccomp dl ubox blobmsg_json)
92 INSTALL(TARGETS preload-seccomp
93 LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
95 ADD_DEPENDENCIES(preload-seccomp syscall-names-h)
99 ADD_EXECUTABLE(ujail jail/jail.c jail/elf.c jail/fs.c jail/capabilities.c)
100 TARGET_LINK_LIBRARIES(ujail ubox blobmsg_json)
101 INSTALL(TARGETS ujail
102 RUNTIME DESTINATION ${CMAKE_INSTALL_SBINDIR}
104 ADD_DEPENDENCIES(ujail capabilities-names-h)
108 ADD_EXECUTABLE(utrace trace/trace.c)
109 TARGET_LINK_LIBRARIES(utrace ubox ${json} blobmsg_json)
110 INSTALL(TARGETS utrace
111 RUNTIME DESTINATION ${CMAKE_INSTALL_SBINDIR}
113 ADD_DEPENDENCIES(utrace syscall-names-h)
115 ADD_LIBRARY(preload-trace SHARED trace/preload.c)
116 TARGET_LINK_LIBRARIES(preload-trace dl)
117 INSTALL(TARGETS preload-trace
118 LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}