-
Notifications
You must be signed in to change notification settings - Fork 8
/
makefile
executable file
·185 lines (143 loc) · 5.07 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
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
###################################################
#
# Makefile for MYMEDLIB MAC OS X.
# Creator [Xcode -> Makefile Ver: Feb 14 2007 09:18:41]
# Created: [Mon Mar 1 11:40:48 2010]
#
###################################################
#
# Macros
#
SHELL := /bin/bash
CC = /usr/bin/g++
LNK_OPTIONS =
CCFLAGS =
#@echo ---=/\=\/= Building myMedLib =\/=/\=--
#if we passed ARCH=osx
ifeq ($(ARCH),osx)
#@echo Building for OSX ( ARCH=osx )
CC_OPTIONS = -DOSX=1
endif
#if we passed ARCH=linux
ifeq ($(ARCH),linux)
#@echo Building for LINUX ( ARCH=linux )
LNK_OPTIONS = -lpthread -lrt -ldl
endif
HEADER = $(shell for file in `find . -name *.h`;do echo $$file; done)
#
# INCLUDE directories for MYMEDLIB
#
INCLUDE = -I.\
-Iengine/helper\
-Iengine/helper/crypto/\
-Iengine/helper/mongoose_http_server/callbacks\
-Iengine/helper/mongoose_http_server\
-Iengine/helper/thread\
-Iengine/helper/request\
-Iengine/p2p/node\
-Iengine/p2p/protocols/chord\
-Iengine/p2p/protocols\
-Iengine/p2p/transport/http\
-Iengine/p2p/transport
#
# Build MYMEDLIB
#
all: MYMEDLIB libmymed.a
MYMEDLIB : \
./HTTP_Client.o\
./sha1.o\
./callbacks.o\
./chord_callbacks.o\
./mongoose.o\
./Thread.o\
./Node.o\
./AbstractChord.o\
./ChordNode.o\
./ProtocolSingleton.o\
./http_operations.o\
./TransportHTTP.o\
./Request.o
# actualy archive the static library with ar.
libmymed.a:
@echo Archiving myMedLib...
rm -f libmymed.a
ar -cvq libmymed.a *.o
clean :
rm -f \
./HTTP_Client.o\
./sha1.o\
./callbacks.o\
./chord_callbacks.o\
./mongoose.o\
./Thread.o\
./Node.o\
./AbstractChord.o\
./ChordNode.o\
./ProtocolSingleton.o\
./http_operations.o\
./TransportHTTP.o\
./Request.o
veryclean : clean
rm -f \
./libmymed.a\
install : MYMEDLIB
@echo --= HEADERS =--
@echo $(HEADER)
@echo --= CLEANING OLD HEADERS =--
mkdir -p /usr/include/myMed
@echo --= INSTALLING MYMEDLIB HEADERS =--
cp $(HEADER) /usr/include/myMed
#
# Build the parts of MYMEDLIB
#
# Item # 2 -- HTTP_Client --
./HTTP_Client.o : engine/helper/HTTP_Client.cpp
$(CC) $(CCFLAGS) $(CC_OPTIONS) engine/helper/HTTP_Client.cpp -c $(INCLUDE) -o ./HTTP_Client.o
## Item # 3 -- crypt_argchk --
#./crypt_argchk.o : engine/helper/crypto/tomcrypt/algorithms/crypt_argchk.c
# $(CC) $(CCFLAGS) $(CC_OPTIONS) engine/helper/crypto/tomcrypt/algorithms/crypt_argchk.c -c $(INCLUDE) -o ./crypt_argchk.o
#
## Item # 4 -- sha1 --
#./sha1.o : engine/helper/crypto/tomcrypt/algorithms/sha1.c
# $(CC) $(CCFLAGS) $(CC_OPTIONS) engine/helper/crypto/tomcrypt/algorithms/sha1.c -c $(INCLUDE) -o ./sha1.o
#
## Item # 5 -- md5 --
#./md5.o : engine/helper/crypto/tomcrypt/algorithms/md5.c
# $(CC) $(CCFLAGS) $(CC_OPTIONS) engine/helper/crypto/tomcrypt/algorithms/md5.c -c $(INCLUDE) -o ./md5.o
# Item # 5 -- sha1 --
./sha1.o: engine/helper/crypto/sha1.cpp
$(CC) $(CCFLAGS) $(CC_OPTIONS) engine/helper/crypto/sha1.cpp -c $(INCLUDE) -o ./sha1.o
# Item # 6 -- callbacks --
./callbacks.o : engine/helper/mongoose_http_server/callbacks/callbacks.cpp
$(CC) $(CCFLAGS) $(CC_OPTIONS) engine/helper/mongoose_http_server/callbacks/callbacks.cpp -c $(INCLUDE) -o ./callbacks.o
# Item # 8 -- chord_callbacks --
./chord_callbacks.o : engine/helper/mongoose_http_server/callbacks/chord_callbacks.cpp
$(CC) $(CCFLAGS) $(CC_OPTIONS) engine/helper/mongoose_http_server/callbacks/chord_callbacks.cpp -c $(INCLUDE) -o ./chord_callbacks.o
# Item # 9 -- mongoose --
./mongoose.o : engine/helper/mongoose_http_server/mongoose.cpp
$(CC) $(CCFLAGS) $(CC_OPTIONS) engine/helper/mongoose_http_server/mongoose.cpp -c $(INCLUDE) -o ./mongoose.o
# Item # 10 -- Thread --
./Thread.o : engine/helper/thread/Thread.cpp
$(CC) $(CCFLAGS) $(CC_OPTIONS) engine/helper/thread/Thread.cpp -c $(INCLUDE) -o ./Thread.o
# Item # 11 -- Node --
./Node.o : engine/p2p/node/Node.cpp
$(CC) $(CCFLAGS) $(CC_OPTIONS) engine/p2p/node/Node.cpp -c $(INCLUDE) -o ./Node.o
# Item # 12 -- AbstractChord --
./AbstractChord.o : engine/p2p/protocols/chord/AbstractChord.cpp
$(CC) $(CCFLAGS) $(CC_OPTIONS) engine/p2p/protocols/chord/AbstractChord.cpp -c $(INCLUDE) -o ./AbstractChord.o
# Item # 13 -- ChordNode --
./ChordNode.o : engine/p2p/protocols/chord/ChordNode.cpp
$(CC) $(CCFLAGS) $(CC_OPTIONS) engine/p2p/protocols/chord/ChordNode.cpp -c $(INCLUDE) -o ./ChordNode.o
# Item # 14 -- ProtocolSingleton --
./ProtocolSingleton.o : engine/p2p/protocols/ProtocolSingleton.cpp
$(CC) $(CCFLAGS) $(CC_OPTIONS) engine/p2p/protocols/ProtocolSingleton.cpp -c $(INCLUDE) -o ./ProtocolSingleton.o
# Item # 15 -- http_operations --
./http_operations.o : engine/p2p/transport/http/http_operations.cpp
$(CC) $(CCFLAGS) $(CC_OPTIONS) engine/p2p/transport/http/http_operations.cpp -c $(INCLUDE) -o ./http_operations.o
# Item # 16 -- TransportHTTP --
./TransportHTTP.o : engine/p2p/transport/http/TransportHTTP.cpp
$(CC) $(CCFLAGS) $(CC_OPTIONS) engine/p2p/transport/http/TransportHTTP.cpp -c $(INCLUDE) -o ./TransportHTTP.o
# Item # 17 -- TransportHTTP --
./Request.o : engine/helper/request/Request.cpp
$(CC) $(CCFLAGS) $(CC_OPTIONS) engine/helper/request/Request.cpp -c $(INCLUDE) -o ./Request.o
##### END RUN ####