-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
138 lines (107 loc) · 3.13 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
PROGRAMS=\
test_append \
test_changeSlice \
test_comprehension \
test_delSlice \
test_exponents \
test_filter \
test_fromArray \
test_fromTable \
test_insert \
test_insertList \
test_insertSorted \
test_iterator \
test_list \
test_min_max_sum \
test_qsort \
test_removeDuplicates \
test_reverse \
test_slice \
test_sort \
test_split \
test_stats \
test_str \
test_toArray \
test_typeIndicators \
test_value
CFLAGS=-O3 -Wall -Wextra -pipe -I.. # --std c99 is a minimum requirement
LDFLAGS += -L.. -lpylists4c -s
default: ../libpylists4c.a $(PROGRAMS) info
../libpylists4c.a:
@echo
@echo "Building the library"
@cd ../src ; make ; make clean
@echo
test_append: test_append.o
$(CC) test_append.o $(LDFLAGS) -o $@
test_changeSlice: test_changeSlice.o
$(CC) test_changeSlice.o $(LDFLAGS) -o $@
test_comprehension: test_comprehension.o
$(CC) test_comprehension.o $(LDFLAGS) -o $@
test_delSlice: test_delSlice.o
$(CC) test_delSlice.o $(LDFLAGS) -o $@
test_exponents: test_exponents.o
$(CC) test_exponents.o $(LDFLAGS) -o $@
test_filter: test_filter.o
$(CC) test_filter.o $(LDFLAGS) -o $@
test_fromArray: test_fromArray.o
$(CC) test_fromArray.o $(LDFLAGS) -o $@
test_fromTable: test_fromTable.o
$(CC) test_fromTable.o $(LDFLAGS) -o $@
test_insert: test_insert.o
$(CC) test_insert.o $(LDFLAGS) -o $@
test_insertList: test_insertList.o
$(CC) test_insertList.o $(LDFLAGS) -o $@
test_insertSorted: test_insertSorted.o
$(CC) test_insertSorted.o $(LDFLAGS) -o $@
test_iterator: test_iterator.o
$(CC) test_iterator.o $(LDFLAGS) -o $@
test_list: test_list.o
$(CC) test_list.o $(LDFLAGS) -o $@
test_min_max_sum: test_min_max_sum.o
$(CC) test_min_max_sum.o $(LDFLAGS) -o $@
test_qsort: test_qsort.o
$(CC) test_qsort.o $(LDFLAGS) -o $@
test_removeDuplicates: test_removeDuplicates.o
$(CC) test_removeDuplicates.o $(LDFLAGS) -o $@
test_reverse: test_reverse.o
$(CC) test_reverse.o $(LDFLAGS) -o $@
test_slice: test_slice.o
$(CC) test_slice.o $(LDFLAGS) -o $@
test_sort: test_sort.o
$(CC) test_sort.o $(LDFLAGS) -o $@
test_split: test_split.o
$(CC) test_split.o $(LDFLAGS) -o $@
test_stats: test_stats.o
$(CC) test_stats.o $(LDFLAGS) -o $@
test_str: test_str.o
$(CC) test_str.o $(LDFLAGS) -o $@
test_toArray: test_toArray.o
$(CC) test_toArray.o $(LDFLAGS) -o $@
test_typeIndicators: test_typeIndicators.o
$(CC) test_typeIndicators.o $(LDFLAGS) -o $@
test_value: test_value.o
$(CC) test_value.o $(LDFLAGS) -o $@
info:
@echo
@if [ -f ../libpylists4c.so ] ; \
then \
echo "The test programs have been DYNAMICALLY linked" ; \
echo ; \
echo "If you haven't performed an installation, you'll need to execute the following" ; \
echo "command for the shared library to be found:" ; \
echo " export LD_LIBRARY_PATH=.." ; \
echo ; \
echo "If you have performed a user-only install, you can instead run:" ; \
echo " export LD_LIBRARY_PATH=~/lib" ; \
echo ; \
echo "And if you have performed a system-wide install," ; \
echo "everything should work without further action :-)" ; \
echo ; \
else \
echo "The test programs have been STATICALLY linked" ; \
fi
clean:
@rm -f *.o *.core
distclean: clean
@rm -f $(PROGRAMS)