-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmakefile
45 lines (30 loc) · 877 Bytes
/
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
CC = gcc
CFLAGS = -g -Wall -pedantic -Iincludes
APPFILES = ./src/app.c
SLAVEFILES = ./src/slave.c
VIEWFILES = ./src/view.c
APPOBJ = $(APPFILES:.c=.o)
SLAVEOBJ = $(SLAVEFILES:.c=.o)
VIEWOBJ = $(VIEWFILES:.c=.o)
APPBINARY = app
SLAVEBINARY = slave
VIEWBINARY = view
RESULT=result.txt
.PHONY: all clean build_app build_slave build_view cleanObj
all: $(APPBINARY) $(SLAVEBINARY) $(VIEWBINARY) #cleanObj
build_app: $(APPBINARY)
build_slave: $(SLAVEBINARY)
build_view: $(VIEWBINARY)
$(APPBINARY): $(APPOBJ)
$(CC) $(CFLAGS) -o $(APPBINARY) $(APPOBJ)
$(SLAVEBINARY): $(SLAVEOBJ)
$(CC) $(CFLAGS) -o $(SLAVEBINARY) $(SLAVEOBJ)
$(VIEWBINARY): $(VIEWOBJ)
$(CC) $(CFLAGS) -o $(VIEWBINARY) $(VIEWOBJ)
%.o: %.c
$(CC) $(CFLAGS) -c $< -o $@
clean:
rm -f $(APPBINARY) $(SLAVEBINARY) $(VIEWBINARY) $(RESULT)
#$(MAKE) cleanObj
cleanObj:
rm -f $(APPOBJ) $(SLAVEOBJ) $(VIEWOBJ)