iotivity 0.9.0
[platform/upstream/iotivity.git] / service / protocol-plugin / plugins / mqtt-light / lib / Makefile
1 include  config.mk
2
3 .PHONY : really clean install
4
5 MOSQ_OBJS=mosquitto.o \
6                   logging_mosq.o \
7                   memory_mosq.o \
8                   messages_mosq.o \
9                   net_mosq.o \
10                   read_handle.o \
11                   read_handle_client.o \
12                   read_handle_shared.o \
13                   send_mosq.o \
14                   send_client_mosq.o \
15                   srv_mosq.o \
16                   thread_mosq.o \
17                   time_mosq.o \
18                   tls_mosq.o \
19                   util_mosq.o \
20                   will_mosq.o
21
22 all : libmosquitto.so.${SOVERSION} libmosquitto.a
23         $(MAKE) -C cpp
24         $(MAKE) -C python
25
26 install : all
27         $(INSTALL) -d ${DESTDIR}$(prefix)/lib${LIB_SUFFIX}/
28         $(INSTALL) -s libmosquitto.so.${SOVERSION} ${DESTDIR}${prefix}/lib${LIB_SUFFIX}/libmosquitto.so.${SOVERSION}
29         ln -sf libmosquitto.so.${SOVERSION} ${DESTDIR}${prefix}/lib${LIB_SUFFIX}/libmosquitto.so
30         $(INSTALL) -d ${DESTDIR}${prefix}/include/
31         $(INSTALL) mosquitto.h ${DESTDIR}${prefix}/include/mosquitto.h
32         $(MAKE) -C cpp install
33         $(MAKE) -C python install
34
35 uninstall :
36         -rm -f ${DESTDIR}${prefix}/lib${LIB_SUFFIX}/libmosquitto.so.${SOVERSION}
37         -rm -f ${DESTDIR}${prefix}/lib${LIB_SUFFIX}/libmosquitto.so
38         -rm -f ${DESTDIR}${prefix}/include/mosquitto.h
39
40 reallyclean : clean
41
42 clean :
43         -rm -f *.o libmosquitto.so.${SOVERSION} libmosquitto.so libmosquitto.a
44         $(MAKE) -C cpp clean
45         $(MAKE) -C python clean
46
47 libmosquitto.so.${SOVERSION} : ${MOSQ_OBJS}
48         $(CC) -shared $(LIB_LDFLAGS) $^ -o $@ ${LIB_LIBS}
49
50 libmosquitto.a : ${MOSQ_OBJS}
51         $(AR) cr $@ $^
52 mosquitto.o : mosquitto.c mosquitto.h
53         $(CC) $(LIB_CFLAGS) -c $< -o $@
54
55 logging_mosq.o : logging_mosq.c logging_mosq.h
56         $(CC) $(LIB_CFLAGS) -c $< -o $@
57
58 messages_mosq.o : messages_mosq.c messages_mosq.h
59         $(CC) $(LIB_CFLAGS) -c $< -o $@
60
61 memory_mosq.o : memory_mosq.c memory_mosq.h
62         $(CC) $(LIB_CFLAGS) -c $< -o $@
63
64 net_mosq.o : net_mosq.c net_mosq.h
65         $(CC) $(LIB_CFLAGS) -c $< -o $@
66
67 read_handle.o : read_handle.c read_handle.h
68         $(CC) $(LIB_CFLAGS) -c $< -o $@
69
70 read_handle_client.o : read_handle_client.c read_handle.h
71         $(CC) $(LIB_CFLAGS) -c $< -o $@
72
73 read_handle_shared.o : read_handle_shared.c read_handle.h
74         $(CC) $(LIB_CFLAGS) -c $< -o $@
75
76 send_mosq.o : send_mosq.c send_mosq.h
77         $(CC) $(LIB_CFLAGS) -c $< -o $@
78
79 send_client_mosq.o : send_client_mosq.c send_mosq.h
80         $(CC) $(LIB_CFLAGS) -c $< -o $@
81
82 srv_mosq.o : srv_mosq.c
83         $(CC) $(LIB_CFLAGS) -c $< -o $@
84
85 thread_mosq.o : thread_mosq.c
86         $(CC) $(LIB_CFLAGS) -c $< -o $@
87
88 time_mosq.o : time_mosq.c
89         $(CC) $(LIB_CFLAGS) -c $< -o $@
90
91 tls_mosq.o : tls_mosq.c
92         $(CC) $(LIB_CFLAGS) -c $< -o $@
93
94 util_mosq.o : util_mosq.c util_mosq.h
95         $(CC) $(LIB_CFLAGS) -c $< -o $@
96
97 will_mosq.o : will_mosq.c will_mosq.h
98         $(CC) $(LIB_CFLAGS) -c $< -o $@
99