From 140910763eb6a55f29d76181d81d9891aa89d3a4 Mon Sep 17 00:00:00 2001 From: apio Date: Sun, 21 Jul 2024 13:24:46 +0200 Subject: [PATCH] all: Reorder directory structure Why are command-line utilities stored in "apps"? And why are apps like "editor" or "terminal" top-level directories? Command-line utilities now go in "utils". GUI stuff now goes in "gui". This includes: libui -> gui/libui, wind -> gui/wind, GUI apps -> gui/apps, editor&terminal -> gui/apps... System services go in "system". --- CMakeLists.txt | 8 +-- apps/CMakeLists.txt | 56 ------------------- docs/boot_process.md | 6 +- gui/CMakeLists.txt | 15 +++++ {apps => gui/apps}/2048.cpp | 0 gui/apps/CMakeLists.txt | 17 ++++++ {apps => gui/apps}/about.cpp | 0 {apps => gui/apps}/clock.cpp | 0 {editor => gui/apps/editor}/CMakeLists.txt | 0 {editor => gui/apps/editor}/EditorWidget.cpp | 0 {editor => gui/apps/editor}/EditorWidget.h | 0 {editor => gui/apps/editor}/main.cpp | 0 {apps => gui/apps}/gol.cpp | 0 {apps => gui/apps}/taskbar.cpp | 0 .../apps/terminal}/CMakeLists.txt | 0 .../apps/terminal}/TerminalWidget.cpp | 0 .../apps/terminal}/TerminalWidget.h | 0 {terminal => gui/apps/terminal}/main.cpp | 0 {apps => gui}/launch.cpp | 0 {libui => gui/libui}/CMakeLists.txt | 0 {libui => gui/libui}/include/ui/Alignment.h | 0 {libui => gui/libui}/include/ui/App.h | 0 {libui => gui/libui}/include/ui/Button.h | 0 {libui => gui/libui}/include/ui/Canvas.h | 0 {libui => gui/libui}/include/ui/Color.h | 0 {libui => gui/libui}/include/ui/Container.h | 0 {libui => gui/libui}/include/ui/Font.h | 0 {libui => gui/libui}/include/ui/Image.h | 0 {libui => gui/libui}/include/ui/InputField.h | 0 {libui => gui/libui}/include/ui/Key.h | 0 {libui => gui/libui}/include/ui/Label.h | 0 {libui => gui/libui}/include/ui/Layout.h | 0 {libui => gui/libui}/include/ui/Mouse.h | 0 {libui => gui/libui}/include/ui/Point.h | 0 {libui => gui/libui}/include/ui/Rect.h | 0 {libui => gui/libui}/include/ui/TextInput.h | 0 {libui => gui/libui}/include/ui/Widget.h | 0 {libui => gui/libui}/include/ui/Window.h | 0 {libui => gui/libui}/include/ui/ipc/Client.h | 0 {libui => gui/libui}/include/ui/ipc/Server.h | 0 {libui => gui/libui}/src/Alignment.cpp | 0 {libui => gui/libui}/src/App.cpp | 0 {libui => gui/libui}/src/Button.cpp | 0 {libui => gui/libui}/src/Canvas.cpp | 0 {libui => gui/libui}/src/Container.cpp | 0 {libui => gui/libui}/src/Font.cpp | 0 {libui => gui/libui}/src/Image.cpp | 0 {libui => gui/libui}/src/InputField.cpp | 0 {libui => gui/libui}/src/Label.cpp | 0 {libui => gui/libui}/src/Layout.cpp | 0 {libui => gui/libui}/src/Rect.cpp | 0 {libui => gui/libui}/src/TextInput.cpp | 0 {libui => gui/libui}/src/Window.cpp | 0 {apps => gui}/run.cpp | 0 {wind => gui/wind}/CMakeLists.txt | 0 {wind => gui/wind}/Client.h | 0 {wind => gui/wind}/IPC.cpp | 0 {wind => gui/wind}/IPC.h | 0 {wind => gui/wind}/Keyboard.cpp | 0 {wind => gui/wind}/Keyboard.h | 0 {wind => gui/wind}/Mouse.cpp | 0 {wind => gui/wind}/Mouse.h | 0 {wind => gui/wind}/Screen.cpp | 0 {wind => gui/wind}/Screen.h | 0 {wind => gui/wind}/Window.cpp | 0 {wind => gui/wind}/Window.h | 0 {wind => gui/wind}/main.cpp | 0 system/CMakeLists.txt | 17 ++++++ {apps => system}/init.cpp | 0 {apps => system}/preinit.cpp | 0 {apps => system}/startui.cpp | 0 tools/install-headers.sh | 2 +- utils/CMakeLists.txt | 36 ++++++++++++ {apps => utils}/arch.cpp | 0 {apps => utils}/base64.cpp | 0 {apps => utils}/cat.cpp | 0 {apps => utils}/chmod.cpp | 0 {apps => utils}/chown.cpp | 0 {apps => utils}/cp.cpp | 0 {apps => utils}/date.cpp | 0 {apps => utils}/edit.cpp | 0 {apps => utils}/env.cpp | 0 {apps => utils}/free.cpp | 0 {apps => utils}/kill.cpp | 0 {apps => utils}/ln.cpp | 0 {apps => utils}/login.cpp | 0 {apps => utils}/ls.cpp | 0 {apps => utils}/mkdir.cpp | 0 {apps => utils}/mktemp.cpp | 0 {apps => utils}/mount.cpp | 0 {apps => utils}/ps.cpp | 0 {apps => utils}/rm.cpp | 0 {apps => utils}/sha256sum.cpp | 0 {apps => utils}/stat.cpp | 0 {apps => utils}/su.cpp | 0 {apps => utils}/sysfuzz.cpp | 0 {apps => utils}/time.cpp | 0 {apps => utils}/touch.cpp | 0 {apps => utils}/umount.cpp | 0 {apps => utils}/uname.cpp | 0 100 files changed, 92 insertions(+), 65 deletions(-) delete mode 100644 apps/CMakeLists.txt create mode 100644 gui/CMakeLists.txt rename {apps => gui/apps}/2048.cpp (100%) create mode 100644 gui/apps/CMakeLists.txt rename {apps => gui/apps}/about.cpp (100%) rename {apps => gui/apps}/clock.cpp (100%) rename {editor => gui/apps/editor}/CMakeLists.txt (100%) rename {editor => gui/apps/editor}/EditorWidget.cpp (100%) rename {editor => gui/apps/editor}/EditorWidget.h (100%) rename {editor => gui/apps/editor}/main.cpp (100%) rename {apps => gui/apps}/gol.cpp (100%) rename {apps => gui/apps}/taskbar.cpp (100%) rename {terminal => gui/apps/terminal}/CMakeLists.txt (100%) rename {terminal => gui/apps/terminal}/TerminalWidget.cpp (100%) rename {terminal => gui/apps/terminal}/TerminalWidget.h (100%) rename {terminal => gui/apps/terminal}/main.cpp (100%) rename {apps => gui}/launch.cpp (100%) rename {libui => gui/libui}/CMakeLists.txt (100%) rename {libui => gui/libui}/include/ui/Alignment.h (100%) rename {libui => gui/libui}/include/ui/App.h (100%) rename {libui => gui/libui}/include/ui/Button.h (100%) rename {libui => gui/libui}/include/ui/Canvas.h (100%) rename {libui => gui/libui}/include/ui/Color.h (100%) rename {libui => gui/libui}/include/ui/Container.h (100%) rename {libui => gui/libui}/include/ui/Font.h (100%) rename {libui => gui/libui}/include/ui/Image.h (100%) rename {libui => gui/libui}/include/ui/InputField.h (100%) rename {libui => gui/libui}/include/ui/Key.h (100%) rename {libui => gui/libui}/include/ui/Label.h (100%) rename {libui => gui/libui}/include/ui/Layout.h (100%) rename {libui => gui/libui}/include/ui/Mouse.h (100%) rename {libui => gui/libui}/include/ui/Point.h (100%) rename {libui => gui/libui}/include/ui/Rect.h (100%) rename {libui => gui/libui}/include/ui/TextInput.h (100%) rename {libui => gui/libui}/include/ui/Widget.h (100%) rename {libui => gui/libui}/include/ui/Window.h (100%) rename {libui => gui/libui}/include/ui/ipc/Client.h (100%) rename {libui => gui/libui}/include/ui/ipc/Server.h (100%) rename {libui => gui/libui}/src/Alignment.cpp (100%) rename {libui => gui/libui}/src/App.cpp (100%) rename {libui => gui/libui}/src/Button.cpp (100%) rename {libui => gui/libui}/src/Canvas.cpp (100%) rename {libui => gui/libui}/src/Container.cpp (100%) rename {libui => gui/libui}/src/Font.cpp (100%) rename {libui => gui/libui}/src/Image.cpp (100%) rename {libui => gui/libui}/src/InputField.cpp (100%) rename {libui => gui/libui}/src/Label.cpp (100%) rename {libui => gui/libui}/src/Layout.cpp (100%) rename {libui => gui/libui}/src/Rect.cpp (100%) rename {libui => gui/libui}/src/TextInput.cpp (100%) rename {libui => gui/libui}/src/Window.cpp (100%) rename {apps => gui}/run.cpp (100%) rename {wind => gui/wind}/CMakeLists.txt (100%) rename {wind => gui/wind}/Client.h (100%) rename {wind => gui/wind}/IPC.cpp (100%) rename {wind => gui/wind}/IPC.h (100%) rename {wind => gui/wind}/Keyboard.cpp (100%) rename {wind => gui/wind}/Keyboard.h (100%) rename {wind => gui/wind}/Mouse.cpp (100%) rename {wind => gui/wind}/Mouse.h (100%) rename {wind => gui/wind}/Screen.cpp (100%) rename {wind => gui/wind}/Screen.h (100%) rename {wind => gui/wind}/Window.cpp (100%) rename {wind => gui/wind}/Window.h (100%) rename {wind => gui/wind}/main.cpp (100%) create mode 100644 system/CMakeLists.txt rename {apps => system}/init.cpp (100%) rename {apps => system}/preinit.cpp (100%) rename {apps => system}/startui.cpp (100%) create mode 100644 utils/CMakeLists.txt rename {apps => utils}/arch.cpp (100%) rename {apps => utils}/base64.cpp (100%) rename {apps => utils}/cat.cpp (100%) rename {apps => utils}/chmod.cpp (100%) rename {apps => utils}/chown.cpp (100%) rename {apps => utils}/cp.cpp (100%) rename {apps => utils}/date.cpp (100%) rename {apps => utils}/edit.cpp (100%) rename {apps => utils}/env.cpp (100%) rename {apps => utils}/free.cpp (100%) rename {apps => utils}/kill.cpp (100%) rename {apps => utils}/ln.cpp (100%) rename {apps => utils}/login.cpp (100%) rename {apps => utils}/ls.cpp (100%) rename {apps => utils}/mkdir.cpp (100%) rename {apps => utils}/mktemp.cpp (100%) rename {apps => utils}/mount.cpp (100%) rename {apps => utils}/ps.cpp (100%) rename {apps => utils}/rm.cpp (100%) rename {apps => utils}/sha256sum.cpp (100%) rename {apps => utils}/stat.cpp (100%) rename {apps => utils}/su.cpp (100%) rename {apps => utils}/sysfuzz.cpp (100%) rename {apps => utils}/time.cpp (100%) rename {apps => utils}/touch.cpp (100%) rename {apps => utils}/umount.cpp (100%) rename {apps => utils}/uname.cpp (100%) diff --git a/CMakeLists.txt b/CMakeLists.txt index 2a2b2c74..ca9d2fd9 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -45,12 +45,10 @@ endif() add_subdirectory(libluna) add_subdirectory(libos) -add_subdirectory(libui) +add_subdirectory(gui) add_subdirectory(libc) add_subdirectory(kernel) -add_subdirectory(apps) +add_subdirectory(utils) add_subdirectory(tests) add_subdirectory(shell) -add_subdirectory(wind) -add_subdirectory(terminal) -add_subdirectory(editor) +add_subdirectory(system) diff --git a/apps/CMakeLists.txt b/apps/CMakeLists.txt deleted file mode 100644 index fe237afd..00000000 --- a/apps/CMakeLists.txt +++ /dev/null @@ -1,56 +0,0 @@ -function(luna_app SOURCE_FILE APP_NAME) - add_executable(${APP_NAME} ${SOURCE_FILE}) - target_compile_options(${APP_NAME} PRIVATE -Os ${COMMON_FLAGS} -Wno-write-strings) - add_dependencies(${APP_NAME} libc) - target_include_directories(${APP_NAME} PRIVATE ${LUNA_BASE}/usr/include) - target_link_libraries(${APP_NAME} PRIVATE os) - install(TARGETS ${APP_NAME} DESTINATION ${LUNA_BASE}/usr/bin) -endfunction() - -add_executable(preinit preinit.cpp) -target_compile_options(preinit PRIVATE -Os ${COMMON_FLAGS} -Wno-write-strings) -add_dependencies(preinit libc) -target_include_directories(preinit PRIVATE ${LUNA_BASE}/usr/include) -install(TARGETS preinit DESTINATION ${LUNA_ROOT}/initrd/bin) - -luna_app(init.cpp init) -luna_app(env.cpp env) -luna_app(su.cpp su) -luna_app(cat.cpp cat) -luna_app(date.cpp date) -luna_app(edit.cpp edit) -luna_app(ls.cpp ls) -luna_app(chown.cpp chown) -luna_app(chmod.cpp chmod) -luna_app(mkdir.cpp mkdir) -luna_app(rm.cpp rm) -luna_app(stat.cpp stat) -luna_app(uname.cpp uname) -luna_app(base64.cpp base64) -luna_app(login.cpp login) -luna_app(mount.cpp mount) -luna_app(umount.cpp umount) -luna_app(ps.cpp ps) -luna_app(time.cpp time) -luna_app(ln.cpp ln) -luna_app(mktemp.cpp mktemp) -luna_app(sysfuzz.cpp sysfuzz) -luna_app(cp.cpp cp) -luna_app(kill.cpp kill) -luna_app(gol.cpp gol) -target_link_libraries(gol PUBLIC ui) -luna_app(touch.cpp touch) -luna_app(free.cpp free) -luna_app(about.cpp about) -target_link_libraries(about PUBLIC ui) -luna_app(taskbar.cpp taskbar) -target_link_libraries(taskbar PUBLIC ui) -luna_app(2048.cpp 2048) -target_link_libraries(2048 PUBLIC ui) -luna_app(clock.cpp clock) -target_link_libraries(clock PUBLIC ui) -luna_app(startui.cpp startui) -luna_app(launch.cpp launch) -luna_app(run.cpp run) -luna_app(sha256sum.cpp sha256sum) -luna_app(arch.cpp arch) diff --git a/docs/boot_process.md b/docs/boot_process.md index 3763b246..c112ddc3 100644 --- a/docs/boot_process.md +++ b/docs/boot_process.md @@ -90,7 +90,7 @@ After the kernel stage of the boot process, the system looks like this: ``` ## Stage 2: preinit -_Relevant files: [apps/preinit.cpp](../apps/preinit.cpp)_ +_Relevant files: [system/preinit.cpp](../system/preinit.cpp)_ Luna's userspace init process is split into two programs: `/bin/preinit`, which resides on the initial ramdisk, and `/usr/bin/init`, which resides on the root partition. @@ -133,7 +133,7 @@ After the preinit stage of the boot process, the system looks like this: ``` ## Stage 3: init -_Relevant files: [apps/init.cpp](../apps/init.cpp#L406)_ +_Relevant files: [system/init.cpp](../system/init.cpp#L406)_ `/usr/bin/init` is the actual init system. It is in charge of starting user-defined services. @@ -178,7 +178,7 @@ After the init stage of the boot process, the system looks like this: _Note: startui is PID 13 because the `00-home` service is a shell script, which starts a few subprocesses. Since Luna does not allow for PID reuse right now, startui ends up with PID 13._ ## Stage 4: startui -_Relevant files: [apps/startui.cpp](../apps/startui.cpp), [wind/main.cpp](../wind/main.cpp)_ +_Relevant files: [system/startui.cpp](../system/startui.cpp), [gui/wind/main.cpp](../gui/wind/main.cpp)_ `/usr/bin/startui` starts a graphical user session. diff --git a/gui/CMakeLists.txt b/gui/CMakeLists.txt new file mode 100644 index 00000000..3340e4e8 --- /dev/null +++ b/gui/CMakeLists.txt @@ -0,0 +1,15 @@ +function(luna_service SOURCE_FILE APP_NAME) + add_executable(${APP_NAME} ${SOURCE_FILE}) + target_compile_options(${APP_NAME} PRIVATE -Os ${COMMON_FLAGS} -Wno-write-strings) + add_dependencies(${APP_NAME} libc) + target_include_directories(${APP_NAME} PRIVATE ${LUNA_BASE}/usr/include) + target_link_libraries(${APP_NAME} PRIVATE os) + install(TARGETS ${APP_NAME} DESTINATION ${LUNA_BASE}/usr/bin) +endfunction() + +add_subdirectory(libui) +add_subdirectory(wind) +add_subdirectory(apps) + +luna_service(launch.cpp launch) +luna_service(run.cpp run) diff --git a/apps/2048.cpp b/gui/apps/2048.cpp similarity index 100% rename from apps/2048.cpp rename to gui/apps/2048.cpp diff --git a/gui/apps/CMakeLists.txt b/gui/apps/CMakeLists.txt new file mode 100644 index 00000000..2d854e1b --- /dev/null +++ b/gui/apps/CMakeLists.txt @@ -0,0 +1,17 @@ +function(luna_app SOURCE_FILE APP_NAME) + add_executable(${APP_NAME} ${SOURCE_FILE}) + target_compile_options(${APP_NAME} PRIVATE -Os ${COMMON_FLAGS} -Wno-write-strings) + add_dependencies(${APP_NAME} libc) + target_include_directories(${APP_NAME} PRIVATE ${LUNA_BASE}/usr/include) + target_link_libraries(${APP_NAME} PRIVATE os ui) + install(TARGETS ${APP_NAME} DESTINATION ${LUNA_BASE}/usr/bin) +endfunction() + +luna_app(about.cpp about) +luna_app(taskbar.cpp taskbar) +luna_app(2048.cpp 2048) +luna_app(clock.cpp clock) +luna_app(gol.cpp gol) + +add_subdirectory(editor) +add_subdirectory(terminal) diff --git a/apps/about.cpp b/gui/apps/about.cpp similarity index 100% rename from apps/about.cpp rename to gui/apps/about.cpp diff --git a/apps/clock.cpp b/gui/apps/clock.cpp similarity index 100% rename from apps/clock.cpp rename to gui/apps/clock.cpp diff --git a/editor/CMakeLists.txt b/gui/apps/editor/CMakeLists.txt similarity index 100% rename from editor/CMakeLists.txt rename to gui/apps/editor/CMakeLists.txt diff --git a/editor/EditorWidget.cpp b/gui/apps/editor/EditorWidget.cpp similarity index 100% rename from editor/EditorWidget.cpp rename to gui/apps/editor/EditorWidget.cpp diff --git a/editor/EditorWidget.h b/gui/apps/editor/EditorWidget.h similarity index 100% rename from editor/EditorWidget.h rename to gui/apps/editor/EditorWidget.h diff --git a/editor/main.cpp b/gui/apps/editor/main.cpp similarity index 100% rename from editor/main.cpp rename to gui/apps/editor/main.cpp diff --git a/apps/gol.cpp b/gui/apps/gol.cpp similarity index 100% rename from apps/gol.cpp rename to gui/apps/gol.cpp diff --git a/apps/taskbar.cpp b/gui/apps/taskbar.cpp similarity index 100% rename from apps/taskbar.cpp rename to gui/apps/taskbar.cpp diff --git a/terminal/CMakeLists.txt b/gui/apps/terminal/CMakeLists.txt similarity index 100% rename from terminal/CMakeLists.txt rename to gui/apps/terminal/CMakeLists.txt diff --git a/terminal/TerminalWidget.cpp b/gui/apps/terminal/TerminalWidget.cpp similarity index 100% rename from terminal/TerminalWidget.cpp rename to gui/apps/terminal/TerminalWidget.cpp diff --git a/terminal/TerminalWidget.h b/gui/apps/terminal/TerminalWidget.h similarity index 100% rename from terminal/TerminalWidget.h rename to gui/apps/terminal/TerminalWidget.h diff --git a/terminal/main.cpp b/gui/apps/terminal/main.cpp similarity index 100% rename from terminal/main.cpp rename to gui/apps/terminal/main.cpp diff --git a/apps/launch.cpp b/gui/launch.cpp similarity index 100% rename from apps/launch.cpp rename to gui/launch.cpp diff --git a/libui/CMakeLists.txt b/gui/libui/CMakeLists.txt similarity index 100% rename from libui/CMakeLists.txt rename to gui/libui/CMakeLists.txt diff --git a/libui/include/ui/Alignment.h b/gui/libui/include/ui/Alignment.h similarity index 100% rename from libui/include/ui/Alignment.h rename to gui/libui/include/ui/Alignment.h diff --git a/libui/include/ui/App.h b/gui/libui/include/ui/App.h similarity index 100% rename from libui/include/ui/App.h rename to gui/libui/include/ui/App.h diff --git a/libui/include/ui/Button.h b/gui/libui/include/ui/Button.h similarity index 100% rename from libui/include/ui/Button.h rename to gui/libui/include/ui/Button.h diff --git a/libui/include/ui/Canvas.h b/gui/libui/include/ui/Canvas.h similarity index 100% rename from libui/include/ui/Canvas.h rename to gui/libui/include/ui/Canvas.h diff --git a/libui/include/ui/Color.h b/gui/libui/include/ui/Color.h similarity index 100% rename from libui/include/ui/Color.h rename to gui/libui/include/ui/Color.h diff --git a/libui/include/ui/Container.h b/gui/libui/include/ui/Container.h similarity index 100% rename from libui/include/ui/Container.h rename to gui/libui/include/ui/Container.h diff --git a/libui/include/ui/Font.h b/gui/libui/include/ui/Font.h similarity index 100% rename from libui/include/ui/Font.h rename to gui/libui/include/ui/Font.h diff --git a/libui/include/ui/Image.h b/gui/libui/include/ui/Image.h similarity index 100% rename from libui/include/ui/Image.h rename to gui/libui/include/ui/Image.h diff --git a/libui/include/ui/InputField.h b/gui/libui/include/ui/InputField.h similarity index 100% rename from libui/include/ui/InputField.h rename to gui/libui/include/ui/InputField.h diff --git a/libui/include/ui/Key.h b/gui/libui/include/ui/Key.h similarity index 100% rename from libui/include/ui/Key.h rename to gui/libui/include/ui/Key.h diff --git a/libui/include/ui/Label.h b/gui/libui/include/ui/Label.h similarity index 100% rename from libui/include/ui/Label.h rename to gui/libui/include/ui/Label.h diff --git a/libui/include/ui/Layout.h b/gui/libui/include/ui/Layout.h similarity index 100% rename from libui/include/ui/Layout.h rename to gui/libui/include/ui/Layout.h diff --git a/libui/include/ui/Mouse.h b/gui/libui/include/ui/Mouse.h similarity index 100% rename from libui/include/ui/Mouse.h rename to gui/libui/include/ui/Mouse.h diff --git a/libui/include/ui/Point.h b/gui/libui/include/ui/Point.h similarity index 100% rename from libui/include/ui/Point.h rename to gui/libui/include/ui/Point.h diff --git a/libui/include/ui/Rect.h b/gui/libui/include/ui/Rect.h similarity index 100% rename from libui/include/ui/Rect.h rename to gui/libui/include/ui/Rect.h diff --git a/libui/include/ui/TextInput.h b/gui/libui/include/ui/TextInput.h similarity index 100% rename from libui/include/ui/TextInput.h rename to gui/libui/include/ui/TextInput.h diff --git a/libui/include/ui/Widget.h b/gui/libui/include/ui/Widget.h similarity index 100% rename from libui/include/ui/Widget.h rename to gui/libui/include/ui/Widget.h diff --git a/libui/include/ui/Window.h b/gui/libui/include/ui/Window.h similarity index 100% rename from libui/include/ui/Window.h rename to gui/libui/include/ui/Window.h diff --git a/libui/include/ui/ipc/Client.h b/gui/libui/include/ui/ipc/Client.h similarity index 100% rename from libui/include/ui/ipc/Client.h rename to gui/libui/include/ui/ipc/Client.h diff --git a/libui/include/ui/ipc/Server.h b/gui/libui/include/ui/ipc/Server.h similarity index 100% rename from libui/include/ui/ipc/Server.h rename to gui/libui/include/ui/ipc/Server.h diff --git a/libui/src/Alignment.cpp b/gui/libui/src/Alignment.cpp similarity index 100% rename from libui/src/Alignment.cpp rename to gui/libui/src/Alignment.cpp diff --git a/libui/src/App.cpp b/gui/libui/src/App.cpp similarity index 100% rename from libui/src/App.cpp rename to gui/libui/src/App.cpp diff --git a/libui/src/Button.cpp b/gui/libui/src/Button.cpp similarity index 100% rename from libui/src/Button.cpp rename to gui/libui/src/Button.cpp diff --git a/libui/src/Canvas.cpp b/gui/libui/src/Canvas.cpp similarity index 100% rename from libui/src/Canvas.cpp rename to gui/libui/src/Canvas.cpp diff --git a/libui/src/Container.cpp b/gui/libui/src/Container.cpp similarity index 100% rename from libui/src/Container.cpp rename to gui/libui/src/Container.cpp diff --git a/libui/src/Font.cpp b/gui/libui/src/Font.cpp similarity index 100% rename from libui/src/Font.cpp rename to gui/libui/src/Font.cpp diff --git a/libui/src/Image.cpp b/gui/libui/src/Image.cpp similarity index 100% rename from libui/src/Image.cpp rename to gui/libui/src/Image.cpp diff --git a/libui/src/InputField.cpp b/gui/libui/src/InputField.cpp similarity index 100% rename from libui/src/InputField.cpp rename to gui/libui/src/InputField.cpp diff --git a/libui/src/Label.cpp b/gui/libui/src/Label.cpp similarity index 100% rename from libui/src/Label.cpp rename to gui/libui/src/Label.cpp diff --git a/libui/src/Layout.cpp b/gui/libui/src/Layout.cpp similarity index 100% rename from libui/src/Layout.cpp rename to gui/libui/src/Layout.cpp diff --git a/libui/src/Rect.cpp b/gui/libui/src/Rect.cpp similarity index 100% rename from libui/src/Rect.cpp rename to gui/libui/src/Rect.cpp diff --git a/libui/src/TextInput.cpp b/gui/libui/src/TextInput.cpp similarity index 100% rename from libui/src/TextInput.cpp rename to gui/libui/src/TextInput.cpp diff --git a/libui/src/Window.cpp b/gui/libui/src/Window.cpp similarity index 100% rename from libui/src/Window.cpp rename to gui/libui/src/Window.cpp diff --git a/apps/run.cpp b/gui/run.cpp similarity index 100% rename from apps/run.cpp rename to gui/run.cpp diff --git a/wind/CMakeLists.txt b/gui/wind/CMakeLists.txt similarity index 100% rename from wind/CMakeLists.txt rename to gui/wind/CMakeLists.txt diff --git a/wind/Client.h b/gui/wind/Client.h similarity index 100% rename from wind/Client.h rename to gui/wind/Client.h diff --git a/wind/IPC.cpp b/gui/wind/IPC.cpp similarity index 100% rename from wind/IPC.cpp rename to gui/wind/IPC.cpp diff --git a/wind/IPC.h b/gui/wind/IPC.h similarity index 100% rename from wind/IPC.h rename to gui/wind/IPC.h diff --git a/wind/Keyboard.cpp b/gui/wind/Keyboard.cpp similarity index 100% rename from wind/Keyboard.cpp rename to gui/wind/Keyboard.cpp diff --git a/wind/Keyboard.h b/gui/wind/Keyboard.h similarity index 100% rename from wind/Keyboard.h rename to gui/wind/Keyboard.h diff --git a/wind/Mouse.cpp b/gui/wind/Mouse.cpp similarity index 100% rename from wind/Mouse.cpp rename to gui/wind/Mouse.cpp diff --git a/wind/Mouse.h b/gui/wind/Mouse.h similarity index 100% rename from wind/Mouse.h rename to gui/wind/Mouse.h diff --git a/wind/Screen.cpp b/gui/wind/Screen.cpp similarity index 100% rename from wind/Screen.cpp rename to gui/wind/Screen.cpp diff --git a/wind/Screen.h b/gui/wind/Screen.h similarity index 100% rename from wind/Screen.h rename to gui/wind/Screen.h diff --git a/wind/Window.cpp b/gui/wind/Window.cpp similarity index 100% rename from wind/Window.cpp rename to gui/wind/Window.cpp diff --git a/wind/Window.h b/gui/wind/Window.h similarity index 100% rename from wind/Window.h rename to gui/wind/Window.h diff --git a/wind/main.cpp b/gui/wind/main.cpp similarity index 100% rename from wind/main.cpp rename to gui/wind/main.cpp diff --git a/system/CMakeLists.txt b/system/CMakeLists.txt new file mode 100644 index 00000000..eaaf00c7 --- /dev/null +++ b/system/CMakeLists.txt @@ -0,0 +1,17 @@ +function(luna_service SOURCE_FILE APP_NAME) + add_executable(${APP_NAME} ${SOURCE_FILE}) + target_compile_options(${APP_NAME} PRIVATE -Os ${COMMON_FLAGS} -Wno-write-strings) + add_dependencies(${APP_NAME} libc) + target_include_directories(${APP_NAME} PRIVATE ${LUNA_BASE}/usr/include) + target_link_libraries(${APP_NAME} PRIVATE os) + install(TARGETS ${APP_NAME} DESTINATION ${LUNA_BASE}/usr/bin) +endfunction() + +add_executable(preinit preinit.cpp) +target_compile_options(preinit PRIVATE -Os ${COMMON_FLAGS} -Wno-write-strings) +add_dependencies(preinit libc) +target_include_directories(preinit PRIVATE ${LUNA_BASE}/usr/include) +install(TARGETS preinit DESTINATION ${LUNA_ROOT}/initrd/bin) + +luna_service(init.cpp init) +luna_service(startui.cpp startui) diff --git a/apps/init.cpp b/system/init.cpp similarity index 100% rename from apps/init.cpp rename to system/init.cpp diff --git a/apps/preinit.cpp b/system/preinit.cpp similarity index 100% rename from apps/preinit.cpp rename to system/preinit.cpp diff --git a/apps/startui.cpp b/system/startui.cpp similarity index 100% rename from apps/startui.cpp rename to system/startui.cpp diff --git a/tools/install-headers.sh b/tools/install-headers.sh index 999936d2..86bfe4e7 100755 --- a/tools/install-headers.sh +++ b/tools/install-headers.sh @@ -14,6 +14,6 @@ mkdir -p $LUNA_BASE/usr/include/moon cp --preserve=timestamps -RT libc/include/ $LUNA_BASE/usr/include cp --preserve=timestamps -RT libluna/include/luna/ $LUNA_BASE/usr/include/luna -cp --preserve=timestamps -RT libui/include/ui/ $LUNA_BASE/usr/include/ui +cp --preserve=timestamps -RT gui/libui/include/ui/ $LUNA_BASE/usr/include/ui cp --preserve=timestamps -RT libos/include/os/ $LUNA_BASE/usr/include/os cp --preserve=timestamps -RT kernel/src/api/ $LUNA_BASE/usr/include/moon diff --git a/utils/CMakeLists.txt b/utils/CMakeLists.txt new file mode 100644 index 00000000..5d3ee319 --- /dev/null +++ b/utils/CMakeLists.txt @@ -0,0 +1,36 @@ +function(luna_utility SOURCE_FILE APP_NAME) + add_executable(${APP_NAME} ${SOURCE_FILE}) + target_compile_options(${APP_NAME} PRIVATE -Os ${COMMON_FLAGS} -Wno-write-strings) + add_dependencies(${APP_NAME} libc) + target_include_directories(${APP_NAME} PRIVATE ${LUNA_BASE}/usr/include) + target_link_libraries(${APP_NAME} PRIVATE os) + install(TARGETS ${APP_NAME} DESTINATION ${LUNA_BASE}/usr/bin) +endfunction() + +luna_utility(env.cpp env) +luna_utility(su.cpp su) +luna_utility(cat.cpp cat) +luna_utility(date.cpp date) +luna_utility(edit.cpp edit) +luna_utility(ls.cpp ls) +luna_utility(chown.cpp chown) +luna_utility(chmod.cpp chmod) +luna_utility(mkdir.cpp mkdir) +luna_utility(rm.cpp rm) +luna_utility(stat.cpp stat) +luna_utility(uname.cpp uname) +luna_utility(base64.cpp base64) +luna_utility(login.cpp login) +luna_utility(mount.cpp mount) +luna_utility(umount.cpp umount) +luna_utility(ps.cpp ps) +luna_utility(time.cpp time) +luna_utility(ln.cpp ln) +luna_utility(mktemp.cpp mktemp) +luna_utility(sysfuzz.cpp sysfuzz) +luna_utility(cp.cpp cp) +luna_utility(kill.cpp kill) +luna_utility(touch.cpp touch) +luna_utility(free.cpp free) +luna_utility(sha256sum.cpp sha256sum) +luna_utility(arch.cpp arch) diff --git a/apps/arch.cpp b/utils/arch.cpp similarity index 100% rename from apps/arch.cpp rename to utils/arch.cpp diff --git a/apps/base64.cpp b/utils/base64.cpp similarity index 100% rename from apps/base64.cpp rename to utils/base64.cpp diff --git a/apps/cat.cpp b/utils/cat.cpp similarity index 100% rename from apps/cat.cpp rename to utils/cat.cpp diff --git a/apps/chmod.cpp b/utils/chmod.cpp similarity index 100% rename from apps/chmod.cpp rename to utils/chmod.cpp diff --git a/apps/chown.cpp b/utils/chown.cpp similarity index 100% rename from apps/chown.cpp rename to utils/chown.cpp diff --git a/apps/cp.cpp b/utils/cp.cpp similarity index 100% rename from apps/cp.cpp rename to utils/cp.cpp diff --git a/apps/date.cpp b/utils/date.cpp similarity index 100% rename from apps/date.cpp rename to utils/date.cpp diff --git a/apps/edit.cpp b/utils/edit.cpp similarity index 100% rename from apps/edit.cpp rename to utils/edit.cpp diff --git a/apps/env.cpp b/utils/env.cpp similarity index 100% rename from apps/env.cpp rename to utils/env.cpp diff --git a/apps/free.cpp b/utils/free.cpp similarity index 100% rename from apps/free.cpp rename to utils/free.cpp diff --git a/apps/kill.cpp b/utils/kill.cpp similarity index 100% rename from apps/kill.cpp rename to utils/kill.cpp diff --git a/apps/ln.cpp b/utils/ln.cpp similarity index 100% rename from apps/ln.cpp rename to utils/ln.cpp diff --git a/apps/login.cpp b/utils/login.cpp similarity index 100% rename from apps/login.cpp rename to utils/login.cpp diff --git a/apps/ls.cpp b/utils/ls.cpp similarity index 100% rename from apps/ls.cpp rename to utils/ls.cpp diff --git a/apps/mkdir.cpp b/utils/mkdir.cpp similarity index 100% rename from apps/mkdir.cpp rename to utils/mkdir.cpp diff --git a/apps/mktemp.cpp b/utils/mktemp.cpp similarity index 100% rename from apps/mktemp.cpp rename to utils/mktemp.cpp diff --git a/apps/mount.cpp b/utils/mount.cpp similarity index 100% rename from apps/mount.cpp rename to utils/mount.cpp diff --git a/apps/ps.cpp b/utils/ps.cpp similarity index 100% rename from apps/ps.cpp rename to utils/ps.cpp diff --git a/apps/rm.cpp b/utils/rm.cpp similarity index 100% rename from apps/rm.cpp rename to utils/rm.cpp diff --git a/apps/sha256sum.cpp b/utils/sha256sum.cpp similarity index 100% rename from apps/sha256sum.cpp rename to utils/sha256sum.cpp diff --git a/apps/stat.cpp b/utils/stat.cpp similarity index 100% rename from apps/stat.cpp rename to utils/stat.cpp diff --git a/apps/su.cpp b/utils/su.cpp similarity index 100% rename from apps/su.cpp rename to utils/su.cpp diff --git a/apps/sysfuzz.cpp b/utils/sysfuzz.cpp similarity index 100% rename from apps/sysfuzz.cpp rename to utils/sysfuzz.cpp diff --git a/apps/time.cpp b/utils/time.cpp similarity index 100% rename from apps/time.cpp rename to utils/time.cpp diff --git a/apps/touch.cpp b/utils/touch.cpp similarity index 100% rename from apps/touch.cpp rename to utils/touch.cpp diff --git a/apps/umount.cpp b/utils/umount.cpp similarity index 100% rename from apps/umount.cpp rename to utils/umount.cpp diff --git a/apps/uname.cpp b/utils/uname.cpp similarity index 100% rename from apps/uname.cpp rename to utils/uname.cpp