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