-
Notifications
You must be signed in to change notification settings - Fork 13
Expand file tree
/
Copy pathMakefile
More file actions
55 lines (43 loc) · 1.15 KB
/
Copy pathMakefile
File metadata and controls
55 lines (43 loc) · 1.15 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
52
53
54
55
TOPDIR = $(CURDIR)
all: rctlser rctlcli
CC?=gcc
CFLAGS?=-Wall -Wno-unused-function -Wno-unused-value -Wno-unused-variable -Wno-unused-but-set-variable
CFLAGS+=-I. -I$(TOPDIR)/include
# CFLAGS+=-g -DDEBUG
CFLAGS+=-D_GNU_SOURCE
LDFLAGS+=-lpthread -lssl -lcrypto -lreadline -lncurses
STRIP=strip
export CC CFLAGS LDFLAGS STRIP
LIBDIR=$(TOPDIR)/lib
LIB=$(LIBDIR)/rctl.a
export LIB
$(LIB):
@$(MAKE) -C $(LIBDIR)
SERDIR=$(TOPDIR)/server
rctlser:$(LIB)
@$(MAKE) -C $(SERDIR)
CLIDIR=$(TOPDIR)/client
rctlcli:$(LIB)
@$(MAKE) -C $(CLIDIR)
clean:
-@rm -rf $(CLIDIR)/cmdline*
-@rm -rf `find . -name "*.o"`
-@rm -rf `find . -name "*.a"`
-@rm -rf $(CLIDIR)/rctlcli $(SERDIR)/rctlser
install_server:
-@mkdir -p /etc/rctl
-@cp rctl_cert.pem rctl_priv.pem /etc/rctl
install_client:
-@mkdir -p /etc/ssl/certs/
-@cp wirelesser_ca.crt /etc/ssl/certs/
tags: FORCE
@find . -name "*.h" -o -name "*.c" -o -name "*.s" > cscope.files
@cscope -bkq -i cscope.files
@ctags -L cscope.files
.PHONY: clean FORCE
-include $(SRC:.c=.d)
%.d:cmdline.h %.c
@set -e; rm -f $@; \
$(CC) -MM $(CFLAGS) $< > $@.$$$$; \
sed 's,\($*\)\.o[ :]*,\1.o $@ : ,g' < $@.$$$$ > $@; \
rm -f $@.$$$$