Makefile 607 B

1234567891011121314151617181920212223242526
  1. FLAGS = -std=c11 -Wall
  2. SERVER_LINKER = -lpthread
  3. CLIENT_LINKER = -lpthread
  4. all: server client
  5. run_all: all
  6. ./server
  7. ./client 127.0.0.1
  8. server: ServerMain.c Server.c Server.h Stream.c Stream.h SocketUtils.c SocketUtils.h
  9. gcc $(FLAGS) -o $@ ServerMain.c Server.c Stream.c SocketUtils.c $(SERVER_LINKER)
  10. run_server: server
  11. ./server
  12. client: ClientMain.c Client.c Client.h Stream.c Stream.h SocketUtils.c SocketUtils.h String.c String.h
  13. gcc $(FLAGS) -o $@ ClientMain.c Client.c Stream.c SocketUtils.c String.c $(CLIENT_LINKER)
  14. run_client: client
  15. ./client 127.0.0.1
  16. clean:
  17. rm -f client server