-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
50 lines (38 loc) · 1.01 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
44
45
46
47
48
49
50
VERSION = 1.5
NAME = accept-guard
PKG = $(NAME)-$(VERSION)
ARCHIVE = $(PKG).tar.gz
libdir = $(prefix)/lib
docdir = $(prefix)/share/doc/$(NAME)
RM = rm -f
INSTALL = install
CFLAGS ?= -g -O2 -W -Wall -Wextra
CFLAGS += -fPIC
OBJS = accept-guard.o
LIBS = -ldl
LIBNAME = accept-guard.so
DOCFILES = README.md LICENSE
all: $(LIBNAME)
$(LIBNAME): $(OBJS)
$(CC) $(CFLAGS) -shared $(OBJS) -o $@ $(LIBS)
check: all
$(MAKE) -C test $@
install: $(LIBNAME)
$(INSTALL) -d $(DESTDIR)$(libdir)
$(INSTALL) -d $(DESTDIR)$(docdir)
$(INSTALL) -m 0644 $(LIBNAME) $(DESTDIR)$(libdir)/$(LIBNAME)
for file in $(DOCFILES); do \
$(INSTALL) -m 0644 $$file $(DESTDIR)$(docdir)/$$file; \
done
uninstall:
-$(RM) $(DESTDIR)$(libdir)/$(LIBNAME)
-$(RM) -r $(DESTDIR)$(docdir)
clean:
$(MAKE) -C test $@
-$(RM) $(LIBNAME) *.o
dist:
git archive --format=tar.gz --prefix=$(PKG)/ -o ../$(ARCHIVE) v$(VERSION)
distclean: clean
-$(RM) *~
release: dist
(cd ..; md5sum $(ARCHIVE) > $(ARCHIVE).md5)