-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
85 lines (61 loc) · 2.75 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
#// Copyright (c) 2022 ZKM | Hertz-Lab (http://www.zkm.de)
#// Bernd Lintermann <[email protected]>
#//
#// BSD Simplified License.
#// For information on usage and redistribution, and for a DISCLAIMER OF ALL
#// WARRANTIES, see the file, "LICENSE" in this distribution.
#//
#===========================================================================
# HTTPSERVER
#===========================================================================
HTTPSERVERDIR = ../lidartool/libhttpserver
LIBMICROHTTPD = libmicrohttpd
LIBHTTPSERVERLIB = $(HTTPSERVERDIR)/build/src/.libs/libhttpserver.a
HTTPSERVERLIB = $(LIBHTTPSERVERLIB)
ifeq ($(shell pkg-config --exists $(LIBMICROHTTPD) && echo -n true),true)
HTTPSERVERLIB += -lmicrohttpd
else
HTTPSERVERLIB += $(HTTPSERVERDIR)/build/src/.libs/libhttpserver.a $(HTTPSERVERDIR)/../libmicrohttpd/lib/libmicrohttpd.a
endif
HTTPSERVERINC = -I$(HTTPSERVERDIR)/src -I$(HTTPSERVERDIR)/include/
ifeq ($(shell grep render_GET $(HTTPSERVERDIR)/src/httpserver/http_resource.hpp | grep 'virtual const' | wc -l),1)
HTTPSERVERINC += -Drender_const=const
else
HTTPSERVERINC += -Drender_const=
endif
#===========================================================================
# OBJDIR
#===========================================================================
OBJDIR = obj/
#===========================================================================
# APPLICATION
#===========================================================================
#===========================================================================
# CC
#===========================================================================
CC = g++
CC_FLAGS += -g -std=c++17
INCDIR += -I. -Iinclude $(HTTPSERVERINC)
#===========================================================================
# RULES
#===========================================================================
default: lidarAdmin
#===========================================================================
# DEFAULT RULES
#===========================================================================
$(OBJDIR)%.o: %.cpp include/%.h
mkdir -p obj
$(CC) -c $(CC_FLAGS) $(INCDIR) -o $@ $<
#===========================================================================
# RULES
#===========================================================================
$(OBJDIR)jsonTool.o: Trackable/jsonTool.cpp Trackable/jsonTool.h
mkdir -p obj
$(CC) -c $(CC_FLAGS) $(INCDIR) -o $@ $<
lidarAdmin: $(OBJDIR)lidarAdmin.o
$(CC) $(CC_FLAGS) $(INCDIR) -o $@ $< $(HTTPSERVERLIB) -lcurl -lpthread -lm
#===========================================================================
# IMPLICIT RULES
#===========================================================================
clean:
rm -f *.o *.so $(OBJDIR)*.o *~ */*~ lidarAdmin