From 6937968af721c32be8b6a0247f7552470084e874 Mon Sep 17 00:00:00 2001 From: vm Date: Mon, 22 Jun 2020 16:48:00 +0200 Subject: packed on ref --- 03_exercise/ghd | 33 +++++++++++++++++++++++++++++++++ 03_exercise/srv/.file.swp | Bin 0 -> 1024 bytes 03_exercise/srv/file | 4 ++++ 03_exercise/srv/upload/Makefile | 23 +++++++++++++++++++++++ 03_exercise/srv/upload/test | 0 03_exercise/upload/Makefile | 33 +++++++++++++++++++++++++++++++++ 03_exercise/upload/ghd | 33 +++++++++++++++++++++++++++++++++ 03_exercise/upload/test | 33 +++++++++++++++++++++++++++++++++ 8 files changed, 159 insertions(+) create mode 100644 03_exercise/ghd create mode 100644 03_exercise/srv/.file.swp create mode 100644 03_exercise/srv/file create mode 100644 03_exercise/srv/upload/Makefile create mode 100644 03_exercise/srv/upload/test create mode 100644 03_exercise/upload/Makefile create mode 100644 03_exercise/upload/ghd create mode 100644 03_exercise/upload/test (limited to '03_exercise') diff --git a/03_exercise/ghd b/03_exercise/ghd new file mode 100644 index 0000000..dbf4b28 --- /dev/null +++ b/03_exercise/ghd @@ -0,0 +1,33 @@ +#!/usr/bin/make +.SUFFIXES: +.PHONY: all run pack clean +.SILENT: run + +TAR = cli/client srv/server +PCK = lab-3.zip + +export CFLAGS = -std=gnu11 -c -g -Os -Wall -Werror -MMD -MP + +cli/client: $(wildcard cli/*.c) $(wildcard cli/*.h) + @$(MAKE) -C $(@D) + +srv/server: $(wildcard srv/*.c) $(wildcard srv/*.h) + @$(MAKE) -C $(@D) + +all: $(TAR) + +run: all + srv/server& echo $$! > .srv_pid + sleep 1 + echo "Client Ready:" + cli/client + kill `cat .srv_pid` + $(RM) $(RMFILES) .srv_pid + +pack: clean + zip -r $(PCK) cli srv Makefile -x "*/.*" + +clean: + @$(MAKE) -C cli clean + @$(MAKE) -C srv clean + $(RM) $(RMFILES) $(PCK) diff --git a/03_exercise/srv/.file.swp b/03_exercise/srv/.file.swp new file mode 100644 index 0000000..e68b146 Binary files /dev/null and b/03_exercise/srv/.file.swp differ diff --git a/03_exercise/srv/file b/03_exercise/srv/file new file mode 100644 index 0000000..816612a --- /dev/null +++ b/03_exercise/srv/file @@ -0,0 +1,4 @@ +Hallo +123 +5 + diff --git a/03_exercise/srv/upload/Makefile b/03_exercise/srv/upload/Makefile new file mode 100644 index 0000000..c09533d --- /dev/null +++ b/03_exercise/srv/upload/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/srv/upload/test b/03_exercise/srv/upload/test new file mode 100644 index 0000000..e69de29 diff --git a/03_exercise/upload/Makefile b/03_exercise/upload/Makefile new file mode 100644 index 0000000..dbf4b28 --- /dev/null +++ b/03_exercise/upload/Makefile @@ -0,0 +1,33 @@ +#!/usr/bin/make +.SUFFIXES: +.PHONY: all run pack clean +.SILENT: run + +TAR = cli/client srv/server +PCK = lab-3.zip + +export CFLAGS = -std=gnu11 -c -g -Os -Wall -Werror -MMD -MP + +cli/client: $(wildcard cli/*.c) $(wildcard cli/*.h) + @$(MAKE) -C $(@D) + +srv/server: $(wildcard srv/*.c) $(wildcard srv/*.h) + @$(MAKE) -C $(@D) + +all: $(TAR) + +run: all + srv/server& echo $$! > .srv_pid + sleep 1 + echo "Client Ready:" + cli/client + kill `cat .srv_pid` + $(RM) $(RMFILES) .srv_pid + +pack: clean + zip -r $(PCK) cli srv Makefile -x "*/.*" + +clean: + @$(MAKE) -C cli clean + @$(MAKE) -C srv clean + $(RM) $(RMFILES) $(PCK) diff --git a/03_exercise/upload/ghd b/03_exercise/upload/ghd new file mode 100644 index 0000000..dbf4b28 --- /dev/null +++ b/03_exercise/upload/ghd @@ -0,0 +1,33 @@ +#!/usr/bin/make +.SUFFIXES: +.PHONY: all run pack clean +.SILENT: run + +TAR = cli/client srv/server +PCK = lab-3.zip + +export CFLAGS = -std=gnu11 -c -g -Os -Wall -Werror -MMD -MP + +cli/client: $(wildcard cli/*.c) $(wildcard cli/*.h) + @$(MAKE) -C $(@D) + +srv/server: $(wildcard srv/*.c) $(wildcard srv/*.h) + @$(MAKE) -C $(@D) + +all: $(TAR) + +run: all + srv/server& echo $$! > .srv_pid + sleep 1 + echo "Client Ready:" + cli/client + kill `cat .srv_pid` + $(RM) $(RMFILES) .srv_pid + +pack: clean + zip -r $(PCK) cli srv Makefile -x "*/.*" + +clean: + @$(MAKE) -C cli clean + @$(MAKE) -C srv clean + $(RM) $(RMFILES) $(PCK) diff --git a/03_exercise/upload/test b/03_exercise/upload/test new file mode 100644 index 0000000..dbf4b28 --- /dev/null +++ b/03_exercise/upload/test @@ -0,0 +1,33 @@ +#!/usr/bin/make +.SUFFIXES: +.PHONY: all run pack clean +.SILENT: run + +TAR = cli/client srv/server +PCK = lab-3.zip + +export CFLAGS = -std=gnu11 -c -g -Os -Wall -Werror -MMD -MP + +cli/client: $(wildcard cli/*.c) $(wildcard cli/*.h) + @$(MAKE) -C $(@D) + +srv/server: $(wildcard srv/*.c) $(wildcard srv/*.h) + @$(MAKE) -C $(@D) + +all: $(TAR) + +run: all + srv/server& echo $$! > .srv_pid + sleep 1 + echo "Client Ready:" + cli/client + kill `cat .srv_pid` + $(RM) $(RMFILES) .srv_pid + +pack: clean + zip -r $(PCK) cli srv Makefile -x "*/.*" + +clean: + @$(MAKE) -C cli clean + @$(MAKE) -C srv clean + $(RM) $(RMFILES) $(PCK) -- cgit v1.2.3-54-g00ecf