-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathMakefile
68 lines (49 loc) · 2.37 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
SHELL := /bin/bash
DEBUG_FLAGS = -DCS_ENABLE_DEBUG
CXXFLAGS = -std=c++14 -Iinclude -Iexternal/zstr/src -Wall -fPIC -DMG_ENABLE_SSL
CFLAGS = -std=c11 -Iinclude -Wall -fPIC -DMG_ENABLE_SSL -I/usr/local/opt/openssl/include
ALL_FMF_OBJECTS = environment.o inmem.o multiple.o mongoose.o http.o eureka.o registeringendpoint.o curl.o
FMF_LD = -lz -lssl -lcrypto -lcurl
all: example1 dashboard/dashboard graph/graph
dashboard/dashboard: dashboard/dashboard.cpp
pushd dashboard && make && popd
external/plustache/libplustache.la:
./install-plustache.sh
graph/graph: graph/graph.cpp external/plustache/libplustache.la
pushd graph && make && popd
clean:
rm *.o example1 lib/libfmf.so
pushd dashboard && make clean && popd
pushd graph && make clean && popd
example1: example1.o lib/libfmf.so
clang++ example1.o -L./lib -lfmf -o example1
curl.o: impl/curl.cpp include/config.hpp include/endpoint.hpp
clang++ -c impl/curl.cpp $(CXXFLAGS)
lib/libfmf.so: $(ALL_FMF_OBJECTS)
mkdir -p out
mkdir -p lib
printf "#include \"include/config.hpp\"\nchar const *FMF::Version::__fmf_commit_slug = \"`git show-ref | head -n1 | cut -d" " -f1`\";\n" | clang++ -xc++ - -c -o out/ver.o $(CXXFLAGS)
clang++ -fPIC -shared $(ALL_FMF_OBJECTS) out/ver.o $(FMF_LD) -o lib/libfmf.so -L/usr/local/opt/openssl/lib
example1.o: example1.cpp include/config.hpp
clang++ -c example1.cpp $(CXXFLAGS)
environment.o: impl/environment.cpp include/config.hpp
clang++ -c impl/environment.cpp $(CXXFLAGS)
inmem.o: impl/inmem.cpp include/config.hpp
clang++ -c impl/inmem.cpp $(CXXFLAGS)
multiple.o: impl/multiple.cpp include/config.hpp
clang++ -c impl/multiple.cpp $(CXXFLAGS)
http.o: impl/http.cpp include/config.hpp include/endpoint.hpp include/mongoose.h
clang++ -c impl/http.cpp $(CXXFLAGS)
mongoose/mongoose.c:
curl https://raw.githubusercontent.com/cesanta/mongoose/master/mongoose.c > mongoose/mongoose.c
include/mongoose.h:
curl https://raw.githubusercontent.com/cesanta/mongoose/master/mongoose.h > include/mongoose.h
mongoose.o: mongoose/mongoose.c include/mongoose.h
clang -c mongoose/mongoose.c $(CFLAGS)
eureka.o: impl/eureka.cpp include/discovery.hpp impl/parsehttp.hpp external/zstr/src/zstr.hpp
clang++ -c impl/eureka.cpp $(CXXFLAGS)
impl/parsehttp.hpp external/zstr/src/zstr.hpp:
git submodule init
git submodule update
registeringendpoint.o: impl/registeringendpoint.cpp
clang++ -c impl/registeringendpoint.cpp $(CXXFLAGS)