This repository has been archived by the owner on Sep 29, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
62 lines (42 loc) · 1.45 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
# in order to execute this "Makefile" just type "make"
OBJS = mystation.o bus.o utils.o station-manager.o comptroller.o create_configFile.o
SOURCE = mystation.c bus.c utils.c station-manager.c comptroller.c create_configFile.c
HEADER = utils.h
OUT = mystation bus station-manager create_configFile clean_sharedMemory comptroller
CC = gcc
FLAGS = -g -c
all: mystation bus station-manager comptroller create_configFile
mystation: mystation.o utils.o
$(CC) -g mystation.o utils.o -o mystation -lpthread
station-manager: station-manager.o utils.o
$(CC) -g station-manager.o utils.o -o station-manager -lpthread
bus: bus.o utils.o
$(CC) -g bus.o utils.o -o bus -lpthread
comptroller: comptroller.o utils.o
$(CC) -g comptroller.o utils.o -o comptroller -lpthread
create_configFile: create_configFile.o
$(CC) -g create_configFile.o -o create_configFile
# create/compile the individual files >>seperetaly<<
mystation.o: mystation.c
$(CC) $(FLAGS) mystation.c
bus.o: bus.c
$(CC) $(FLAGS) bus.c
station-manager.o: station-manager.c
$(CC) $(FLAGS) station-manager.c
comptroller.o: comptroller.c
$(CC) $(FLAGS) comptroller.c
utils.o: utils.c
$(CC) $(FLAGS) utils.c
create_configFile.o: create_configFile.c
$(CC) $(FLAGS) create_configFile.c
# clean house
clean:
rm -f $(OBJS) $(OUT)
# do a bit of accounting
count:
wc $(SOURCE) $(HEADER)
# clear shared memory if something failed
clean_sharedMemory:
./clean_SharedMemory.sh
list_OfSharedMemory:
ipcs -m