This repository has been archived by the owner on Dec 28, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
53 lines (35 loc) · 1.16 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
# MAKEFILE DE PROYECTO C, rev 6.3
# Autor: MikenTNT 02-DEC-2019.
SHELL = /bin/bash
#-----------------------------------AJUSTES-------------------------------------
# Compilador de C 'gcc'.
CC = gcc
# CFLAGS: depurador '-g', matematicas '-lm'.
CFLAGS = -Wall
LIBS = -lpthread
#----------------------------------VARIABLES------------------------------------
PROGS = run/servidor run/cliente
# Phony targets.
PHONY := all PROGS clean tar untar
#----------------------------OBJETIVOS PRINCIPALES------------------------------
# Objetivos a ejecutar con el comando make.
all: $(PROGS)
run/servidor: servidor.o utils.o lists.o
$(CC) $(CFLAGS) -o $@ $^ $(LIBS)
run/cliente: cliente.o utils.o
$(CC) $(CFLAGS) -o $@ $^ $(LIBS)
# Compilacion general de archivos.
%.o: %.c %.h
$(CC) $(CFLAGS) -c $<
#-------------------------------OTROS OBJETIVOS---------------------------------
# Objetivo para limpieza.
clean:
rm -rf *.o $(PROGS) proyecto.tar run/logs/*
# Objetivo para comprimir.
tar:
tar -cvf proyecto.tar .
# Objetivo para descomprimir.
untar: proyecto.tar
tar -xvf $<
#-------------------------------------------------------------------------------
.PHONY: $(PHONY)