File: Makefile.am

package info (click to toggle)
lirc 0.10.1-6
  • links: PTS, VCS
  • area: main
  • in suites: bullseye, sid
  • size: 8,364 kB
  • sloc: ansic: 26,717; cpp: 9,066; sh: 5,521; python: 4,362; makefile: 1,034; xml: 63
file content (224 lines) | stat: -rw-r--r-- 7,683 bytes parent folder | download | duplicates (2)
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
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
## Process this file with automake to produce Makefile.in
## Makefile.am, (c)1999 Tom Wheeley <tw104@york.ac.uk>
ACLOCAL_AMFLAGS         = -I m4

AUTOMAKE_OPTIONS        = 1.5 check-news dist-bzip2 -Wno-portability \
                          subdir-objects

include                 pylint.mak

GIT_COMMIT      = $(shell git log -1 --pretty=format:%h || echo UNKNOWN)
GIT_DATE        = $(shell git log -1 --pretty=format:%cd || echo UNKNOWN)
GIT_REFS        = $(shell git log -1 --pretty=format:%d || echo UNKNOWN)

BASE_VERSION            = $(subst -rc,rc,$(subst -devel,,$(VERSION)))

VERBOSE                 = $(subst 0,,$(V))
AM_LIBTOOLFLAGS         = $(if $(VERBOSE),,--silent)

if HAVE_PYTHON35
PYTHON_TARBALL          = python-pkg/dist/lirc-$(BASE_VERSION).tar.gz
endif

EXTRA_DIST              = README autogen.sh CONTRIBUTE.md ChangeLog \
                          COPYING.curl COPYING.ciniparser

DISTCLEANFILES          = configure.sh  ChangeLog paths.h
CLEANFILES              = *~ remotes/*~ contrib/*~ devinput.lircd.conf
CHANGELOG_REVS          = lirc-0_9_4..HEAD
MANTAINERCLEANFILES     = config.sub install-sh depcomp py-compile \
                          missing libtool plugins/Makefile.am



AM_DISTCHECK_CONFIGURE_FLAGS = \
    --with-systemdsystemunitdir=$${dc_install_base}/lib/systemd/system

BUILT_SOURCES           = paths.h python-pkg/lirc/config.py python-pkg/VERSION

if WITH_SYSTEMDSYSTEMUNITDIR
    SYSTEMD_DIR         = systemd
endif

SUBDIRS                 = lib daemons tools plugins configs doc $(SYSTEMD_DIR)

if INSTALL_ETC

lirc_confdir            = $(sysconfdir)/lirc
dist_lirc_conf_DATA     = lircd.conf \
                          lircmd.conf \
                          lirc_options.conf \
                          irexec.lircrc

lircdconfigdir          = $(sysconfdir)/lirc/lircd.conf.d
dist_lircdconfig_DATA   = README.conf.d

if HAVE_DEVINPUT
nodist_lircdconfig_DATA = devinput.lircd.conf
endif

endif

dist_doc_DATA           = VERSION

nodist_pkgdata_DATA     = $(PYTHON_TARBALL)

pkgconfigdir            = $(libdir)/pkgconfig
dist_pkgconfig_DATA     = lirc.pc lirc-driver.pc

headerdir               = $(includedir)/lirc
nobase_header_HEADERS   = include/media/lirc.h \
                          include/linux/input-event-codes.h
header_HEADERS          = drivers/irpipe/irpipe.h

py_pkgdir               = $(pkgdatadir)/python-pkg
dist_py_pkg_DATA        = python-pkg/setup.py \
                          python-pkg/README.rst

py_pkg_lircdir          = $(pkgdatadir)/python-pkg/lirc
py_PYTHON               = python-pkg/lirc/__init__.py \
                          python-pkg/lirc/database.py \
                          python-pkg/lirc/paths.py

nodist_py_PYTHON        = python-pkg/lirc/config.py
nodist_py_pkg_PYTHON    = python-pkg/lirc/config.py

if HAVE_PYTHON35
py_PYTHON               += python-pkg/lirc/async_client.py \
                          python-pkg/lirc/client.py

py_pkg_testdir          = $(pkgdatadir)/python-pkg/tests
dist_py_pkg_test_DATA   = python-pkg/tests/test_client.py \
                          python-pkg/tests/dummy-server \
                          python-pkg/tests/lircrc.conf
endif

dist_py_pkg_lirc_DATA   = $(py_PYTHON) \
                          python-pkg/lirc/_client.c \
                          python-pkg/lirc/lirctool.py \
                          python-pkg/lirc/lirctool

py_pkg_docdir           = $(pkgdatadir)/python-pkg/lirc/doc
dist_py_pkg_doc_DATA    = python-pkg/doc/Doxyfile \
                          python-pkg/doc/mainpage.dox \
                          python-pkg/doc/diode-2.gif

libpython               = $(libdir)/python$(PYTHON_VERSION)
pydir                   = $(libpython)/site-packages/lirc
py_LTLIBRARIES          = python-pkg/lib/_client.la
python_pkg_lib__client_la_SOURCES = \
                          python-pkg/lirc/_client.c
python_pkg_lib__client_la_CPPFLAGS = \
                          $(PYTHON_CFLAGS) $(AM_CPPFLAGS) \
			  -I$(abs_builddir)/lib -I$(abs_srcdir)/lib

python_pkg_lib__client_la_LDFLAGS  = \
                          -module -avoid-version -export-symbols-regex client \
                          $(PYTHON_LIBS)
python_pkg_lib__client_la_LIBADD = \
                          lib/liblirc_client.la

pylint: .phony
	$(MAKE) -C tools pylint
	-PYTHONPATH=$(PYTHONPATH) $(PYLINT) --rcfile=pylint.conf \
	--msg-template='$(pylint_template)' $(py_PYTHON)

pep8: $(py_PYTHON)
	$(MAKE) -C tools pep8
	python3-pep8 --config=pep8.conf $?

if HAVE_PYTHON35
all-local:
	cd python-pkg; \
	    CFLAGS="-I$(abs_top_srcdir)/lib -I$(abs_builddir)/lib" \
	    LDFLAGS=-L$(abs_builddir)/lib/.libs $(PYTHON) setup.py \
	    $(if $(VERBOSE),,-q) build
endif

install-data-hook:
	$(SED) -i -e '/^plugindir/s|/usr/lib|$(libdir)|' \
	    $(DESTDIR)$(lirc_confdir)/lirc_options.conf
	cp -pr $(srcdir)/contrib $(DESTDIR)$(pkgdatadir)
	chmod u+w $(DESTDIR)$(includedir)
	cd $(DESTDIR)$(includedir)/lirc; ln -s include/media .

uninstall-hook:
	-chmod -R u+w $(DESTDIR)/$(pkgdatadir)/contrib
	-rm -rf $(DESTDIR)/$(pkgdatadir) \
	        $(DESTDIR)/$(pkgpythondir) \
	        $(DESTDIR)/$(pkgdatadir)/contrib \
		$(DESTDIR)$(includedir)/lirc

dist-hook: ChangeLog fix-version
	cp -pr $(srcdir)/contrib $(distdir)

clean-local:
	cd $(builddir)/python-pkg; rm -rf  lirc/__pycache__ lirc.egg-info \
	    lirc/config.py lirc/_client.so tests/__pycache__  VERSION \
	    dist build lib

distclean-local:
	test $(abs_builddir) = $(abs_srcdir) || \
	    rm -rf $(abs_builddir)/python-pkg


maintainer-clean-local:
	find . -name Makefile.in -delete

fix-version: .phony
	chmod u+w $(distdir)/VERSION
	$(SED) -i '/COMMIT/s/=.*/="$(GIT_COMMIT)"/' $(distdir)/VERSION
	$(SED) -i '/DATE/s/=.*/="$(GIT_DATE)"/' $(distdir)/VERSION
	$(SED) -i '/REFS/s|=.*|="$(GIT_REFS)"|' $(distdir)/VERSION

