CRUX-ARM : Home

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