forked from kshmir/so-2011
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmakefile
More file actions
120 lines (76 loc) · 2.37 KB
/
makefile
File metadata and controls
120 lines (76 loc) · 2.37 KB
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
# Actions of make makefile
default : show_usage
# START Declaration of requirements for each target
### Data Structures
data_structures_test = \
bin/graph.o \
bin/list.o \
bin/data_structures_test.o
### Examples
example_1 = \
bin/ejemplo_1.o
### TP1
tp1 = \
bin/tp1.o
### Flags and declarations
cc = gcc -g
# END of Declaration of requirements for each target
# START Declaration of object files creation
### Data structures tests
#### Graph
data_structures_graph:
$(cc) -o bin/graph.o -c src/data_structures/graph.c
#### List
data_structures_list:
$(cc) -o bin/list.o -c src/data_structures/list.c
#### Global Test File for Data Structures
data_structures_tests_data_structures_test:
$(cc) -o bin/data_structures_test.o \
-c src/data_structures/tests/data_structures_test.c
# END Declaration of object files creation
# START Declaration of targets
### All targets must move to bin
clear_data_structures_test :
rm bin/*.o;
rm data_structures_test;
### Data structures tests
data_structures_test : data_structures_graph data_structures_list \
data_structures_tests_data_structures_test
$(cc) -o data_structures_test $(data_structures_test)
### Generates tp1
tp1:
gcc -o tp1.o $(tp1)
# END Declaration of targets
# Usage print script
show_usage:
@echo "--------------------------------------------"
@echo "MAKEFILE USAGE DOCUMENTATION"
@echo "\nSISTEMAS OPERATIVOS - ITBA - 2011"
@echo "\nAlumnos:"
@echo "\tMARSEILLAN, AGUSTIN"
@echo "\tPEREYRA, CRISTIAN"
@echo "\tVIDELA, MAXIMO"
@echo "--------------------------------------------"
@echo "Usage: \"make {action}\"\n"
@echo "\taction:"
@echo "\t\ttp{number}(_test)"
@echo "\t\tdata_structures_test"
@echo "\t\texample{number}"
@echo "\t\tclean_{target}"
@echo "--------------------------------------------"
@echo "Examples:"
@echo "\t\nCompiling a TP:\n"
@echo "\t\"make tp1\""
@echo "\t\tIt compiles the tp number 1"
@echo "\t\"make tp1_test\""
@echo "\t\tRuns the tests for the tp number 1"
@echo "\t\nCompiling an example:\n"
@echo "\t\"make example1\""
@echo "\t\tIt compiles the example number 1"
@echo "\t\"make clean_tp1_test\""
@echo "\t\tCleans the tests for the tp1"
@echo "\nNotes:"
@echo "Only TP1 is available for now"
@echo "Example 1: Threads"
@echo "Example 2: Fork/exec/wait"
@echo "--------------------------------------------"