Move includes to common.h

This commit is contained in:
Kranklyboy 2018-04-15 19:18:37 +02:00
parent 234ea6130f
commit 49c0d80832
4 changed files with 19 additions and 40 deletions

View File

@ -3,13 +3,13 @@ CFLAGS = -std=c99 -pedantic -Wall -D_DEFAULT_SOURCE -D_BSD_SOURCE -D_SVID_SOURCE
all: server client
server: server.o
server: server.o common.h
$(CC) $^ -o $@
client: client.o
client: client.o common.h
$(CC) $^ -o $@
%.o: %.c common.h
%.o: %.c
$(CC) $(CFLAGS) $^
.PHONY clean:

View File

@ -6,24 +6,6 @@
* @brief Client for OSUE exercise 1B `Battleship'.
*/
#include <stdlib.h>
#include <unistd.h>
#include <stdint.h>
#include <stdbool.h>
#include <string.h>
#include <limits.h>
#include <assert.h>
#include <errno.h>
#include <signal.h>
#include <time.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <netdb.h>
#include <fcntl.h>
#include "common.h"
static const char *port = DEFAULT_PORT;

View File

@ -39,6 +39,22 @@
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <stdint.h>
#include <string.h>
#include <limits.h>
#include <assert.h>
#include <errno.h>
#include <signal.h>
#include <time.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <netdb.h>
#include <fcntl.h>
/**
* @brief Print a map showing the squares where ships have been hit.

View File

@ -6,25 +6,6 @@
* @brief Server for OSUE exercise 1B `Battleship'.
*/
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <stdint.h>
#include <stdbool.h>
#include <string.h>
#include <limits.h>
#include <assert.h>
#include <errno.h>
#include <signal.h>
#include <time.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <netdb.h>
#include <fcntl.h>
#include "common.h"
static const char *port = DEFAULT_PORT;