Annotation of mqtt/src/Makefile, revision 1.3
1.1 misho 1: #
2: # (C) 2011 AITnet - Sofia/Bulgaria - <misho@openbsd-bg.org>
3: # by Michael Pounov <misho@elwix.org>
4: #
5: # $Author: misho $
1.3 ! misho 6: # $Id: Makefile,v 1.2.2.3 2012/04/25 12:16:09 misho Exp $
1.1 misho 7: #
8: prefix = /usr/local
9: exec_prefix = ${prefix}
10: includedir = ${prefix}/include
11: libdir = ${exec_prefix}/lib
12:
13: AR = ar
14: RANLIB = ranlib
15: CC = gcc
16: MKDEP = mkdep
17:
18: BIN = ../bin
19: INC = ../inc
20: LIB = ../lib
21:
1.3 ! misho 22: LIBS = -laitio -laitcrc -laitcfg -lsqlite3
! 23: LDADD = -laitmqtt -lpthread -laitsched -laitio -laitcfg -laitcrc -lutil -lcrypto
1.1 misho 24:
25: CFLAGS = -I. -I${INC} -I${includedir} -Wall -O2 -fPIC -I/usr/local/include -g -O2
1.2 misho 26: LDFLAGS = -L. -L${LIB} -L${libdir} -L/usr/local/lib
1.1 misho 27:
1.3 ! misho 28: SRCS = ${MQTTD_SRCS} ${MQTT_SUBS_SRCS} ${MQTT_PUB_SRCS} ${MQTT_PING_SRCS} \
1.2 misho 29: ${MQTTPUB_SRCS} ${MQTTACC_SRCS} ${MQTTLOG_SRCS}
1.3 ! misho 30: PROGS = ${MQTTD_PROG} ${MQTT_SUBS_PROG} ${MQTT_PUB_PROG} ${MQTT_PING_PROG} \
1.2 misho 31: ${RTLM_PUB} ${RTLM_ACC} ${RTLM_LOG}
1.1 misho 32:
1.2 misho 33: MQTTD_SRCS = mqttd.c compile.c dl.c utils.c daemon.c mqttd_calls.c
34: MQTTD_OBJS = mqttd.o compile.o dl.o utils.o daemon.o mqttd_calls.o
1.1 misho 35: MQTTD_PROG = mqttd
36:
1.2 misho 37: MQTT_SUBS_SRCS = mqtt_subs.c compile.c client.c
38: MQTT_SUBS_OBJS = mqtt_subs.o compile.o client.o
39: MQTT_SUBS_PROG = mqtt_subs
40:
41: MQTT_PUB_SRCS = mqtt_pub.c compile.c client.c
42: MQTT_PUB_OBJS = mqtt_pub.o compile.o client.o
43: MQTT_PUB_PROG = mqtt_pub
1.1 misho 44:
1.3 ! misho 45: MQTT_PING_SRCS = mqtt_ping.c compile.c client.c
! 46: MQTT_PING_OBJS = mqtt_ping.o compile.o client.o
! 47: MQTT_PING_PROG = mqtt_ping
1.1 misho 48:
1.2 misho 49: MQTTPUB_SRCS = pubmqtt.c pub_schema.c
50: MQTTPUB_OBJS = pubmqtt.o pub_schema.o
51: RTLM_PUB = mqtt_pub.so
52:
53: MQTTACC_SRCS = accmqtt.c acc_schema.c
54: MQTTACC_OBJS = accmqtt.o acc_schema.o
55: RTLM_ACC = mqtt_acc.so
56:
57: MQTTLOG_SRCS = logmqtt.c
58: MQTTLOG_OBJS = logmqtt.o
59: RTLM_LOG = mqtt_log.so
60:
1.1 misho 61:
62: all: depend \
63: ${PROGS} \
64:
65: depend:
66: ./compile.sh
67: ${MKDEP} ${CFLAGS} ${SRCS}
68:
69: clean:
1.2 misho 70: rm -f *.o .depend compile.c acc_schema.c pub_schema.c *~
1.1 misho 71:
72: install:
73:
1.2 misho 74: .o: compile.c acc_schema.c pub_schema.c
1.1 misho 75: ${CC} -c ${CFLAGS} $<
76:
77: ${MQTTD_PROG}: ${MQTTD_OBJS}
78: ${CC} ${LDFLAGS} -o${BIN}/$@ ${MQTTD_OBJS} ${LDADD}
79:
1.2 misho 80: ${MQTT_SUBS_PROG}: ${MQTT_SUBS_OBJS}
81: ${CC} ${LDFLAGS} -o${BIN}/$@ ${MQTT_SUBS_OBJS} ${LDADD}
82:
83: ${MQTT_PUB_PROG}: ${MQTT_PUB_OBJS}
84: ${CC} ${LDFLAGS} -o${BIN}/$@ ${MQTT_PUB_OBJS} ${LDADD}
85:
1.3 ! misho 86: ${MQTT_PING_PROG}: ${MQTT_PING_OBJS}
! 87: ${CC} ${LDFLAGS} -o${BIN}/$@ ${MQTT_PING_OBJS} ${LDADD}
! 88:
1.2 misho 89: ${RTLM_PUB}: ${MQTTPUB_OBJS}
90: ${CC} ${LDFLAGS} -shared -nostartfiles -o ${LIB}/$@ -Wl,-x,-soname,$@ ${MQTTPUB_OBJS} ${LIBS}
91:
92: ${RTLM_ACC}: ${MQTTACC_OBJS}
93: ${CC} ${LDFLAGS} -shared -nostartfiles -o ${LIB}/$@ -Wl,-x,-soname,$@ ${MQTTACC_OBJS} ${LIBS}
94:
95: ${RTLM_LOG}: ${MQTTLOG_OBJS}
96: ${CC} ${LDFLAGS} -shared -nostartfiles -o ${LIB}/$@ -Wl,-x,-soname,$@ ${MQTTLOG_OBJS}
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>