Makefile 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. CC=g++
  2. FLAGS=-std=c++11 -c
  3. SERVERFILES=src/server/ServerSockets.cpp src/server/ServerApp.cpp src/SocketIp.cpp
  4. CLIENTFILES=src/client/ClientSockets.cpp src/client/ClientApp.cpp src/SocketIp.cpp
  5. SERVEROBJECTS=obj/ServerSockets.o obj/ServerApp.o obj/SocketIp.o
  6. CLIENTOBJECTS=obj/ClientSockets.o obj/ClientApp.o obj/SocketIp.o
  7. build_client.elf: $(CLIENTOBJECTS) obj
  8. $(CC) $(CLIENTOBJECTS) -o build_client.elf
  9. build_server.elf: $(SERVEROBJECTS) obj
  10. $(CC) $(SERVEROBJECTS) -o build_server.elf
  11. # SERVER
  12. obj/ServerSockets.o: obj src/server/ServerSockets.cpp
  13. $(CC) $(FLAGS) src/server/ServerSockets.cpp -o obj/ServerSockets.o
  14. obj/ServerApp.o: obj src/server/ServerApp.cpp
  15. $(CC) $(FLAGS) src/server/ServerApp.cpp -o obj/ServerApp.o
  16. # CLIENT
  17. obj/ClientSockets.o: obj src/client/ClientSockets.cpp
  18. $(CC) $(FLAGS) src/client/ClientSockets.cpp -o obj/ClientSockets.o
  19. obj/ClientApp.o: obj src/client/ClientApp.cpp
  20. $(CC) $(FLAGS) src/client/ClientApp.cpp -o obj/ClientApp.o
  21. obj:
  22. mkdir obj
  23. # COMMON
  24. obj/SocketIp.o: src/SocketIp.cpp
  25. $(CC) $(FLAGS) src/SocketIp.cpp -o obj/SocketIp.o
  26. # CLEAR
  27. clean: build_client.elf build_server.elf obj
  28. rm -rf obj build_client.elf build_server.elf