-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
51 lines (40 loc) · 1.26 KB
/
Makefile
File metadata and controls
51 lines (40 loc) · 1.26 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
#
# libslackrtm - Client library for Slack RTM
#
# Copyright (C) 2023, Naveen Albert
#
# Naveen Albert <asterisk@phreaknet.org>
#
CC = gcc
CFLAGS = -Wall -Werror -Wunused -Wextra -Wmaybe-uninitialized -Wstrict-prototypes -Wmissing-prototypes -Wdeclaration-after-statement -Wmissing-declarations -Wmissing-format-attribute -Wnull-dereference -Wformat=2 -Wshadow -Wsizeof-pointer-memaccess -std=gnu99 -pthread -O3 -g -Wstack-protector -fno-omit-frame-pointer -fwrapv -fPIC -D_FORTIFY_SOURCE=2
EXE = slackrtm
LIBNAME = libslackrtm
RM = rm -f
INSTALL = install
MAIN_SRC := $(wildcard *.c)
MAIN_OBJ = $(MAIN_SRC:.c=.o)
all: library
# NOTE: -lwss, -lssl, and -lcrypto are only needed for the high-level APIs
library: $(MAIN_OBJ)
@echo "== Linking $@"
$(CC) -shared -fPIC -o $(LIBNAME).so $^ -ljansson -lwss -lssl -lcrypto
install: all
$(INSTALL) -m 755 $(LIBNAME).so "/usr/lib"
mkdir -p /usr/include/slackrtm
$(INSTALL) -m 755 *.h "/usr/include/slackrtm/"
examples:
$(MAKE) --no-builtin-rules -C examples all
uninstall:
$(RM) /usr/lib/$(LIBNAME).so
$(RM) /usr/include/slackrtm/*.h
rm -rf /usr/include/slackrtm
%.o : %.c
$(CC) $(CFLAGS) -c $^
clean :
$(RM) *.i *.o *.so $(EXE)
.PHONY: all
.PHONY: install
.PHONY: uninstall
.PHONY: library
.PHONY: examples
.PHONY: clean