You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

66 lines
1.6 KiB
Makefile

7 years ago
CC=clang
CXX=clang++
RM=rm -f
CFLAGS=-fsanitize=address -fno-omit-frame-pointer -fPIC -std=gnu99 -g -Wall -Wextra -Werror-implicit-function-declaration -Wno-missing-field-initializers -I libwebsockets/include -I json-c
LDFLAGS=-shared -g -fsanitize=address
LDLIBS=-lgnutls
7 years ago
SRCS=slack.c \
slack-api.c \
slack-buffer.c \
slack-channel.c \
7 years ago
slack-config.c \
slack-command.c \
slack-input.c \
slack-message.c \
7 years ago
slack-oauth.c \
slack-request.c \
slack-teaminfo.c \
slack-user.c \
slack-workspace.c \
api/slack-api-hello.c \
api/slack-api-error.c \
api/slack-api-message.c \
api/message/slack-api-message-unimplemented.c \
request/slack-request-chat-postmessage.c \
request/slack-request-channels-list.c \
request/slack-request-users-list.c
7 years ago
OBJS=$(subst .c,.o,$(SRCS)) libwebsockets/lib/libwebsockets.a json-c/libjson-c.a
all: libwebsockets/lib/libwebsockets.a json-c/libjson-c.a weechat-slack
7 years ago
weechat-slack: $(OBJS)
$(CC) $(LDFLAGS) -o slack.so $(OBJS) $(LDLIBS)
libwebsockets/lib/libwebsockets.a:
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 .
7 years ago
$(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
.PHONY: tags cs
tags:
ctags -f .git/tags -R *.c *.h
cs:
cscope -RUbq
7 years ago
include .depend