Rename main to server and add empty executable userctl
This commit is contained in:
10
Makefile
10
Makefile
@@ -9,8 +9,14 @@ LIBSHA_SRC=$(LIBSHA)sha256.c
|
|||||||
LDFLAGS=-lm -luuid
|
LDFLAGS=-lm -luuid
|
||||||
INCL_FLAGS=-I$(LIBWS)include -I$(LIBSHA)
|
INCL_FLAGS=-I$(LIBWS)include -I$(LIBSHA)
|
||||||
|
|
||||||
main: src/main.c $(LIBSHA_SRC) output
|
server: src/server.c $(LIBSHA_SRC) output
|
||||||
gcc $(CFLAGS) $(INCL_FLAGS) -o output/main src/main.c $(LIBWS_LIB) $(LDFLAGS)
|
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:
|
output:
|
||||||
mkdir -p output
|
mkdir -p output
|
||||||
|
|||||||
11
build.sh
11
build.sh
@@ -5,19 +5,20 @@ clear
|
|||||||
if [ $1 = "build" ]; then
|
if [ $1 = "build" ]; then
|
||||||
echo "Building"
|
echo "Building"
|
||||||
|
|
||||||
make main -B
|
make server -B
|
||||||
|
make userctl -B
|
||||||
|
|
||||||
elif [ $1 = "run" ]; then
|
elif [ $1 = "run" ]; then
|
||||||
echo "Running"
|
echo "Running"
|
||||||
|
|
||||||
make main
|
make server
|
||||||
./output/main 5000 ./library "Testing library"
|
./output/server 5000 ./library "Testing library"
|
||||||
|
|
||||||
elif [ $1 = "debug" ]; then
|
elif [ $1 = "debug" ]; then
|
||||||
echo "Debugging"
|
echo "Debugging"
|
||||||
|
|
||||||
make main
|
make server
|
||||||
gf2 ./output/main
|
gf2 ./output/server
|
||||||
|
|
||||||
elif [ $1 = "clean" ]; then
|
elif [ $1 = "clean" ]; then
|
||||||
echo "Cleaning"
|
echo "Cleaning"
|
||||||
|
|||||||
7
src/userctl.c
Normal file
7
src/userctl.c
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
#include <stdio.h>
|
||||||
|
|
||||||
|
int main() {
|
||||||
|
printf("Hello, world!\n");
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
Reference in New Issue
Block a user