2023-04-08 15:01:26 +00:00
|
|
|
function(luna_app SOURCE_FILE APP_NAME SETUID)
|
2022-12-23 12:09:21 +00:00
|
|
|
add_executable(${APP_NAME} ${SOURCE_FILE})
|
2023-04-07 10:02:49 +00:00
|
|
|
target_compile_options(${APP_NAME} PRIVATE -Os ${COMMON_FLAGS} -Wno-write-strings)
|
2023-01-06 12:31:14 +00:00
|
|
|
add_dependencies(${APP_NAME} libc)
|
2023-01-06 23:21:08 +00:00
|
|
|
target_include_directories(${APP_NAME} PRIVATE ${LUNA_BASE}/usr/include)
|
2023-04-08 12:47:58 +00:00
|
|
|
target_link_libraries(${APP_NAME} PRIVATE os)
|
2023-04-08 15:01:26 +00:00
|
|
|
if(${SETUID})
|
|
|
|
install(TARGETS ${APP_NAME} DESTINATION ${LUNA_ROOT}/initrd/bin PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE SETUID)
|
|
|
|
else()
|
|
|
|
install(TARGETS ${APP_NAME} DESTINATION ${LUNA_ROOT}/initrd/bin)
|
|
|
|
endif()
|
2022-12-23 12:09:21 +00:00
|
|
|
endfunction()
|
|
|
|
|
2023-04-08 15:01:26 +00:00
|
|
|
luna_app(init.cpp init OFF)
|
|
|
|
luna_app(env.cpp env OFF)
|
|
|
|
luna_app(su.cpp su ON)
|
|
|
|
luna_app(sh.cpp sh OFF)
|
|
|
|
luna_app(cat.cpp cat OFF)
|
|
|
|
luna_app(date.cpp date OFF)
|
|
|
|
luna_app(edit.cpp edit OFF)
|
|
|
|
luna_app(ls.cpp ls OFF)
|
|
|
|
luna_app(chown.cpp chown OFF)
|
|
|
|
luna_app(chmod.cpp chmod OFF)
|
|
|
|
luna_app(mkdir.cpp mkdir OFF)
|
2023-04-12 16:11:43 +00:00
|
|
|
luna_app(rm.cpp rm OFF)
|
2023-04-21 16:04:17 +00:00
|
|
|
luna_app(stat.cpp stat OFF)
|
2023-04-24 19:02:04 +00:00
|
|
|
luna_app(uname.cpp uname OFF)
|