-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile_p5_SERVER
42 lines (38 loc) · 1.33 KB
/
Makefile_p5_SERVER
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
CC=g++
SERVER = Servidor
MONITOR = monitorServidor
SOCKET_DIR = Socket
SOCKET = ${SOCKET_DIR}/Socket
EJECUTABLE = practica_5_SERVER
CPPFLAGS=-I. -I${SOCKET_DIR} -O2 -std=c++11 -lsockets # Flags compilacion
LDFLAGS=-pthread # Flags linkado threads
all: ${SERVER}
#----------------------------------------------------------------------------
# Descomentar la siguiente línea para compilar en hendrix
# SOCKETSFLAGS=-lsocket -lnsl
#-----------------------------------------------------------
# Linkado
${SERVER}: ${SOCKET}.o ${MONITOR}.o ${SERVER}.o
${CC} ${LDFLAGS} ${SOCKET}.o ${MONITOR}.o ${SERVER}.o -o ${EJECUTABLE} ${SOCKETSFLAGS}
#-----------------------------------------------------------
# SERVIDOR
# Compilacion
${SERVER}.o: ${SERVER}.cpp
${CC} -c ${CPPFLAGS} ${SERVER}.cpp
#-----------------------------------------------------------
# SOCKETS
# Compilacion libreria de Sockets
${SOCKET}.o: ${SOCKET}.hpp ${SOCKET}.cpp
${CC} -c ${CPPFLAGS} ${SOCKET}.cpp -o ${SOCKET}.o
#-----------------------------------------------------------
# MONITOR
# Compilacion libreria de monitorServidor
${MONITOR}.o: ${MONITOR}.hpp ${MONITOR}.cpp
${CC} -c ${CPPFLAGS} ${MONITOR}.cpp -o ${MONITOR}.o
#-----------------------------------------------------------
# LIMPIEZA
clean:
$(RM) ${SOCKET}.o
$(RM) ${MONITOR}.o
$(RM) ${SERVER}.o
$(RM) ${EJECUTABLE}