blob: 00418dfd79551cac93cac9208f8a9c129999a2db (
plain)
1 NAME = prt-utils
2 VERSION = 1.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: prtverify revdep/revdep
17
18 install-man:
19 if [ ! -d $(DESTDIR)$(MANDIR)/man1 ]; then \
20 install -d $(DESTDIR)$(MANDIR)/man1; \
21 fi
22 for manpage in $(TOOLS) prt-utils; do \
23 if [ -f $$manpage.1 ]; then \
24 install -m 644 $$manpage.1 $(DESTDIR)$(MANDIR)/man1/; \
25 fi; \
26 done
27
28 install-bin: revdep/revdep
29 if [ ! -d $(DESTDIR)$(BINDIR) ]; then \
30 install -d $(DESTDIR)$(BINDIR); \
31 fi
32 for binary in $(TOOLS); do \
33 install -m 755 $$binary $(DESTDIR)$(BINDIR)/; \
34 done
35
36 install-conf:
37 if [ ! -d $(DESTDIR)$(CONFDIR) ]; then \
38 install -d $(DESTDIR)$(CONFDIR); \
39 fi
40 for tool in $(TOOLS); do \
41 if [ -f $$tool.conf ]; then \
42 install -m 644 $$tool.conf $(DESTDIR)$(CONFDIR)/; \
43 fi; \
44 done
45
46 install-lib:
47 for tool in $(TOOLS); do \
48 if [ -d lib/$$tool ]; then \
49 install -d $(DESTDIR)$(LIBDIR)/$$tool; \
50 install -m 644 lib/$$tool/* $(DESTDIR)$(LIBDIR)/$$tool; \
51 fi; \
52 done
53
54 prtverify:
55 sed "s|@@LIBDIR@@|$(LIBDIR)|" prtverify.in $< > prtverify
56
57 revdep/revdep:
58 @make -C revdep
59
60 install: install-man install-bin install-lib # install-conf
61
62 clean:
63 @rm -f prtverify
64 @make -C revdep clean
65
66 dist: clean
67 @rm -rf ${NAME}-${VERSION}
68 @mkdir .${NAME}-${VERSION}
69 @cp -r * .${NAME}-${VERSION}
70 @mv .${NAME}-${VERSION} ${NAME}-${VERSION}
71 @tar cJf ${NAME}-${VERSION}.tar.xz ${NAME}-${VERSION}
72 @rm -rf ${NAME}-${VERSION}
|