-
Notifications
You must be signed in to change notification settings - Fork 2
/
Makefile
52 lines (40 loc) · 1.11 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
51
52
VERSION = 2.0
NAME = pev
PKG = $(NAME)-$(VERSION)
ARCHIVE = $(PKG).tar.gz
incdir = $(prefix)/include
libdir = $(prefix)/lib
docdir = $(prefix)/share/doc/$(NAME)
RM = rm -f
INSTALL = install
EXEC = demo example
LIB = libpev.a
CFLAGS += -W -Wall -Wextra -Wno-unused-parameter
LDLIBS += $(LIB)
LIBINC = pev.h
LIBOBJS = pev.o
DOCFILES = README.md UNLICENSE
all: $(EXEC)
$(EXEC): $(LIB)
$(LIB): $(LIBOBJS)
$(AR) $(ARFLAGS) $@ $(LIBOBJS)
install: $(LIB)
$(INSTALL) -d $(DESTDIR)$(incdir)
$(INSTALL) -d $(DESTDIR)$(libdir)
$(INSTALL) -d $(DESTDIR)$(docdir)
$(INSTALL) -m 0644 $(LIBINC) $(DESTDIR)$(incdir)/$(LIBINC)
$(INSTALL) -m 0644 $(LIB) $(DESTDIR)$(libdir)/$(LIB)
for file in $(DOCFILES); do \
$(INSTALL) -m 0644 $$file $(DESTDIR)$(docdir)/$$file; \
done
uninstall:
-$(RM) $(DESTDIR)$(incdir)/$(LIBINC)
-$(RM) $(DESTDIR)$(libdir)/$(LIB)
-$(RM) -r $(DESTDIR)$(docdir)
clean:
$(RM) *.o $(LIB) demo
distclean: clean
$(RM) *~ GPATH GRTAGS GTAGS ID
dist:
git archive --format=tar.gz --prefix=$(PKG)/ -o ../$(ARCHIVE) v$(VERSION)
(cd ..; md5sum $(ARCHIVE) | tee $(ARCHIVE).md5)