From f343c86800a3c1ff566d51c86299a461731e8fa1 Mon Sep 17 00:00:00 2001 From: ThoNohT Date: Thu, 28 May 2026 12:53:43 +0200 Subject: [PATCH] Rename main to server and add empty executable userctl --- Makefile | 10 ++++++++-- build.sh | 11 ++++++----- src/{main.c => server.c} | 0 src/userctl.c | 7 +++++++ 4 files changed, 21 insertions(+), 7 deletions(-) rename src/{main.c => server.c} (100%) create mode 100644 src/userctl.c diff --git a/Makefile b/Makefile index d99b209..6a466be 100644 --- a/Makefile +++ b/Makefile @@ -9,8 +9,14 @@ LIBSHA_SRC=$(LIBSHA)sha256.c LDFLAGS=-lm -luuid INCL_FLAGS=-I$(LIBWS)include -I$(LIBSHA) -main: src/main.c $(LIBSHA_SRC) output - gcc $(CFLAGS) $(INCL_FLAGS) -o output/main src/main.c $(LIBWS_LIB) $(LDFLAGS) +server: src/server.c $(LIBSHA_SRC) output + gcc $(CFLAGS) $(INCL_FLAGS) -o output/server src/server.c $(LIBWS_LIB) $(LDFLAGS) + +LDFLAGS2=-lm +INCL_FLAGS2=-I$(LIBSHA) + +userctl: src/userctl.c $(LIBSHA_SRC) output + gcc $(CFLAGS) $(INCL_FLAGS2) -o output/userctl src/userctl.c $(LDFLAGS2) output: mkdir -p output diff --git a/build.sh b/build.sh index f2e55b6..1e92d03 100755 --- a/build.sh +++ b/build.sh @@ -5,19 +5,20 @@ clear if [ $1 = "build" ]; then echo "Building" - make main -B + make server -B + make userctl -B elif [ $1 = "run" ]; then echo "Running" - make main - ./output/main 5000 ./library "Testing library" + make server + ./output/server 5000 ./library "Testing library" elif [ $1 = "debug" ]; then echo "Debugging" - make main - gf2 ./output/main + make server + gf2 ./output/server elif [ $1 = "clean" ]; then echo "Cleaning" diff --git a/src/main.c b/src/server.c similarity index 100% rename from src/main.c rename to src/server.c diff --git a/src/userctl.c b/src/userctl.c new file mode 100644 index 0000000..0a1f67b --- /dev/null +++ b/src/userctl.c @@ -0,0 +1,7 @@ +#include + +int main() { + printf("Hello, world!\n"); + return 0; +} +