diff options
| author | Xavier Del Campo Romero <xavi92@disroot.org> | 2025-07-07 13:22:53 +0200 |
|---|---|---|
| committer | Xavier Del Campo Romero <xavi92@disroot.org> | 2025-07-25 14:16:41 +0200 |
| commit | 14f60e4fd65c42f126eaee7e09cb4251c167c6ed (patch) | |
| tree | 313b5e16d7d99cf1518c953e2efe5e5fc920dfbf /programs | |
| parent | 48a61c16eaa6dcfc75d00dba302537ce1492db98 (diff) | |
wiptty
Diffstat (limited to 'programs')
| -rw-r--r-- | programs/CMakeLists.txt | 32 | ||||
| -rw-r--r-- | programs/initd/CMakeLists.txt | 21 | ||||
| -rw-r--r-- | programs/initd/initd.c | 24 | ||||
| -rw-r--r-- | programs/wasi-sdk-toolchain.cmake | 19 | ||||
| -rw-r--r-- | programs/yes/CMakeLists.txt | 21 | ||||
| -rw-r--r-- | programs/yes/yes.c | 28 |
6 files changed, 145 insertions, 0 deletions
diff --git a/programs/CMakeLists.txt b/programs/CMakeLists.txt new file mode 100644 index 0000000..36ab64b --- /dev/null +++ b/programs/CMakeLists.txt @@ -0,0 +1,32 @@ +# wanix, a Unix-like operating system for WebAssembly applications. +# Copyright (C) 2025 Xavier Del Campo Romero +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see <https://www.gnu.org/licenses/>. + +set(programs + initd + yes +) + +include(ExternalProject) + +foreach(p ${programs}) + ExternalProject_Add(${p}_project + SOURCE_DIR ${CMAKE_CURRENT_LIST_DIR}/${p} + CMAKE_ARGS + -D CMAKE_TOOLCHAIN_FILE=${CMAKE_CURRENT_LIST_DIR}/wasi-sdk-toolchain.cmake + -D CMAKE_MODULE_PATH=${CMAKE_MODULE_PATH} + -D CMAKE_INSTALL_PREFIX=${cdroot} + ) +endforeach() diff --git a/programs/initd/CMakeLists.txt b/programs/initd/CMakeLists.txt new file mode 100644 index 0000000..39e19f5 --- /dev/null +++ b/programs/initd/CMakeLists.txt @@ -0,0 +1,21 @@ +# wanix, a Unix-like operating system for WebAssembly applications. +# Copyright (C) 2025 Xavier Del Campo Romero +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see <https://www.gnu.org/licenses/>. + +cmake_minimum_required(VERSION 3.13) +include(GNUInstallDirs) +project(initd C) +add_executable(${PROJECT_NAME} initd.c) +install(TARGETS ${PROJECT_NAME} DESTINATION ${CMAKE_INSTALL_BINDIR}) diff --git a/programs/initd/initd.c b/programs/initd/initd.c new file mode 100644 index 0000000..63685df --- /dev/null +++ b/programs/initd/initd.c @@ -0,0 +1,24 @@ +/* + * wanix, a Unix-like operating system for WebAssembly applications. + * Copyright (C) 2025 Xavier Del Campo Romero + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see <https://www.gnu.org/licenses/>. + */ + +#include <stdlib.h> + +int main(void) +{ + return EXIT_FAILURE; +} diff --git a/programs/wasi-sdk-toolchain.cmake b/programs/wasi-sdk-toolchain.cmake new file mode 100644 index 0000000..d29eedd --- /dev/null +++ b/programs/wasi-sdk-toolchain.cmake @@ -0,0 +1,19 @@ +# wanix, a Unix-like operating system for WebAssembly applications. +# Copyright (C) 2025 Xavier Del Campo Romero +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see <https://www.gnu.org/licenses/>. + +find_package(WASI_SDK REQUIRED) +set(CMAKE_C_COMPILER ${WASI_SDK_CLANG}) +set(CMAKE_C_COMPILER_WORKS 1) diff --git a/programs/yes/CMakeLists.txt b/programs/yes/CMakeLists.txt new file mode 100644 index 0000000..18c6e22 --- /dev/null +++ b/programs/yes/CMakeLists.txt @@ -0,0 +1,21 @@ +# wanix, a Unix-like operating system for WebAssembly applications. +# Copyright (C) 2025 Xavier Del Campo Romero +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see <https://www.gnu.org/licenses/>. + +cmake_minimum_required(VERSION 3.13) +include(GNUInstallDirs) +project(yes C) +add_executable(${PROJECT_NAME} yes.c) +install(TARGETS ${PROJECT_NAME} DESTINATION ${CMAKE_INSTALL_BINDIR}) diff --git a/programs/yes/yes.c b/programs/yes/yes.c new file mode 100644 index 0000000..4bd5cf4 --- /dev/null +++ b/programs/yes/yes.c @@ -0,0 +1,28 @@ +/* + * wanix, a Unix-like operating system for WebAssembly applications. + * Copyright (C) 2025 Xavier Del Campo Romero + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see <https://www.gnu.org/licenses/>. + */ + +#include <stdio.h> +#include <stdlib.h> + +int main(void) +{ + for (;;) + puts("y"); + + return EXIT_SUCCESS; +} |
