CRUX-ARM : Home

Home :: Documentation :: Download :: Development :: Community :: Ports :: Packages :: Bugs :: Links :: About :: Donors
Prefer archive_entry_mode() over archive_entry_stat().
[pkgutils-cross.git] / Makefile
CommitLineData
9ac667e6
SR
1#
2# pkgutils
3#
4# Copyright (c) 2000-2005 by Per Liden <per@fukt.bth.se>
5#
6# This program is free software; you can redistribute it and/or modify
7# it under the terms of the GNU General Public License as published by
8# the Free Software Foundation; either version 2 of the License, or
9# (at your option) any later version.
10#
11# This program is distributed in the hope that it will be useful,
12# but WITHOUT ANY WARRANTY; without even the implied warranty of
13# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14# GNU General Public License for more details.
15#
16# You should have received a copy of the GNU General Public License
17# along with this program; if not, write to the Free Software
18# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
19# USA.
20#
21
22DESTDIR =
23BINDIR = /usr/bin
24MANDIR = /usr/man
25ETCDIR = /etc
26
27VERSION = 5.21
9ac667e6
SR
28
29CXXFLAGS += -DNDEBUG
30CXXFLAGS += -O2 -Wall -pedantic -D_GNU_SOURCE -DVERSION=\"$(VERSION)\" \
376786d8 31 -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64
9ac667e6 32
c3434674 33LDFLAGS += -static -larchive -lz -lbz2
9ac667e6
SR
34
35OBJECTS = main.o pkgutil.o pkgadd.o pkgrm.o pkginfo.o
36
37MANPAGES = pkgadd.8 pkgrm.8 pkginfo.8 pkgmk.8 rejmerge.8
38
9ac667e6
SR
39all: pkgadd pkgmk rejmerge man
40
c3434674 41pkgadd: .depend $(OBJECTS)
9ac667e6
SR
42 $(CXX) $(OBJECTS) -o $@ $(LDFLAGS)
43
44pkgmk: pkgmk.in
45
46rejmerge: rejmerge.in
47
48man: $(MANPAGES)
49
50mantxt: man $(MANPAGES:=.txt)
51
52%.8.txt: %.8
53 nroff -mandoc -c $< | col -bx > $@
54
55%: %.in
56 sed -e "s/#VERSION#/$(VERSION)/" $< > $@
57
58.depend:
59 $(CXX) $(CXXFLAGS) -MM $(OBJECTS:.o=.cc) > .depend
60
61ifeq (.depend,$(wildcard .depend))
62include .depend
63endif
64
65.PHONY: install clean distclean dist
66
67dist: distclean
68 rm -rf /tmp/pkgutils-$(VERSION)
69 mkdir -p /tmp/pkgutils-$(VERSION)
3309e1f8 70 git-log > ChangeLog
9ac667e6 71 cp -rf . /tmp/pkgutils-$(VERSION)
d7fbaa09 72 tar -C /tmp --exclude .git -czvf ../pkgutils-$(VERSION).tar.gz pkgutils-$(VERSION)
9ac667e6
SR
73 rm -rf /tmp/pkgutils-$(VERSION)
74
75install: all
76 install -D -m0755 pkgadd $(DESTDIR)$(BINDIR)/pkgadd
77 install -D -m0644 pkgadd.conf $(DESTDIR)$(ETCDIR)/pkgadd.conf
78 install -D -m0755 pkgmk $(DESTDIR)$(BINDIR)/pkgmk
79 install -D -m0755 rejmerge $(DESTDIR)$(BINDIR)/rejmerge
80 install -D -m0644 pkgmk.conf $(DESTDIR)$(ETCDIR)/pkgmk.conf
81 install -D -m0644 rejmerge.conf $(DESTDIR)$(ETCDIR)/rejmerge.conf
82 install -D -m0644 pkgadd.8 $(DESTDIR)$(MANDIR)/man8/pkgadd.8
83 install -D -m0644 pkgrm.8 $(DESTDIR)$(MANDIR)/man8/pkgrm.8
84 install -D -m0644 pkginfo.8 $(DESTDIR)$(MANDIR)/man8/pkginfo.8
85 install -D -m0644 pkgmk.8 $(DESTDIR)$(MANDIR)/man8/pkgmk.8
86 install -D -m0644 rejmerge.8 $(DESTDIR)$(MANDIR)/man8/rejmerge.8
87 ln -sf pkgadd $(DESTDIR)$(BINDIR)/pkgrm
88 ln -sf pkgadd $(DESTDIR)$(BINDIR)/pkginfo
89
90clean:
91 rm -f .depend
92 rm -f $(OBJECTS)
93 rm -f $(MANPAGES)
94 rm -f $(MANPAGES:=.txt)
95
96distclean: clean
97 rm -f pkgadd pkginfo pkgrm pkgmk rejmerge
9ac667e6
SR
98
99# End of file