BuildSystem: Cleanup userspace directory layout
userspace programs are now in userspace/programs userspace tests are now in userspace/tests This makes listing userspace projects much cleaner. Libraries were already separated to their own directory, so other programs should also.
This commit is contained in:
8
userspace/programs/touch/CMakeLists.txt
Normal file
8
userspace/programs/touch/CMakeLists.txt
Normal file
@@ -0,0 +1,8 @@
|
||||
set(SOURCES
|
||||
main.cpp
|
||||
)
|
||||
|
||||
add_executable(touch ${SOURCES})
|
||||
banan_link_library(touch libc)
|
||||
|
||||
install(TARGETS touch OPTIONAL)
|
||||
17
userspace/programs/touch/main.cpp
Normal file
17
userspace/programs/touch/main.cpp
Normal file
@@ -0,0 +1,17 @@
|
||||
#include <errno.h>
|
||||
#include <fcntl.h>
|
||||
#include <stdio.h>
|
||||
|
||||
int main(int argc, char** argv)
|
||||
{
|
||||
int ret = 0;
|
||||
for (int i = 1; i < argc; i++)
|
||||
{
|
||||
if (creat(argv[i], 0644) == -1 && errno != EEXIST)
|
||||
{
|
||||
perror(argv[i]);
|
||||
ret = 1;
|
||||
}
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
Reference in New Issue
Block a user