-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
141 lines (110 loc) · 3.11 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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
# autor: Vit Pavlik
# login: xpavli0a
# osobni cislo: 251301
# fakulta: FIT VUT
# Created: 2022-04-24
# Modified: 2022-04-29
# vyvijeno s GNU Make 4.3 (Built for x86_64-pc-linux-gnu)
# Makefile pro druhy projekt predmetu IOS LS 2022/2023
# prekladac
CC=gcc
CFLAGS=-std=gnu99 -Wall -Wextra -pedantic -g -DNDEBUG
#CFLAGS=-std=gnu99 -Wall -Wextra -pedantic -g
LDFLAGS=-pthread
# executable filename
FILENAME=proj2
# make
.PHONY: all
all: $(FILENAME)
# make run
.PHONY: run
.ONESHELL:
run: all
./$(FILENAME) 48 24 1000 100 1500
echo return code $$?
# make clean
.PHONY: clean
clean:
rm -f *.o *.elf $(FILENAME)
# make remake
.PHONY: remake
remake: clean all
# compile main
$(FILENAME).o: proj2.c makra.h proj2.h fronta.h control_struct.h
$(CC) $(CFLAGS) -c -o $(FILENAME).o proj2.c
# compile shm
shm.o: shm.c proj2.h makra.h
$(CC) $(CFLAGS) -c -o shm.o shm.c
# compile fronta
fronta.o: fronta.c fronta.h proj2.h makra.h
$(CC) $(CFLAGS) -c -o fronta.o fronta.c
# compile zakaznik
zakaznik.o: zakaznik.c makra.h proj2.h fronta.h control_struct.h
$(CC) $(CFLAGS) -c -o zakaznik.o zakaznik.c
# compile urednik
urednik.o: urednik.c makra.h proj2.h fronta.h control_struct.h
$(CC) $(CFLAGS) -c -o urednik.o urednik.c
# link main
$(FILENAME): $(FILENAME).o shm.o fronta.o zakaznik.o urednik.o
$(CC) $(LDFLAGS) -o $(FILENAME) $(FILENAME).o shm.o fronta.o zakaznik.o \
urednik.o
# toto neodevzdavat
# ------------------------------------------------------------------------------
.PHONY: run_no_break
run_no_break: run
python3 skripty/skript_jedna.py
# udela kyzeny zip (ale nemuzu to pouzivat protoze tam bude i tohle zejo)
.PHONY: submit
submit:
rm -f proj2.zip
zip proj2.zip *.c *.h Makefile
# da to do zipu i slozku s testy
.PHONY: zip_also_tests
zip_also_tests:
rm -f proj2.zip
zip -r proj2.zip kontrola-vystupu.sh testy *.c *.h Makefile
# da mi to dovnitr wsl filesystemu
.PHONY: copy_home
copy_home: submit
rm -r -f /home/vita/ios_proj2/*
cp proj2.zip /home/vita/ios_proj2/proj2.zip
cp /home/vita/ios_testy/tester.sh /home/vita/ios_proj2/tester.sh
cp /home/vita/ios_proj2/proj2.zip \
/home/vita/ios_testy/IOS_tester_2023/proj2.zip
# scp the archive to eva (scp prompts for password!)
.PHONY: scp_eva
scp_eva: zip_also_tests
scp proj2.zip [email protected]:~/ios/proj2/proj2.zip
# compile demo
demo.o: demo.c makra.h
$(CC) $(CFLAGS) -c -o demo.o demo.c
# link demo
demo.elf: demo.o
$(CC) $(LDFLAGS) -o demo.elf demo.o
# make demo
.PHONY: demo
.ONESHELL:
demo: demo.elf
./demo.elf
echo $$?
.PHONY: test
test: remake test1 test2 test3 test4
# testy z githubu
.PHONY: test1
test1:
rm -rf ./OUTPUT
./testy/tester.sh
.PHONY: test2
test2:
./testy/deadlock.sh 30 10 500 50 750 2> /dev/null
.PHONY: test3
test3:
cp ./testy/IOS_tester_2023/kontrola-vystupu.py ./kontrola-vystupu.py
./testy/IOS_tester_2023/test.sh
rm -f ./kontrola-vystupu.py
# poskytnuty skript z moodlu
.PHONY: test4
.ONESHELL:
test4: all
./proj2 80 10 500 50 750
cat proj2.out | ./kontrola-vystupu.sh