From 526691855ae0bcb27196dda368cd804150d193e1 Mon Sep 17 00:00:00 2001 From: chenwj113 Date: Wed, 26 Oct 2022 10:36:22 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9Makefile=E6=96=87=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- intro/Makefile | 7 ++++++- select/Makefile | 5 ++++- sockopt/Makefile | 5 ++++- tcpclisrv/Makefile | 5 ++++- udpclisrv/Makefile | 5 ++++- 5 files changed, 22 insertions(+), 5 deletions(-) diff --git a/intro/Makefile b/intro/Makefile index aa6a065..ee7b895 100644 --- a/intro/Makefile +++ b/intro/Makefile @@ -4,7 +4,12 @@ CFLAGS += -Wall -lunp objs = $(basename $(srcfiles)) all: + @mkdir -p build; @for obj in $(objs); do \ $(CC) $$obj.c $(CFLAGS) -o build/$$obj; \ done -.PHONY: all \ No newline at end of file + +clean: + @rm -rf build/* + +.PHONY: all clean \ No newline at end of file diff --git a/select/Makefile b/select/Makefile index aa6a065..ac8c041 100644 --- a/select/Makefile +++ b/select/Makefile @@ -4,7 +4,10 @@ CFLAGS += -Wall -lunp objs = $(basename $(srcfiles)) all: + @mkdir -p build; @for obj in $(objs); do \ $(CC) $$obj.c $(CFLAGS) -o build/$$obj; \ done -.PHONY: all \ No newline at end of file +clean: + @rm -rf build/* +.PHONY: all clean \ No newline at end of file diff --git a/sockopt/Makefile b/sockopt/Makefile index aa6a065..ac8c041 100644 --- a/sockopt/Makefile +++ b/sockopt/Makefile @@ -4,7 +4,10 @@ CFLAGS += -Wall -lunp objs = $(basename $(srcfiles)) all: + @mkdir -p build; @for obj in $(objs); do \ $(CC) $$obj.c $(CFLAGS) -o build/$$obj; \ done -.PHONY: all \ No newline at end of file +clean: + @rm -rf build/* +.PHONY: all clean \ No newline at end of file diff --git a/tcpclisrv/Makefile b/tcpclisrv/Makefile index aa6a065..ac8c041 100644 --- a/tcpclisrv/Makefile +++ b/tcpclisrv/Makefile @@ -4,7 +4,10 @@ CFLAGS += -Wall -lunp objs = $(basename $(srcfiles)) all: + @mkdir -p build; @for obj in $(objs); do \ $(CC) $$obj.c $(CFLAGS) -o build/$$obj; \ done -.PHONY: all \ No newline at end of file +clean: + @rm -rf build/* +.PHONY: all clean \ No newline at end of file diff --git a/udpclisrv/Makefile b/udpclisrv/Makefile index aa6a065..ac8c041 100644 --- a/udpclisrv/Makefile +++ b/udpclisrv/Makefile @@ -4,7 +4,10 @@ CFLAGS += -Wall -lunp objs = $(basename $(srcfiles)) all: + @mkdir -p build; @for obj in $(objs); do \ $(CC) $$obj.c $(CFLAGS) -o build/$$obj; \ done -.PHONY: all \ No newline at end of file +clean: + @rm -rf build/* +.PHONY: all clean \ No newline at end of file