2018-04-29 21:26:14 +00:00
|
|
|
CC=clang
|
|
|
|
CXX=clang++
|
|
|
|
RM=rm -f
|
2018-05-01 10:23:37 +00:00
|
|
|
CFLAGS=-fPIC -std=gnu99 -g -Wall -Wextra -Werror-implicit-function-declaration -Wno-missing-field-initializers -I libwebsockets/include -I json-c
|
2018-04-29 21:26:14 +00:00
|
|
|
LDFLAGS=-shared -g
|
2018-05-01 12:32:51 +00:00
|
|
|
LDLIBS=-lgnutls
|
2018-04-29 21:26:14 +00:00
|
|
|
|
|
|
|
SRCS=slack.c \
|
2018-05-01 10:23:37 +00:00
|
|
|
slack-api.c \
|
|
|
|
slack-buffer.c \
|
2018-05-02 07:11:57 +00:00
|
|
|
slack-channel.c \
|
2018-04-29 21:26:14 +00:00
|
|
|
slack-config.c \
|
|
|
|
slack-command.c \
|
2018-05-01 10:23:37 +00:00
|
|
|
slack-input.c \
|
2018-04-29 21:26:14 +00:00
|
|
|
slack-oauth.c \
|
2018-05-02 07:11:57 +00:00
|
|
|
slack-request.c \
|
2018-05-01 10:23:37 +00:00
|
|
|
slack-teaminfo.c \
|
2018-05-02 07:11:57 +00:00
|
|
|
slack-user.c \
|
|
|
|
slack-workspace.c \
|
|
|
|
api/slack-api-hello.c \
|
|
|
|
api/slack-api-error.c \
|
|
|
|
request/slack-request-channels-list.c \
|
|
|
|
request/slack-request-users-list.c
|
2018-04-29 21:26:14 +00:00
|
|
|
OBJS=$(subst .c,.o,$(SRCS)) libwebsockets/lib/libwebsockets.a json-c/libjson-c.a
|
|
|
|
|
2018-05-01 10:23:37 +00:00
|
|
|
all: libwebsockets/lib/libwebsockets.a json-c/libjson-c.a weechat-slack
|
2018-04-29 21:26:14 +00:00
|
|
|
|
|
|
|
weechat-slack: $(OBJS)
|
|
|
|
$(CC) $(LDFLAGS) -o slack.so $(OBJS) $(LDLIBS)
|
|
|
|
|
|
|
|
libwebsockets/lib/libwebsockets.a:
|
2018-05-01 10:23:37 +00:00
|
|
|
cd libwebsockets && cmake -DLWS_STATIC_PIC=ON -DLWS_WITH_SHARED=OFF -DLWS_WITHOUT_TESTAPPS=ON -DLWS_WITH_LIBEV=OFF -DLWS_WITH_LIBUV=OFF -DLWS_WITH_LIBEVENT=OFF -DCMAKE_BUILD_TYPE=DEBUG .
|
2018-04-29 21:26:14 +00:00
|
|
|
$(MAKE) -C libwebsockets
|
|
|
|
|
|
|
|
json-c/libjson-c.a:
|
|
|
|
cd json-c && cmake -DCMAKE_C_FLAGS=-fPIC .
|
|
|
|
$(MAKE) -C json-c json-c-static
|
|
|
|
|
|
|
|
depend: .depend
|
|
|
|
|
|
|
|
.depend: $(SRCS)
|
|
|
|
$(RM) ./.depend
|
|
|
|
$(CC) $(CFLAGS) -MM $^>>./.depend;
|
|
|
|
|
|
|
|
clean:
|
|
|
|
$(RM) $(OBJS)
|
|
|
|
$(MAKE) -C libwebsockets clean
|
|
|
|
$(MAKE) -C json-c clean
|
|
|
|
|
|
|
|
distclean: clean
|
|
|
|
$(RM) *~ .depend
|
|
|
|
|
|
|
|
include .depend
|