blob: 4d7cc72079c76934dcb3a29527d74bd8ffd48ed3 [file] [log] [blame]
rjw0a04f9b2022-02-10 17:43:47 +08001SHELL = /bin/sh
2RM = rm -f
3
4
5LOCAL_CFLAGS := \
6 -Wall \
7 -g \
8 -Wall \
9 -fPIC \
10 -shared \
11 -D__COMPILE_OPTION__ \
12 -D__LINUX_OS__ \
13
14CPPFLAGS=\
15 -std=c++11 \
16
17LOCAL_PATH = .
18$(warning ################# ZHOUQUNCHAO LOCAL_PATH:$(LOCAL_PATH),ROOT: $(ROOT),includedir:$(includedir),libdir:$(libdir))
19
20LOCAL_C_INCLUDES = \
21 -I$(LOCAL_PATH)/include \
22 -I$(ROOT)$(includedir)/gps_hal \
23 -I$(ROOT)$(includedir)/gps_hal/inc \
24 -I$(ROOT)$(includedir)/gps_hal/hardware \
25 -I$(ROOT)$(includedir)/liblog \
rjw0a04f9b2022-02-10 17:43:47 +080026
27LOCAL_LIBS := \
28 -L. \
29 -ldl \
30 -lrt \
31 -llog \
32 -lutils \
33 -lcutils \
rjw46daf582022-03-29 14:23:34 +080034 -lgnsshal \
rjw0a04f9b2022-02-10 17:43:47 +080035 -lpthread \
36# -llynq-log \
37
38$(warning libs=$(LOCAL_LIBS))
39
40CXXSRC=\
41
42SOURCES = $(wildcard *.c wildcard src/*.c)
43
44EXECUTABLE = liblynq-gnss.so
45
46COBJS=$(SOURCES:.c=.o)
47$(warning test)
48all: $(EXECUTABLE)
49$(EXECUTABLE): $(COBJS)
50 $(CXX) -shared -Wl,--no-undefined $(COBJS) $(LOCAL_LIBS) $(LOCAL_CFLAGS) $(LOCAL_C_INCLUDES) -o $@
51
52%.o: %.c
53 $(warning ----->build $<)
54 $(CC) $(LOCAL_C_INCLUDES) $(LOCAL_CFLAGS) $(LOCAL_LIBS) -o $@ -c $<
55
56.PHONY: install clean
57install:
58 mkdir -p $(ROOT)$(base_libdir)/
59 install $(EXECUTABLE) $(ROOT)$(base_libdir)/
60
61clean:
62 rm -f $(EXECUTABLE) rm -rf *.o
63 find ./ -name *.o | xargs rm -rf