diff options
Diffstat (limited to '03_exercise/cli')
-rw-r--r-- | 03_exercise/cli/Makefile | 23 | ||||
-rw-r--r-- | 03_exercise/cli/client.c | 13 |
2 files changed, 36 insertions, 0 deletions
diff --git a/03_exercise/cli/Makefile b/03_exercise/cli/Makefile new file mode 100644 index 0000000..c09533d --- /dev/null +++ b/03_exercise/cli/Makefile @@ -0,0 +1,23 @@ +#!/usr/bin/make +.SUFFIXES: +.PHONY: all run clean +TAR = client +SRC = $(wildcard *.c) +OBJ = $(SRC:%.c=%.o) + +DEP = $(OBJ:%.o=%.d) +-include $(DEP) + +%.o: %.c + $(CC) $(CFLAGS) $< -o $@ + +$(TAR): $(OBJ) + $(CC) $(LFLAGS) $^ -o $@ + +all: $(TAR) + +run: all + ./$(TAR) + +clean: + $(RM) $(RMFILES) $(OBJ) $(TAR) $(DEP) diff --git a/03_exercise/cli/client.c b/03_exercise/cli/client.c new file mode 100644 index 0000000..48bf724 --- /dev/null +++ b/03_exercise/cli/client.c @@ -0,0 +1,13 @@ +#include <stdio.h> +#include <stdlib.h> + +#define PORT 9000 +#define HOST "127.0.0.1" + +int main() +{ + getc(stdin); + printf("Client Exit\n"); + + return 0; +} |