DESTDIR = BINDIR = /usr/bin SBINDIR = /usr/sbin MANDIR = /usr/share/man ETCDIR = /etc VERSION = 2.4 LIBTAR_VERSION = 1.2.9 CXXFLAGS += -DNDEBUG CXXFLAGS += -O3 -march=i586 -Wall -pedantic -fno-exceptions -fno-rtti \ -D_GNU_SOURCE -DVERSION=\"$(VERSION)\" \ -Ilibtar-$(LIBTAR_VERSION)/lib -Ilibtar-$(LIBTAR_VERSION)/listhash LDFLAGS += -static -Llibtar-$(LIBTAR_VERSION)/lib -ltar -lz OBJECTS = main.o pkgutil.o pkgadd.o pkgrm.o pkginfo.o LIBTAR = libtar-$(LIBTAR_VERSION)/lib/libtar.a all: $(LIBTAR) pkgadd pkgmk setwm sndtest ports adduser sstart sstop srestart man rpm2targz rpmoffset $(LIBTAR): (tar xzf libtar-$(LIBTAR_VERSION).tar.gz; \ cd libtar-$(LIBTAR_VERSION); \ LDFLAGS="" ./configure --disable-encap --disable-encap-install; \ make;) pkgadd: .depend $(OBJECTS) $(CXX) $(OBJECTS) -o $@ $(LDFLAGS) pkgmk: pkgmk.in adduser: adduser.in setwm: setwm.in sndtest: sndtest.in ports: ports.in sstart: sstart.in sstop: sstop.in srestart: srestart.in rpm2targz: rpm2targz.in man: pkgadd.8 pkgrm.8 pkginfo.8 pkgmk.8 ports.8 setwm.8 sndtest.8 adduser.8 ports.conf.5 pkgadd.conf.5 sstart.8 sstop.8 srestart.8 mantxt: man pkgadd.8.txt pkgrm.8.txt pkginfo.8.txt pkgmk.8.txt setwm.8.txt ports.8.txt sndtest.8.txt adduser.8.txt ports.conf.5.txt pkgadd.conf.5.txt sstart.8.txt sstop.8.txt srestart.8.txt %.8.txt: %.8 (unset LESSCHARSET; man ./$< | col -bx > $@) %: %.in sed -e "s/#VERSION#/$(VERSION)/" $< > $@ rpmoffset: $(CC) rpmoffset.c -o rpmoffset .depend: $(CXX) $(CXXFLAGS) -MM $(OBJECTS:.o=.cc) > .depend ifeq (.depend,$(wildcard .depend)) include .depend endif .PHONY: install clean distclean dist 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 -m0644 pkgmk.conf $(DESTDIR)$(ETCDIR)/pkgmk.conf install -D -m0755 ports $(DESTDIR)$(BINDIR)/ports install -D -m0644 ports.conf $(DESTDIR)$(ETCDIR)/ports.conf install -D -m0644 pkgadd.8 $(DESTDIR)$(MANDIR)/man8/pkgadd.8 install -D -m0644 pkgadd.conf.5 $(DESTDIR)$(MANDIR)/man5/pkgadd.conf.5 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 ports.8 $(DESTDIR)$(MANDIR)/man8/ports.8 install -D -m0644 ports.conf.5 $(DESTDIR)$(MANDIR)/man5/ports.conf.5 (cd $(DESTDIR)$(BINDIR); ln -sf pkgadd pkgrm ; ln -sf pkgadd pkginfo) install -D -m0755 adduser $(DESTDIR)$(SBINDIR)/adduser install -D -m0644 adduser.8 $(DESTDIR)$(MANDIR)/man8/adduser.8 install -D -m0755 setwm $(DESTDIR)$(BINDIR)/setwm install -D -m0644 setwm.8 $(DESTDIR)$(MANDIR)/man8/setwm.8 install -D -m0755 sndtest $(DESTDIR)$(BINDIR)/sndtest install -D -m0644 sndtest.8 $(DESTDIR)$(MANDIR)/man8/sndtest.8 install -D -m0755 sstart $(DESTDIR)$(SBINDIR)/sstart install -D -m0755 sstop $(DESTDIR)$(SBINDIR)/sstop install -D -m0755 srestart $(DESTDIR)$(SBINDIR)/srestart install -D -m0644 sstart.8 $(DESTDIR)$(MANDIR)/man8/sstart.8 install -D -m0644 sstop.8 $(DESTDIR)$(MANDIR)/man8/sstop.8 install -D -m0644 srestart.8 $(DESTDIR)$(MANDIR)/man8/srestart.8 install -D -m0755 rpm2targz $(DESTDIR)$(BINDIR)/rpm2targz install -D -m0755 rpmoffset $(DESTDIR)/usr/lib/rpm2targz/rpmoffset clean: rm -f *~ *.o *.8 *.8.txt *.5 *.5.txt .depend pkgadd pkgrm pkgmk setwm ports sndtest adduser sstart sstop srestart rpm2targz rpmoffset rm -rf libtar-$(LIBTAR_VERSION) distclean: clean # End of file