1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47
|
PREFIX=/usr/local
BINDIR=$(PREFIX)/bin
LIBDIR=$(PREFIX)/lib/yarssr
DATADIR=$(PREFIX)/share
LOCALEDIR=$(DATADIR)/locale
LC_CATEGORY=LC_MESSAGES
all: yarssr
yarssr:
@mkdir -p build
perl -ne 's!\@PREFIX\@!$(PREFIX)!g ; s!\@LIBDIR\@!$(LIBDIR)!g ; print' < src/yarssr > build/yarssr
mkdir -p build/locale/en/$(LC_CATEGORY)
msgfmt -o build/locale/en/$(LC_CATEGORY)/yarssr.mo src/po/en.po
install:
mkdir -p $(DESTDIR)/$(BINDIR) \
$(DESTDIR)/$(DATADIR) \
$(DESTDIR)/$(LIBDIR) \
$(DESTDIR)/$(LOCALEDIR)/en/$(LC_CATEGORY)
@echo Copying lib files to $(DESTDIR)/$(DATADIR):
@cp -Rp lib/* $(DESTDIR)/$(LIBDIR)/
@echo Copying share files to $(DESTDIR)/$(DATADIR):
@cp -Rp share/* $(DESTDIR)/$(DATADIR)/
find $(DESTDIR)/$(DATADIR) -type f -exec chmod 644 "{}" \;
find $(DESTDIR)/$(LIBDIR) -type f -exec chmod 644 "{}" \;
install -m 0644 build/locale/en/$(LC_CATEGORY)/yarssr.mo $(DESTDIR)/$(LOCALEDIR)/en/$(LC_CATEGORY)/
install -m 0755 build/yarssr $(DESTDIR)/$(BINDIR)
clean:
rm -rf build
cleancvs:
find . -name CVS -type d -exec rm -rf '{}' \;
uninstall:
rm -rf $(BINDIR)/yarssr \
$(LIBDIR) \
$(DATADIR)/yarssr
.PHONY: all yarssr clean install uninstall
|