blob: 8d290ec1e8f6fce7bf24745dcaafeba5863f71a6 (
plain)
1 NAME = prt-utils
2 VERSION = 1.1
3
4 TOOLS = prtcreate prtrej prtsweep prtcheck prtwash pkgexport pkgsize \
5 prtorphan prtcheckmissing oldfiles finddeps dllist \
6 findredundantdeps pkg_installed portspage pkgfoster \
7 prtverify \
8 revdep/revdep
9
10 PREFIX = /usr
11 MANDIR = $(PREFIX)/share/man
12 BINDIR = $(PREFIX)/bin
13 LIBDIR = $(PREFIX)/lib
14 CONFDIR = /etc
15
16 all:
17 @echo "Use 'make install' to install prt-utils"
18
19 install-man:
20 if [ ! -d $(DESTDIR)$(MANDIR)/man1 ]; then \
21 install -d $(DESTDIR)$(MANDIR)/man1; \
22 fi
23 for manpage in $(TOOLS) prt-utils; do \
24 if [ -f $$manpage.1 ]; then \
25 install -m 644 $$manpage.1 $(DESTDIR)$(MANDIR)/man1/; \
26 fi; \
27 done
28
29 install-bin: revdep/revdep
30 if [ ! -d $(DESTDIR)$(BINDIR) ]; then \
31 install -d $(DESTDIR)$(BINDIR); \
32 fi
33 for binary in $(TOOLS); do \
34 install -m 755 $$binary $(DESTDIR)$(BINDIR)/; \
35 done
36
37 install-conf:
38 if [ ! -d $(DESTDIR)$(CONFDIR) ]; then \
39 install -d $(DESTDIR)$(CONFDIR); \
40 fi
41 for tool in $(TOOLS); do \
42 if [ -f $$tool.conf ]; then \
43 install -m 644 $$tool.conf $(DESTDIR)$(CONFDIR)/; \
44 fi; \
45 done
46
47 install-lib:
48 for tool in $(TOOLS); do \
49 if [ -d lib/$$tool ]; then \
50 install -d $(DESTDIR)$(LIBDIR)/$$tool; \
51 install -m 644 lib/$$tool/* $(DESTDIR)$(LIBDIR)/$$tool; \
52 fi; \
53 done
54
55 prtverify:
56 sed "s|@@LIBDIR@@|$(LIBDIR)|" prtverify.in $< > prtverify
57
58 revdep/revdep:
59 @make -C revdep
60
61 install: prtverify revdep/revdep install-man install-bin install-lib # install-conf
62
63 clean:
64 @rm -f prtverify
65 @make -C revdep clean
66
67 dist: clean
68 @rm -rf ${NAME}-${VERSION}
69 @mkdir .${NAME}-${VERSION}
70 @cp -r * .${NAME}-${VERSION}
71 @mv .${NAME}-${VERSION} ${NAME}-${VERSION}
72 @tar cJf ${NAME}-${VERSION}.tar.xz ${NAME}-${VERSION}
73 @rm -rf ${NAME}-${VERSION}
|