forked from ua-parser/uap-cpp
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
32 lines (24 loc) · 887 Bytes
/
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
CC=g++
LDFLAGS=-lboost_regex -lboost_system -lyaml-cpp -lglog -fPIC
CFLAGS=-std=c++0x -Wall -Werror -g -O3
# wildcard object build target
%.o: %.cpp
$(CC) -c $(CFLAGS) $*.cpp -o $*.o $(LDFLAGS)
@$(CC) -MM $(CFLAGS) $*.cpp $(LDFLAGS) > $*.d
uaparser_cpp: libuaparser_cpp.a
libuaparser_cpp.a: UaParser.o
ar rcs $@ $^
libuaparser_cpp.so: UaParser.o
$(CC) $< -shared $(LDFLAGS) -o $@
UaParserTest: libuaparser_cpp.a UaParserTest.o
$(CC) $(CFLAGS) $^ -o $@ libuaparser_cpp.a $(LDFLAGS) -lgtest -lpthread
test: UaParserTest
./UaParserTest
# clean everything generated
clean:
find . -name "*.o" -exec rm -rf {} \; # clean up object files
find . -name "*.d" -exec rm -rf {} \; # clean up dependencies
rm -f UaParserTest *.a *.so
# automatically include the generated *.d dependency make targets
# that are created from the wildcard %.o build target above
-include $(OBJS:.o=.d)