$(abs_builddir)/python-pkg/setup.py:
	cp -ar $(top_srcdir)/python-pkg  $(abs_builddir)
	chmod -R u+w  python-pkg

$(PYTHON_TARBALL): $(abs_builddir)/python-pkg/setup.py
	cp $(top_builddir)/VERSION $(abs_builddir)/python-pkg
	cd $(abs_builddir)/python-pkg; CFLAGS=-I$(abs_top_srcdir)/lib \
	    LDFLAGS=-L$(abs_builddir)/lib/.libs $(PYTHON) setup.py -q sdist

$(top_builddir)/python-pkg/VERSION: VERSION
	cp $? $@

python-pkg/lirc/config.py: Makefile  $(abs_builddir)/python-pkg/setup.py
	@echo '""" Generated by lib/Makefile.am."""' >$@
	@echo 'DATADIR = "$(datadir)"' >>$@
	@echo 'SYSCONFDIR = "$(sysconfdir)"' >>$@
	@echo 'VARRUNDIR = "$(localstatedir)/run"' >>$@
	@echo 'LOCALSTATEDIR = "$(localstatedir)"' >>$@
	@echo 'BINDIR = "$(bindir)"' >>$@
	@echo 'LIBDIR = "$(libdir)"' >>$@
	@echo 'DOCDIR = "$(docdir)"' >>$@
	@echo 'MODINFO = "$(MODINFO)"' >>$@
	@echo 'VERSION = "$(VERSION)"' >>$@

paths.h: Makefile
	@echo "#ifndef PATHS_H"          >paths.h
	@echo "#define PATHS_H"          >>paths.h
	@echo '#define DATADIR          "$(datadir)"' >>paths.h
	@echo '#define SYSCONFDIR       "$(sysconfdir)"' >>paths.h
	@echo '#define VARRUNDIR        "$(runstatedir)"' >>paths.h
	@echo '#define LOCALSTATEDIR    "$(localstatedir)"' >>paths.h
	@echo '#define LIBDIR           "$(libdir)"' >>paths.h
	@echo "#endif"                  >>paths.h

ChangeLog: .phony
	test -s ChangeLog || ( \
	    $(top_srcdir)/git-tools/gitlog-to-changelog $(CHANGELOG_REVS) || \
	        echo "See http://sf.net/p/lirc/git/ci//tree/"  \
	) > ChangeLog

devinput.lircd.conf:
	echo "# Rename to devinput.lircd.dist if not using devinput driver" > $@
	echo "# Re-generate for current kernel using lirc-make-devinput" >> $@
	echo '#' >> $@
	PYTHON=$(PYTHON) \
	    $(srcdir)/tools/lirc-make-devinput $(DEVINPUT_HEADER) >> $@

.phony:

## Apply .SILENT unless $(V) is set and not "0".
$(subst 0,,$(V)).SILENT: