diff options
Diffstat (limited to '03_exercise/Makefile')
-rw-r--r-- | 03_exercise/Makefile | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/03_exercise/Makefile b/03_exercise/Makefile new file mode 100644 index 0000000..dbf4b28 --- /dev/null +++ b/03_exercise/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) |