-
Notifications
You must be signed in to change notification settings - Fork 26
/
Makefile
44 lines (33 loc) · 940 Bytes
/
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
44
PREFIX = /usr
BINDIR = $(PREFIX)/bin
DOCDIR = $(PREFIX)/share/doc/ssh-pageant
MANDIR = $(PREFIX)/share/man/man1
PROGRAM = ssh-pageant.exe
SRCS = main.c winpgntc.c
HDRS = winpgntc.h
MANPAGE = ssh-pageant.1
DOCS = README.md COPYING COPYING.PuTTY
OBJS = $(SRCS:.c=.o)
DEPS = $(OBJS:.o=.d)
.PHONY: clean all install uninstall cscope
all: $(PROGRAM)
clean:
rm -f cscope.out $(PROGRAM) $(OBJS) $(DEPS)
install: all
install -d $(BINDIR) $(DOCDIR) $(MANDIR)
install -p -t $(BINDIR) $(PROGRAM)
install -p -m 0644 -t $(DOCDIR) $(DOCS)
install -p -m 0644 -t $(MANDIR) $(MANPAGE)
uninstall:
rm -f $(BINDIR)/$(PROGRAM)
rm -f $(MANDIR)/$(MANPAGE)
rm -rf $(DOCDIR)
$(PROGRAM): $(OBJS)
$(CC) $(LDFLAGS) $(LOADLIBES) $^ $(LDLIBS) -o $@
CC = gcc
CFLAGS = -O2 -Werror -Wall -Wextra -MMD
CSCOPE = $(firstword $(shell which cscope mlcscope 2>/dev/null) false)
cscope: cscope.out
cscope.out: $(SRCS) $(HDRS)
$(CSCOPE) -b $^
-include $(DEPS)