File: Makefile.am

package info (click to toggle)
sensible-utils 0.0.26
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 604 kB
  • sloc: sh: 859; makefile: 122; sed: 88
file content (129 lines) | stat: -rw-r--r-- 3,897 bytes parent folder | download
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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
# part of this makefile are copyied from dpkg
AUTOMAKE_OPTIONS = foreign

man_MANS = sensible-editor.1 sensible-browser.1 sensible-pager.1 select-editor.1 sensible-terminal.1
EXTRA_DIST = sensible-editor.man sensible-browser.man sensible-pager.man select-editor.man sensible-terminal.man

# Extract the list of languages from the po4a config file.
LINGUAS_DIST = `sed -ne 's/^.*\[po4a_langs\] \(.*\)$$/\1/p' $(srcdir)/po4a/po4a.cfg`

# If the user has not defined it let's use the default.
LINGUAS ?= $(LINGUAS_DIST)


update-po:
	$(PO4A_V) $(PO4A) $(PO4A_OPTS) --force $(srcdir)/po4a/po4a.cfg

PO4A_V = $(PO4A_V_@AM_V@)
PO4A_V_ = $(PO4A_V_@AM_DEFAULT_V@)
PO4A_V_0 = @echo "  PO4A   $@";

PO4A_OPTS = --previous --srcdir $(srcdir) --destdir $(builddir) --no-backups \
            --porefs noline --msgmerge-opt=--add-location=file \
            --package-name $(PACKAGE_NAME) #--package-version $(PACKAGE_VERSION) #\
            #--copyright-holder "$(PACKAGE_COPYRIGHT_HOLDER)"# \
	    #--msgid-bugs-address $(PACKAGE_BUGREPORT)

all-local: gen-man

clean-local: clean-local-yes

clean-local-no:
clean-local-yes:
	rm -rf $(LINGUAS_DIST)
	$(AM_V_at) rm -f man.stamp

CLEANFILES = $(man_MANS) messages.mo man.stamp po4a/sensible-utils.pot

# We use the man-once target to guarantee there is never an empty call in
# gen-man, that starts recursing infinitely.
.PHONY: gen-man man-once

gen-man: man.stamp
	for lang in $(LINGUAS); do \
	  files=""; \
	  for man in $(man_MANS); do \
            trans="$${man%%.[0-9]}.man"; \
	    if [ -f $(builddir)/$$lang/$$trans ]; then \
	      files="$$files $(builddir)/$$lang/$$man"; \
	    elif [ -f $(srcdir)/$$lang/$$trans ]; then \
	      files="$$files $(srcdir)/$$lang/$$man"; \
	    fi; \
	  done; \
	  $(MAKE) mandir="$(mandir)/$$lang" man_MANS="" man-once $$files; \
	done

# FIXME: Use a stamp file until po4a supports them internally.
man.stamp:
	$(PO4A_V) $(PO4A) $(PO4A_OPTS) $(srcdir)/po4a/po4a.cfg
	$(AM_V_at) touch $@

SUFFIXES = .man

MANGEN_V = $(MANGEN_V_@AM_V@)
MANGEN_V_ = $(MANGEN_V_@AM_DEFAULT_V@)
MANGEN_V_0 = @echo "  MANGEN $@";

MANGEN = $(MANGEN_V) sed \
	-f $(srcdir)/utf8toman.sed \
	-e 's/%PACKAGE%/$(PACKAGE)/g' \
	-e 's/%VERSION%/$(PACKAGE_VERSION)/g' \
	-e 's/%RELEASE_DATE%/$(PACKAGE_RELEASE_DATE)/g' \
	-e 's:%CONFDIR%:$(sysconfdir):g' \
	-e 's:%LOGDIR%:$(logdir):g' \
	-e 's:%ADMINDIR%:$(admindir):g' \
	-e 's:%PKGDOCDIR%:$(docdir):g' \
	-e 's:%PKGCONFDIR%:$(pkgconfdir):g' \
	-e 's:%PKGLIBDIR%:$(pkglibexecdir):g' \
	-e 's:%PKGDATADIR%:$(pkgdatadir):g'
	$(nil)

.man.1:
	$(MANGEN) $< >$@
.man.5:
	$(MANGEN) $< >$@
.man.8:
	$(MANGEN) $< >$@

install-data-local: install-data-local-yes

install-data-local-no:
install-data-local-yes:
	for lang in $(LINGUAS); do \
	  files=""; \
	  for man in $(man_MANS); do \
            trans="$${man%%.[0-9]}.man"; \
	    if [ -f $(builddir)/$$lang/$$trans ]; then \
	      files="$$files $(builddir)/$$lang/$$man"; \
	    elif [ -f $(srcdir)/$$lang/$$trans ]; then \
	      files="$$files $(srcdir)/$$lang/$$man"; \
	    fi; \
	  done; \
	  $(MAKE) install-man mandir="$(mandir)/$$lang" man_MANS="$$files"; \
	done

uninstall-local: uninstall-local-yes

uninstall-local-no:
uninstall-local-yes:
	for lang in $(LINGUAS); do \
	  files=""; \
	  for man in $(man_MANS); do \
	    trans="$${man%%.[0-9]}.man"; \
	    if [ -f $(builddir)/$$lang/$$trans ]; then \
	      files="$$files $(builddir)/$$lang/$$man"; \
	    elif [ -f $(srcdir)/$$lang/$$trans ]; then \
	      files="$$files $(srcdir)/$$lang/$$man"; \
	    fi; \
	  done; \
	  $(MAKE) uninstall-man mandir="$(mandir)/$$lang" man_MANS="$$files"; \
	done

#dist-hook: man.stamp
#	cp $(srcdir)/man.stamp $(distdir)/
#	for lang in $(LINGUAS_DIST); do \
#	  cp $(srcdir)/po/$$lang.po $(distdir)/po; \
#	  cp $(srcdir)/po/$$lang.add $(distdir)/po; \
#	  $(MKDIR_P) $(distdir)/$$lang; \
#	  cp -R $(srcdir)/$$lang $(distdir)/; \
#	done