2
2
REMOVE = rm
3
3
CC = gcc
4
4
DEPENDENCIES = main.c hello.c factorial.c binary.c
5
- OUT = myexecoutprogMacro .o
5
+ OUT = prog .o
6
6
7
7
# Explicit rules, all the commands you can call with make
8
8
# (note: the <tab> in the command line is necessary for make to work)
9
- # target: dependency1 dependency2 ...
9
+ # target: dependency1 dependency2 ...
10
10
# <tab> command
11
11
12
- # Called by: make myexecout
13
- # also executed when you just called make. This calls the first target.
14
- myexecout : main.c hello.c factorial.c binary.c
15
- gcc -o myexecoutprog .o main.c hello.c factorial.c binary.c
12
+ # Called by: make prog
13
+ # Also executed when you just called make. This calls the first target.
14
+ prog : main.c hello.c factorial.c binary.c
15
+ gcc -o prog .o main.c hello.c factorial.c binary.c
16
16
17
- myexecoutFromMacro : $(DEPENDENCIES )
17
+ prog1 : $(DEPENDENCIES )
18
18
$(CC ) $(DEPENDENCIES ) -o $(OUT )
19
19
20
- myexecout2 : main.o hello.o factorial.o binary.o
21
- gcc -o myexecoutprog2 main.o hello.o factorial.o binary.o
20
+ prog2 : main.o hello.o factorial.o binary.o
21
+ gcc -o prog2 main.o hello.o factorial.o binary.o
22
22
23
23
24
- # #make clean will remove myexecoutprog .o from the directory
24
+ # # make clean will remove prog .o from the directory
25
25
clean :
26
- rm myexecoutprog .o
26
+ rm prog .o
27
27
28
- cleanFromMacro :
28
+ clean1 :
29
29
$(REMOVE ) $(OUT )
30
30
31
31
clean2 :
32
- rm myexecoutprog2 * .o
32
+ rm prog2 * .o
33
33
34
- # Implicit rules
35
- main.o : main.c functions.h
34
+ # Implicit rules
35
+ main.o : main.c functions.h
36
36
factorial.o : factorial.c functions.h
37
37
hello.o : hello.c functions.h
38
38
binary.o : binary.c functions.h
0 commit comments