-
Notifications
You must be signed in to change notification settings - Fork 0
/
makefile
executable file
·76 lines (60 loc) · 2.54 KB
/
makefile
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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
#-----------------------------------------------
#Fichero Make para la compilacion de Conecta N.
#-----------------------------------------------
CXX = g++
SRC = src
OBJ = obj
INCLUDE = include
LIB = lib
BIN = bin
# Opciones para compilar
CPPFLAGS = -c -g -I$(INCLUDE)
# Opciones para enlazar
LDFLAGS = -L$(LIB) -lconf -ltablero -ljugadores -linterface -lSDL_gfx -lSDL -lpthread
all : interface configuracion tablero jugador conecta_n
#-------------------------------------------
#Creacion del la libreria de interface:
#-------------------------------------------
interface: $(OBJ)/interface.o
ar rsv $(LIB)/libinterface.a $(OBJ)/interface.o
$(OBJ)/interface.o: $(SRC)/interface.cpp $(INCLUDE)/interface.h
$(CXX) $(CPPFLAGS) $(SRC)/interface.cpp -o $(OBJ)/interface.o
#-------------------------------------------
#Creacion del la libreria de configuracion:
#-------------------------------------------
configuracion: $(OBJ)/configuracion.o
ar rsv $(LIB)/libconf.a $(OBJ)/configuracion.o
$(OBJ)/configuracion.o: $(SRC)/configuracion.cpp $(INCLUDE)/configuracion.h
$(CXX) $(CPPFLAGS) $(SRC)/configuracion.cpp -o $(OBJ)/configuracion.o
#-------------------------------------------
#Creacion del la libreria jugadores:
#-------------------------------------------
jugador: $(OBJ)/jugadores.o
ar rsv $(LIB)/libjugadores.a $(OBJ)/jugadores.o
$(OBJ)/jugadores.o: $(SRC)/jugador.cpp $(INCLUDE)/jugador.h
$(CXX) $(CPPFLAGS) $(SRC)/jugador.cpp -o $(OBJ)/jugadores.o
#-------------------------------------------
#Creacion del la libreria tablero:
#-------------------------------------------
tablero: $(OBJ)/tablero.o
ar rsv $(LIB)/libtablero.a $(OBJ)/tablero.o
$(OBJ)/tablero.o: $(SRC)/tablero.cpp $(INCLUDE)/tablero.h
$(CXX) $(CPPFLAGS) $(SRC)/tablero.cpp -o $(OBJ)/tablero.o
#-------------------------------------------
#Creacion del main:
#-------------------------------------------
conecta_n: $(BIN)/conecta_n
$(BIN)/conecta_n: $(OBJ)/conecta_n.o $(LIB)/libconf.a $(LIB)/libtablero.a $(LIB)/libjugadores.a $(LIB)/libinterface.a
$(CXX) $(OBJ)/conecta_n.o $(LDFLAGS) -o $(BIN)/conectaN
$(OBJ)/conecta_n.o: $(SRC)/main.cpp $(INCLUDE)/configuracion.h $(INCLUDE)/tablero.h $(INCLUDE)/jugador.h $(INCLUDE)/interface.h
$(CXX) -c $(CPPFLAGS) $(SRC)/main.cpp -o $(OBJ)/conecta_n.o
#-------------------------------------------
#Creacion de la documentacion:
#-------------------------------------------
documentacion:
\doxygen
#-------------------------------------------
#Borrar los ficheros temporales:
#-------------------------------------------
clean:
\rm -rf $(SRC)/*.o $(OBJ)/*