-
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathMakefile
43 lines (33 loc) · 1.03 KB
/
Makefile
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
#
# LIRC - IRC Client Library for C
#
# Copyright (C) 2023, Naveen Albert
#
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 -D_FORTIFY_SOURCE=2
EXE = irc
LIBNAME = libirc
RM = rm -f
INSTALL = install
all: library
library: irc.o
@echo "== Linking $@"
$(CC) -shared -fPIC -o $(LIBNAME).so $^ -lssl -lcrypto
libinstall: library
$(INSTALL) -m 755 $(LIBNAME).so "/usr/lib"
mkdir -p /usr/include/lirc
$(INSTALL) -m 755 *.h "/usr/include/lirc/"
install: library libinstall
client : client.o
$(CC) $(CFLAGS) -o $(EXE) $< -lirc
%.o : %.c
$(CC) $(CFLAGS) -fPIC -c -Wno-unused-result $^
clean :
$(RM) *.i *.o $(EXE)
uninstall:
$(RM) /usr/lib/$(LIBNAME).so
$(RM) /usr/include/lirc/*.h
rm -rf /usr/include/lirc
.PHONY: all
.PHONY: install
.PHONY: clean