# Makefile for glark # Borrowed/copied from ESR. PACKAGE=glark VERSION=1.8.0 # defaults to nothing; set by RPM during building of RPMs DESTDIR ?= prefix=/usr mandir=$(prefix)/share/man bindir=$(prefix)/bin datadir=$(prefix)/share DOCS = $(PACKAGE).1 $(PACKAGE).pod SRC_FILES = \ share/$(PACKAGE)/env.rb \ share/$(PACKAGE)/extensions.rb \ share/$(PACKAGE)/filetest.rb \ share/$(PACKAGE)/glark.rb \ share/$(PACKAGE)/help.rb \ share/$(PACKAGE)/io.rb \ share/$(PACKAGE)/log.rb \ share/$(PACKAGE)/options.rb \ share/$(PACKAGE)/optproc.rb \ share/$(PACKAGE)/regexp.rb \ share/$(PACKAGE)/text.rb SOURCES = \ $(DOCS) \ $(PACKAGE).spec \ Makefile \ bin/$(PACKAGE) \ $(SRC_FILES) all: install: $(PACKAGE).1 mkdir -p $(DESTDIR)$(bindir) mkdir -p $(DESTDIR)$(mandir)/man1 mkdir -p $(DESTDIR)$(datadir)/$(PACKAGE) cp -p bin/$(PACKAGE) $(DESTDIR)$(bindir) # gzipping the man page conflicts with Mandrake, which bzips it: # gzip <$(PACKAGE).1 >$(DESTDIR)$(mandir)/man1/$(PACKAGE).1.gz cp -p $(PACKAGE).1 $(DESTDIR)$(mandir)/man1/$(PACKAGE).1 cp -p $(SRC_FILES) $(DESTDIR)$(datadir)/$(PACKAGE) uninstall: rm -f $(DESTDIR)$(bindir)/$(PACKAGE) -rm -f $(DESTDIR)$(mandir)/man1/$(PACKAGE).1* -rm -f $(DESTDIR)$(prefix)/man/man1/$(PACKAGE).1* -rm -f $(DESTDIR)$(datadir)/$(PACKAGE)/*.rb -rmdir $(DESTDIR)$(datadir)/$(PACKAGE) # Builds the man page from the POD-format documentation. $(PACKAGE).1: $(PACKAGE).pod Makefile pod2man --release "$(PACKAGE) $(VERSION)" \ --center "$(PACKAGE) $(VERSION)" \ $(PACKAGE).pod > $@ $(PACKAGE)-$(VERSION).tar.gz: $(SOURCES) $(DOCS) @mkdir $(PACKAGE)-$(VERSION) @cp --parents $(SOURCES) $(PACKAGE)-$(VERSION) @tar -czf $(PACKAGE)-$(VERSION).tar.gz $(PACKAGE)-$(VERSION) @rm -fr $(PACKAGE)-$(VERSION) dist: $(PACKAGE)-$(VERSION).tar.gz # The following rules are not for public use. # Builds the HTML version of the man page. doc/www/$(PACKAGE).html: $(PACKAGE).pod pod2html --noindex --verbose --css=$(PACKAGE)man.css $^ > $@