DESTDIR = BINDIR = /usr/bin SBINDIR = /usr/sbin MANDIR = /usr/man ETCDIR = /etc VERSION = 1.4 CXXFLAGS += -DNDEBUG CXXFLAGS += -O3 -march=i586 -Wall -pedantic -fno-exceptions -fno-rtti \ -D_GNU_SOURCE -DVERSION=\"$(VERSION)\" LDFLAGS += -ltar -lz OBJECTS = main.o pkgutil.o pkgadd.o pkgrm.o pkginfo.o all: pkgadd pkgmk setwm ports man pkgadd: .depend $(OBJECTS) $(CXX) $(OBJECTS) -o $@ $(LDFLAGS) pkgmk: pkgmk.in setwm: setwm.in ports: ports.in man: pkgadd.8 pkgrm.8 pkginfo.8 pkgmk.8 ports.8 mantxt: man pkgadd.8.txt pkgrm.8.txt pkginfo.8.txt pkgmk.8.txt %.8.txt: %.8 (unset LESSCHARSET; man ./$< | 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 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 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 (cd $(DESTDIR)$(BINDIR); ln -sf pkgadd pkgrm ; ln -sf pkgadd pkginfo) install -D -m0755 adduser $(DESTDIR)$(SBINDIR)/adduser install -D -m0755 setwm $(DESTDIR)$(SBINDIR)/setwm install -D -m0644 setwm.1 $(DESTDIR)$(MANDIR)/man1/setwm.1 clean: rm -f *~ *.o *.8 *.8.txt .depend pkgadd pkgrm pkgmk setwm distclean: clean rm -f pkgadd pkginfo pkgrm pkgmk .depend # End of file