From 482175d6a851aba2a07979237bc17985bd3588c6 Mon Sep 17 00:00:00 2001 From: pandaa Date: Fri, 28 Nov 2025 13:49:49 +0100 Subject: [PATCH] created Setup --- .gitignore | 2 + CMakeLists.txt | 17 +++++ Makefile | 181 +++++++++++++++++++++++++++++++++++++++++++++ README.md | 4 +- src/include/main.h | 5 ++ src/main.c | 12 +++ 6 files changed, 220 insertions(+), 1 deletion(-) create mode 100644 CMakeLists.txt create mode 100644 Makefile create mode 100644 src/include/main.h create mode 100644 src/main.c diff --git a/.gitignore b/.gitignore index f765426..09efd03 100644 --- a/.gitignore +++ b/.gitignore @@ -66,3 +66,5 @@ CTestTestfile.cmake _deps CMakeUserPresets.json +build/ +.cache diff --git a/CMakeLists.txt b/CMakeLists.txt new file mode 100644 index 0000000..89dd5dd --- /dev/null +++ b/CMakeLists.txt @@ -0,0 +1,17 @@ +cmake_minimum_required(VERSION 3.10) +project(pandaaRm C) + +set(CMAKE_C_STANDARD 11) +set(CMAKE_C_STANDARD_REQUIRED ON) + +# Executable +add_executable(pandaaRm + src/main.c +) +#headers einbinden +include_directories(src/include) + +# ncurses einbinden +find_package(Curses REQUIRED) +include_directories(${CURSES_INCLUDE_DIR}) +target_link_libraries(pandaaRm ${CURSES_LIBRARIES}) diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..d1d6c58 --- /dev/null +++ b/Makefile @@ -0,0 +1,181 @@ +# CMAKE generated file: DO NOT EDIT! +# Generated by "Unix Makefiles" Generator, CMake Version 4.2 + +# Default target executed when no arguments are given to make. +default_target: all +.PHONY : default_target + +# Allow only one "make -f Makefile2" at a time, but pass parallelism. +.NOTPARALLEL: + +#============================================================================= +# Special targets provided by cmake. + +# Disable implicit rules so canonical targets will work. +.SUFFIXES: + +# Disable VCS-based implicit rules. +% : %,v + +# Disable VCS-based implicit rules. +% : RCS/% + +# Disable VCS-based implicit rules. +% : RCS/%,v + +# Disable VCS-based implicit rules. +% : SCCS/s.% + +# Disable VCS-based implicit rules. +% : s.% + +.SUFFIXES: .hpux_make_needs_suffix_list + +# Command-line flag to silence nested $(MAKE). +$(VERBOSE)MAKESILENT = -s + +#Suppress display of executed commands. +$(VERBOSE).SILENT: + +# A target that is always out of date. +cmake_force: +.PHONY : cmake_force + +#============================================================================= +# Set environment variables for the build. + +# The shell in which to execute make rules. +SHELL = /bin/sh + +# The CMake executable. +CMAKE_COMMAND = /usr/bin/cmake + +# The command to remove a file. +RM = /usr/bin/cmake -E rm -f + +# Escaping for special characters. +EQUALS = = + +# The top-level source directory on which CMake was run. +CMAKE_SOURCE_DIR = /home/pandaa/Projects/pandaaRm + +# The top-level build directory on which CMake was run. +CMAKE_BINARY_DIR = /home/pandaa/Projects/pandaaRm + +#============================================================================= +# Targets provided globally by CMake. + +# Special rule for the target edit_cache +edit_cache: + @$(CMAKE_COMMAND) -E cmake_echo_color "--switch=$(COLOR)" --cyan "Running CMake cache editor..." + /usr/bin/ccmake -S$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR) +.PHONY : edit_cache + +# Special rule for the target edit_cache +edit_cache/fast: edit_cache +.PHONY : edit_cache/fast + +# Special rule for the target rebuild_cache +rebuild_cache: + @$(CMAKE_COMMAND) -E cmake_echo_color "--switch=$(COLOR)" --cyan "Running CMake to regenerate build system..." + /usr/bin/cmake --regenerate-during-build -S$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR) +.PHONY : rebuild_cache + +# Special rule for the target rebuild_cache +rebuild_cache/fast: rebuild_cache +.PHONY : rebuild_cache/fast + +# The main all target +all: cmake_check_build_system + $(CMAKE_COMMAND) -E cmake_progress_start /home/pandaa/Projects/pandaaRm/CMakeFiles /home/pandaa/Projects/pandaaRm//CMakeFiles/progress.marks + $(MAKE) $(MAKESILENT) -f CMakeFiles/Makefile2 all + $(CMAKE_COMMAND) -E cmake_progress_start /home/pandaa/Projects/pandaaRm/CMakeFiles 0 +.PHONY : all + +# The main clean target +clean: + $(MAKE) $(MAKESILENT) -f CMakeFiles/Makefile2 clean +.PHONY : clean + +# The main clean target +clean/fast: clean +.PHONY : clean/fast + +# Prepare targets for installation. +preinstall: all + $(MAKE) $(MAKESILENT) -f CMakeFiles/Makefile2 preinstall +.PHONY : preinstall + +# Prepare targets for installation. +preinstall/fast: + $(MAKE) $(MAKESILENT) -f CMakeFiles/Makefile2 preinstall +.PHONY : preinstall/fast + +# clear depends +depend: + $(CMAKE_COMMAND) -S$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR) --check-build-system CMakeFiles/Makefile.cmake 1 +.PHONY : depend + +#============================================================================= +# Target rules for targets named pandaaRm + +# Build rule for target. +pandaaRm: cmake_check_build_system + $(MAKE) $(MAKESILENT) -f CMakeFiles/Makefile2 pandaaRm +.PHONY : pandaaRm + +# fast build rule for target. +pandaaRm/fast: + $(MAKE) $(MAKESILENT) -f CMakeFiles/pandaaRm.dir/build.make CMakeFiles/pandaaRm.dir/build +.PHONY : pandaaRm/fast + +src/main.o: src/main.c.o +.PHONY : src/main.o + +# target to build an object file +src/main.c.o: + $(MAKE) $(MAKESILENT) -f CMakeFiles/pandaaRm.dir/build.make CMakeFiles/pandaaRm.dir/src/main.c.o +.PHONY : src/main.c.o + +src/main.i: src/main.c.i +.PHONY : src/main.i + +# target to preprocess a source file +src/main.c.i: + $(MAKE) $(MAKESILENT) -f CMakeFiles/pandaaRm.dir/build.make CMakeFiles/pandaaRm.dir/src/main.c.i +.PHONY : src/main.c.i + +src/main.s: src/main.c.s +.PHONY : src/main.s + +# target to generate assembly for a file +src/main.c.s: + $(MAKE) $(MAKESILENT) -f CMakeFiles/pandaaRm.dir/build.make CMakeFiles/pandaaRm.dir/src/main.c.s +.PHONY : src/main.c.s + +# Help Target +help: + @echo "The following are some of the valid targets for this Makefile:" + @echo "... all (the default if no target is provided)" + @echo "... clean" + @echo "... depend" + @echo "... edit_cache" + @echo "... rebuild_cache" + @echo "... pandaaRm" + @echo "... src/main.o" + @echo "... src/main.i" + @echo "... src/main.s" +.PHONY : help + + + +#============================================================================= +# Special targets to cleanup operation of make. + +# Special rule to run CMake to check the build system integrity. +# No rule that depends on this can have commands that come from listfiles +# because they might be regenerated. +cmake_check_build_system: + $(CMAKE_COMMAND) -S$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR) --check-build-system CMakeFiles/Makefile.cmake 0 +.PHONY : cmake_check_build_system + diff --git a/README.md b/README.md index 1bbe1ab..e6bd688 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,5 @@ # pandaaRm -a better way to rm a directory \ No newline at end of file +a better way to rm a directory + +Usage: pandaaRm diff --git a/src/include/main.h b/src/include/main.h new file mode 100644 index 0000000..490eada --- /dev/null +++ b/src/include/main.h @@ -0,0 +1,5 @@ +#ifndef MAIN_C +#define MAIN_C +int main(int argc,char *argv[]); +void printHelp(); +#endif diff --git a/src/main.c b/src/main.c new file mode 100644 index 0000000..f6f5469 --- /dev/null +++ b/src/main.c @@ -0,0 +1,12 @@ +#include +#include "main.h" +int main(int argc,char *argv[]) { + printf("%d\n",argc); + if (argc != 1) { + printHelp(); + } +} + +void printHelp() { + printf("Usage: pandaaRm "); +}