-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
39 lines (29 loc) · 1.07 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
#OBJS = main.o salida.o calculadora.o
OBJS = ./cmd_utils.o ./sig_handlers.o ./redirectIO.o
BINARY = myshell
CFLAGS = -g -Wall -Werror -pedantic
#La opcion -g hace que el compilador le agregue al binario informacion\
#extra que se va a utilizar para debugger, por ejemplo con GDB
#all: programa
#Esta regla compila el programa principal
myshell: $(OBJS)
gcc $(CFLAGS) myshell.c -o myshell ./cmd_utils.o ./exec.o ./sig_handlers.o redirectIO.o
./myshell
cmd_utils.o: ./cmd_utils.h ./cmd_utils.c ./exec.o
gcc $(CFLAGS) -c ./cmd_utils.c
exec.o: ./exec.c ./exec.h
gcc $(CFLAGS) -c ./exec.c
sig_handlers.o: ./sig_handlers.c ./sig_handlers.h
gcc $(CFLAGS) -c ./sig_handlers.c
redirectIO.o: ./redirectIO.c ./redirectIO.h ./cmd_utils.o
gcc $(CFLAGS) -c ./redirectIO.c
clean:
rm -f $(BINARY) $(OBJS)
rm -f *.o
# ls | grep -v "\." | xargs rm #to remove all executables
# WARNING: The last command also removes the Makefile
celan:
rm -f $(BINARY) $(OBJS)
rm -f *.o
# ls | grep -v "\." | xargs rm #to remove all executables
# WARNING: The last command also removes the Makefile