-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
103 lines (80 loc) · 2.88 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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
#
# pkgutils
#
# Copyright (c) 2000-2005 by Per Liden <[email protected]>
# Copyright (c) 2006-2013 by CRUX team (http://crux.nu)
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
# USA.
#
DESTDIR =
BINDIR = /usr/bin
MANDIR = /usr/man
ETCDIR = /etc
VERSION = 5.35.5
NAME = pkgutils-$(VERSION)
CXXFLAGS += -DNDEBUG
CXXFLAGS += -O2 -Wall -pedantic -D_GNU_SOURCE -DVERSION=\"$(VERSION)\" \
-D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64
LIBARCHIVELIBS := $(shell pkg-config --libs --static libarchive)
LDFLAGS += -static $(LIBARCHIVELIBS)
OBJECTS = main.o pkgutil.o pkgadd.o pkgrm.o pkginfo.o
MANPAGES = pkgadd.8 pkgrm.8 pkginfo.8 pkgmk.8 rejmerge.8 pkgmk.conf.5
all: pkgadd pkgmk rejmerge man
pkgadd: .depend $(OBJECTS)
$(CXX) $(OBJECTS) -o $@ $(LDFLAGS)
pkgmk: pkgmk.in
rejmerge: rejmerge.in
man: $(MANPAGES)
mantxt: man $(MANPAGES:=.txt)
%.8.txt: %.8
nroff -mandoc -c $< | col -bx > $@
%: %.in
sed -e "s/#VERSION#/$(VERSION)/" $< > $@
.depend:
$(CXX) $(CXXFLAGS) -MM $(OBJECTS:.o=.cc) > .depend
ifeq (.depend,$(wildcard .depend))
include .depend
endif
.PHONY: install clean distclean dist
dist: distclean
rm -rf $(NAME) $(NAME).tar.gz
git archive --format=tar --prefix=$(NAME)/ HEAD | tar -x
git log > $(NAME)/ChangeLog
tar czvf $(NAME).tar.gz $(NAME)
rm -rf $(NAME)
install: all
install -D -m0755 pkgadd $(DESTDIR)$(BINDIR)/pkgadd
install -D -m0644 pkgadd.conf $(DESTDIR)$(ETCDIR)/pkgadd.conf
install -D -m0755 pkgmk $(DESTDIR)$(BINDIR)/pkgmk
install -D -m0755 rejmerge $(DESTDIR)$(BINDIR)/rejmerge
install -D -m0644 pkgmk.conf $(DESTDIR)$(ETCDIR)/pkgmk.conf
install -D -m0644 rejmerge.conf $(DESTDIR)$(ETCDIR)/rejmerge.conf
install -D -m0644 pkgadd.8 $(DESTDIR)$(MANDIR)/man8/pkgadd.8
install -D -m0644 pkgrm.8 $(DESTDIR)$(MANDIR)/man8/pkgrm.8
install -D -m0644 pkginfo.8 $(DESTDIR)$(MANDIR)/man8/pkginfo.8
install -D -m0644 pkgmk.8 $(DESTDIR)$(MANDIR)/man8/pkgmk.8
install -D -m0644 rejmerge.8 $(DESTDIR)$(MANDIR)/man8/rejmerge.8
install -D -m0644 pkgmk.conf.5 $(DESTDIR)$(MANDIR)/man5/pkgmk.conf.5
ln -sf pkgadd $(DESTDIR)$(BINDIR)/pkgrm
ln -sf pkgadd $(DESTDIR)$(BINDIR)/pkginfo
clean:
rm -f .depend
rm -f $(OBJECTS)
rm -f $(MANPAGES)
rm -f $(MANPAGES:=.txt)
distclean: clean
rm -f pkgadd pkginfo pkgrm pkgmk rejmerge
# End of file