chiark / gitweb /
release 176
[elogind.git] / Makefile.am
1 # ------------------------------------------------------------------------------
2 # Copyright (C) 2008-2012 Kay Sievers <kay.sievers@vrfy.org>
3 # Copyright (C) 2009 Diego Elio 'Flameeyes' Pettenò <flameeyes@gmail.com>
4 # ------------------------------------------------------------------------------
5
6 SUBDIRS = .
7
8 ACLOCAL_AMFLAGS = -I m4 ${ACLOCAL_FLAGS}
9
10 AM_MAKEFLAGS = --no-print-directory
11
12 AM_CPPFLAGS = \
13         -include $(top_builddir)/config.h \
14         -I$(top_srcdir)/src \
15         -DSYSCONFDIR=\""$(sysconfdir)"\" \
16         -DPKGLIBEXECDIR=\""$(libexecdir)/udev"\"
17
18 AM_CFLAGS = \
19         ${my_CFLAGS} \
20         -fvisibility=hidden \
21         -ffunction-sections \
22         -fdata-sections
23
24 AM_LDFLAGS = \
25         -Wl,--gc-sections \
26         -Wl,--as-needed
27
28 DISTCHECK_CONFIGURE_FLAGS = \
29         --enable-gtk-doc \
30         --with-systemdsystemunitdir=$$dc_install_base/$(systemdsystemunitdir)
31
32 BUILT_SOURCES =
33 EXTRA_DIST =
34 CLEANFILES =
35 INSTALL_EXEC_HOOKS =
36 INSTALL_DATA_HOOKS =
37 UNINSTALL_EXEC_HOOKS =
38 DISTCHECK_HOOKS =
39 DISTCLEAN_LOCAL_HOOKS =
40
41 udevhomedir = $(libexecdir)/udev
42 udevhome_SCRIPTS =
43 dist_udevhome_SCRIPTS =
44 dist_udevhome_DATA =
45 dist_man_MANS =
46
47 SED_PROCESS = \
48         $(AM_V_GEN)$(MKDIR_P) $(dir $@) && $(SED) \
49         -e 's,@VERSION\@,$(VERSION),g' \
50         -e 's,@prefix\@,$(prefix),g' \
51         -e 's,@rootprefix\@,$(rootprefix),g' \
52         -e 's,@exec_prefix\@,$(exec_prefix),g' \
53         -e 's,@libdir\@,$(libdir),g' \
54         -e 's,@includedir\@,$(includedir),g' \
55         -e 's,@bindir\@,$(bindir),g' \
56         -e 's,@pkglibexecdir\@,$(libexecdir)/udev,g' \
57         < $< > $@ || rm $@
58
59 %.pc: %.pc.in Makefile
60         $(SED_PROCESS)
61
62 %.rules: %.rules.in Makefile
63         $(SED_PROCESS)
64
65 %.service: %.service.in Makefile
66         $(SED_PROCESS)
67
68 %.sh: %.sh.in Makefile
69         $(SED_PROCESS)
70         $(AM_V_GEN)chmod +x $@
71
72 %.pl: %.pl.in Makefile
73         $(SED_PROCESS)
74         $(AM_V_GEN)chmod +x $@
75
76 # ------------------------------------------------------------------------------
77 # libudev
78 # ------------------------------------------------------------------------------
79 LIBUDEV_CURRENT=13
80 LIBUDEV_REVISION=0
81 LIBUDEV_AGE=13
82
83 SUBDIRS += src/docs
84
85 include_HEADERS = src/libudev.h
86 lib_LTLIBRARIES = src/libudev.la
87
88 src_libudev_la_SOURCES =\
89         src/libudev-private.h \
90         src/libudev.c \
91         src/libudev-list.c \
92         src/libudev-util.c \
93         src/libudev-device.c \
94         src/libudev-enumerate.c \
95         src/libudev-monitor.c \
96         src/libudev-queue.c
97
98 src_libudev_la_LDFLAGS = \
99         $(AM_LDFLAGS) \
100         -version-info $(LIBUDEV_CURRENT):$(LIBUDEV_REVISION):$(LIBUDEV_AGE)
101
102 noinst_LTLIBRARIES = \
103         src/libudev-private.la
104
105 src_libudev_private_la_SOURCES =\
106         $(src_libudev_la_SOURCES) \
107         src/libudev-util-private.c \
108         src/libudev-device-private.c \
109         src/libudev-queue-private.c
110
111 if WITH_SELINUX
112 src_libudev_private_la_SOURCES += src/libudev-selinux-private.c
113 src_libudev_private_la_LIBADD = $(SELINUX_LIBS)
114 endif
115
116 pkgconfigdir = $(libdir)/pkgconfig
117 pkgconfig_DATA = src/libudev.pc
118 EXTRA_DIST += src/libudev.pc.in
119 CLEANFILES += src/libudev.pc
120
121 EXTRA_DIST += src/COPYING
122 # move lib from $(libdir) to $(rootlib_execdir) and update devel link, if needed
123 libudev-install-move-hook:
124         if test "$(libdir)" != "$(rootlib_execdir)"; then \
125                 mkdir -p $(DESTDIR)$(rootlib_execdir) && \
126                 so_img_name=$$(readlink $(DESTDIR)$(libdir)/libudev.so) && \
127                 so_img_rel_target_prefix=$$(echo $(libdir) | sed 's,\(^/\|\)[^/][^/]*,..,g') && \
128                 ln -sf $$so_img_rel_target_prefix$(rootlib_execdir)/$$so_img_name $(DESTDIR)$(libdir)/libudev.so && \
129                 mv $(DESTDIR)$(libdir)/libudev.so.* $(DESTDIR)$(rootlib_execdir); \
130         fi
131
132 libudev-uninstall-move-hook:
133         rm -f $(DESTDIR)$(rootlib_execdir)/libudev.so*
134
135 INSTALL_EXEC_HOOKS += libudev-install-move-hook
136 UNINSTALL_EXEC_HOOKS += libudev-uninstall-move-hook
137
138 # ------------------------------------------------------------------------------
139 # main udev
140 # ------------------------------------------------------------------------------
141 udev-confdirs:
142         -mkdir -p $(DESTDIR)$(sysconfdir)/udev/rules.d
143         -mkdir -p $(DESTDIR)$(libexecdir)/udev/devices
144
145 INSTALL_DATA_HOOKS += udev-confdirs
146
147 EXTRA_DIST += \
148         rules/arch \
149         rules/misc
150
151 udevrulesdir = $(libexecdir)/udev/rules.d
152 dist_udevrules_DATA = \
153         rules/rules.d/50-udev-default.rules \
154         rules/rules.d/60-persistent-storage-tape.rules \
155         rules/rules.d/60-persistent-serial.rules \
156         rules/rules.d/60-persistent-input.rules \
157         rules/rules.d/60-persistent-alsa.rules \
158         rules/rules.d/60-persistent-storage.rules \
159         rules/rules.d/75-net-description.rules \
160         rules/rules.d/75-tty-description.rules \
161         rules/rules.d/78-sound-card.rules \
162         rules/rules.d/80-drivers.rules \
163         rules/rules.d/95-udev-late.rules
164
165 udevconfdir = $(sysconfdir)/udev
166 dist_udevconf_DATA = src/udev.conf
167
168 sharepkgconfigdir = $(datadir)/pkgconfig
169 sharepkgconfig_DATA = src/udev.pc
170 EXTRA_DIST += src/udev.pc.in
171 CLEANFILES += src/udev.pc
172
173 if WITH_SYSTEMD
174 dist_systemdsystemunit_DATA = \
175         src/udev-control.socket \
176         src/udev-kernel.socket
177
178 systemdsystemunit_DATA = \
179         src/udev.service \
180         src/udev-trigger.service \
181         src/udev-settle.service
182
183 EXTRA_DIST += \
184         src/udev.service.in \
185         src/udev-trigger.service.in \
186         src/udev-settle.service.in
187
188 CLEANFILES += \
189         src/udev.service \
190         src/udev-trigger.service \
191         src/udev-settle.service
192
193 systemd-install-hook:
194         mkdir -p $(DESTDIR)$(systemdsystemunitdir)/sockets.target.wants
195         ln -sf ../udev-control.socket $(DESTDIR)$(systemdsystemunitdir)/sockets.target.wants/udev-control.socket
196         ln -sf ../udev-kernel.socket $(DESTDIR)$(systemdsystemunitdir)/sockets.target.wants/udev-kernel.socket
197         mkdir -p $(DESTDIR)$(systemdsystemunitdir)/basic.target.wants
198         ln -sf ../udev.service $(DESTDIR)$(systemdsystemunitdir)/basic.target.wants/udev.service
199         ln -sf ../udev-trigger.service $(DESTDIR)$(systemdsystemunitdir)/basic.target.wants/udev-trigger.service
200
201 INSTALL_DATA_HOOKS += systemd-install-hook
202 endif
203
204 bin_PROGRAMS = \
205         src/udevadm
206
207 pkglibexec_PROGRAMS = \
208         src/udevd
209
210 udev_common_sources = \
211         src/udev.h \
212         src/udev-event.c \
213         src/udev-watch.c \
214         src/udev-node.c \
215         src/udev-rules.c \
216         src/udev-ctrl.c \
217         src/udev-builtin.c \
218         src/udev-builtin-blkid.c \
219         src/udev-builtin-firmware.c \
220         src/udev-builtin-hwdb.c \
221         src/udev-builtin-input_id.c \
222         src/udev-builtin-kmod.c \
223         src/udev-builtin-path_id.c \
224         src/udev-builtin-usb_id.c
225
226 udev_common_CFLAGS = \
227         $(BLKID_CFLAGS) \
228         $(KMOD_CFLAGS)
229
230 udev_common_LDADD = \
231         src/libudev-private.la \
232         $(BLKID_LIBS) \
233         $(KMOD_LIBS)
234
235 udev_common_CPPFLAGS = \
236         $(AM_CPPFLAGS) \
237         -DFIRMWARE_PATH="$(FIRMWARE_PATH)" \
238         -DUSB_DATABASE=\"$(USB_DATABASE)\" -DPCI_DATABASE=\"$(PCI_DATABASE)\"
239
240 src_udevd_SOURCES = \
241         $(udev_common_sources) \
242         src/udevd.c \
243         src/sd-daemon.h \
244         src/sd-daemon.c
245 src_udevd_CFLAGS = $(udev_common_CFLAGS)
246 src_udevd_LDADD = $(udev_common_LDADD)
247 src_udevd_CPPFLAGS = $(udev_common_CPPFLAGS)
248
249 src_udevadm_SOURCES = \
250         $(udev_common_sources) \
251         src/udevadm.c \
252         src/udevadm-info.c \
253         src/udevadm-control.c \
254         src/udevadm-monitor.c \
255         src/udevadm-settle.c \
256         src/udevadm-trigger.c \
257         src/udevadm-test.c \
258         src/udevadm-test-builtin.c
259 src_udevadm_CFLAGS = $(udev_common_CFLAGS)
260 src_udevadm_LDADD = $(udev_common_LDADD)
261 src_udevadm_CPPFLAGS = $(udev_common_CPPFLAGS)
262
263 if HAVE_XSLTPROC
264 # ------------------------------------------------------------------------------
265 # udev man pages
266 # ------------------------------------------------------------------------------
267 dist_man_MANS += \
268         src/udev.7 \
269         src/udevadm.8 \
270         src/udevd.8
271
272 dist_noinst_DATA = \
273         src/udev.html \
274         src/udevadm.html \
275         src/udevd.html
276
277 EXTRA_DIST += \
278         src/udev.xml \
279         src/udevadm.xml \
280         src/udevd.xml
281
282 src/%.7 src/%.8 : src/%.xml
283         $(AM_V_GEN)$(XSLTPROC) -o $@ -nonet http://docbook.sourceforge.net/release/xsl/current/manpages/docbook.xsl $<
284
285 src/%.html : src/%.xml
286         $(AM_V_GEN)$(XSLTPROC) -o $@ -nonet http://docbook.sourceforge.net/release/xsl/current/xhtml-1_1/docbook.xsl $<
287 endif
288
289 # ------------------------------------------------------------------------------
290 # udev tests
291 # ------------------------------------------------------------------------------
292 TESTS = \
293         test/udev-test.pl \
294         test/rules-test.sh
295
296 check_PROGRAMS = \
297         src/test-libudev \
298         src/test-udev
299
300 src_test_libudev_SOURCES = src/test-libudev.c
301 src_test_libudev_LDADD = src/libudev.la
302
303 src_test_udev_SOURCES = \
304         $(udev_common_sources) \
305         src/test-udev.c
306 src_test_udev_CFLAGS = $(udev_common_CFLAGS)
307 src_test_udev_LDADD = $(udev_common_LDADD)
308 src_test_udev_CPPFLAGS = $(udev_common_CPPFLAGS)
309
310 # packed sysfs test tree
311 test/sys/kernel/uevent_seqnum:
312         $(AM_V_GEN)mkdir -p test && tar -C test/ -xJf $(top_srcdir)/test/sys.tar.xz
313
314 BUILT_SOURCES += test/sys/kernel/uevent_seqnum
315
316 test-sys-distclean:
317         -rm -rf test/sys
318 DISTCLEAN_LOCAL_HOOKS += test-sys-distclean
319
320 EXTRA_DIST += test/sys.tar.xz
321
322 # ------------------------------------------------------------------------------
323 # ata_id - ATA identify
324 # ------------------------------------------------------------------------------
325 src_extras_ata_id_ata_id_SOURCES = src/extras/ata_id/ata_id.c
326 src_extras_ata_id_ata_id_LDADD = src/libudev-private.la
327 pkglibexec_PROGRAMS += src/extras/ata_id/ata_id
328
329 # ------------------------------------------------------------------------------
330 # cdrom_id - optical drive/media capability
331 # ------------------------------------------------------------------------------
332 src_extras_cdrom_id_cdrom_id_SOURCES = src/extras/cdrom_id/cdrom_id.c
333 src_extras_cdrom_id_cdrom_id_LDADD = src/libudev-private.la
334 pkglibexec_PROGRAMS += src/extras/cdrom_id/cdrom_id
335 dist_udevrules_DATA += src/extras/cdrom_id/60-cdrom_id.rules
336
337 # ------------------------------------------------------------------------------
338 # collect - trigger action when a collection of devices appeared
339 # ------------------------------------------------------------------------------
340 src_extras_collect_collect_SOURCES = src/extras/collect/collect.c
341 src_extras_collect_collect_LDADD = src/libudev-private.la
342 pkglibexec_PROGRAMS += src/extras/collect/collect
343
344 # ------------------------------------------------------------------------------
345 # scsi_id - SCSI inquiry to get various serial numbers
346 # ------------------------------------------------------------------------------
347 src_extras_scsi_id_scsi_id_SOURCES =\
348         src/extras/scsi_id/scsi_id.c \
349         src/extras/scsi_id/scsi_serial.c \
350         src/extras/scsi_id/scsi.h \
351         src/extras/scsi_id/scsi_id.h
352 src_extras_scsi_id_scsi_id_LDADD = src/libudev-private.la
353 pkglibexec_PROGRAMS += src/extras/scsi_id/scsi_id
354 dist_man_MANS += src/extras/scsi_id/scsi_id.8
355 EXTRA_DIST += src/extras/scsi_id/README
356
357 # ------------------------------------------------------------------------------
358 # v4l_id - video4linux capabilities
359 # ------------------------------------------------------------------------------
360 src_extras_v4l_id_v4l_id_SOURCES = src/extras/v4l_id/v4l_id.c
361 src_extras_v4l_id_v4l_id_LDADD = src/libudev-private.la
362 pkglibexec_PROGRAMS += src/extras/v4l_id/v4l_id
363 dist_udevrules_DATA += src/extras/v4l_id/60-persistent-v4l.rules
364
365 # ------------------------------------------------------------------------------
366 # accelerometer - updates device orientation
367 # ------------------------------------------------------------------------------
368 src_extras_accelerometer_accelerometer_SOURCES = src/extras/accelerometer/accelerometer.c
369 src_extras_accelerometer_accelerometer_LDADD = src/libudev-private.la -lm
370 pkglibexec_PROGRAMS += src/extras/accelerometer/accelerometer
371 dist_udevrules_DATA += src/extras/accelerometer/61-accelerometer.rules
372
373 # ------------------------------------------------------------------------------
374 # qemu -- qemu/kvm guest tweaks
375 # ------------------------------------------------------------------------------
376 dist_udevrules_DATA += src/extras/qemu/42-qemu-usb.rules
377
378 if ENABLE_GUDEV
379 # ------------------------------------------------------------------------------
380 # GUdev - libudev gobject interface
381 # ------------------------------------------------------------------------------
382 LIBGUDEV_CURRENT=1
383 LIBGUDEV_REVISION=1
384 LIBGUDEV_AGE=1
385
386 SUBDIRS += src/extras/gudev/docs
387
388 src_extras_gudev_libgudev_includedir=$(includedir)/gudev-1.0/gudev
389 src_extras_gudev_libgudev_include_HEADERS = \
390         src/extras/gudev/gudev.h \
391         src/extras/gudev/gudevenums.h \
392         src/extras/gudev/gudevenumtypes.h \
393         src/extras/gudev/gudevtypes.h \
394         src/extras/gudev/gudevclient.h \
395         src/extras/gudev/gudevdevice.h \
396         src/extras/gudev/gudevenumerator.h
397
398 lib_LTLIBRARIES += src/extras/gudev/libgudev-1.0.la
399
400 pkgconfig_DATA += src/extras/gudev/gudev-1.0.pc
401 EXTRA_DIST += src/extras/gudev/gudev-1.0.pc.in
402 CLEANFILES += src/extras/gudev/gudev-1.0.pc
403
404 src_extras_gudev_libgudev_1_0_la_SOURCES = \
405         src/extras/gudev/gudevenums.h \
406         src/extras/gudev/gudevenumtypes.h \
407         src/extras/gudev/gudevenumtypes.h\
408         src/extras/gudev/gudevtypes.h \
409         src/extras/gudev/gudevclient.h \
410         src/extras/gudev/gudevclient.c \
411         src/extras/gudev/gudevdevice.h \
412         src/extras/gudev/gudevdevice.c \
413         src/extras/gudev/gudevenumerator.h \
414         src/extras/gudev/gudevenumerator.c \
415         src/extras/gudev/gudevprivate.h
416
417 nodist_src_extras_gudev_libgudev_1_0_la_SOURCES = \
418         src/extras/gudev/gudevmarshal.h \
419         src/extras/gudev/gudevmarshal.c \
420         src/extras/gudev/gudevenumtypes.h \
421         src/extras/gudev/gudevenumtypes.c
422 BUILT_SOURCES += $(nodist_src_extras_gudev_libgudev_1_0_la_SOURCES)
423
424 src_extras_gudev_libgudev_1_0_la_CPPFLAGS = \
425         $(AM_CPPFLAGS) \
426         -I$(top_builddir)/src/extras \
427         -I$(top_srcdir)/src/extras \
428         -I$(top_builddir)/src/extras/gudev \
429         -I$(top_srcdir)/src/extras/gudev \
430         -D_POSIX_PTHREAD_SEMANTICS -D_REENTRANT \
431         -D_GUDEV_COMPILATION \
432         -DG_LOG_DOMAIN=\"GUdev\"
433
434 src_extras_gudev_libgudev_1_0_la_CFLAGS = \
435         -fvisibility=default \
436         $(GLIB_CFLAGS)
437
438 src_extras_gudev_libgudev_1_0_la_LIBADD = src/libudev.la $(GLIB_LIBS)
439
440 src_extras_gudev_libgudev_1_0_la_LDFLAGS = \
441         -version-info $(LIBGUDEV_CURRENT):$(LIBGUDEV_REVISION):$(LIBGUDEV_AGE) \
442         -export-dynamic -no-undefined \
443         -export-symbols-regex '^g_udev_.*'
444
445 EXTRA_DIST += \
446         src/extras/gudev/COPYING \
447         src/extras/gudev/gudevmarshal.list \
448         src/extras/gudev/gudevenumtypes.h.template \
449         src/extras/gudev/gudevenumtypes.c.template \
450         src/extras/gudev/gjs-example.js \
451         src/extras/gudev/seed-example-enum.js \
452         src/extras/gudev/seed-example.js
453
454 src/extras/gudev/gudevmarshal.h: src/extras/gudev/gudevmarshal.list
455         $(AM_V_GEN)glib-genmarshal $< --prefix=g_udev_marshal --header > $@
456
457 src/extras/gudev/gudevmarshal.c: src/extras/gudev/gudevmarshal.list
458         $(AM_V_GEN)echo "#include \"gudevmarshal.h\"" > $@ && \
459         glib-genmarshal $< --prefix=g_udev_marshal --body >> $@
460
461 src/extras/gudev/gudevenumtypes.h: src/extras/gudev/gudevenumtypes.h.template src/extras/gudev/gudevenums.h
462         $(AM_V_GEN)glib-mkenums --template $^ > \
463             $@.tmp && mv $@.tmp $@
464
465 src/extras/gudev/gudevenumtypes.c: src/extras/gudev/gudevenumtypes.c.template src/extras/gudev/gudevenums.h
466         $(AM_V_GEN)glib-mkenums --template $^ > \
467             $@.tmp && mv $@.tmp $@
468
469 if ENABLE_INTROSPECTION
470 src/extras/gudev/GUdev-1.0.gir: src/extras/gudev/libgudev-1.0.la $(G_IR_SCANNER)
471         $(AM_V_GEN)$(G_IR_SCANNER) -v \
472                 --warn-all \
473                 --namespace GUdev \
474                 --nsversion=1.0 \
475                 --include=GObject-2.0 \
476                 --library=gudev-1.0 \
477                 --library-path=$(top_builddir)/src \
478                 --library-path=$(top_builddir)/src/extras/gudev \
479                 --output $@ \
480                 --pkg=glib-2.0 \
481                 --pkg=gobject-2.0 \
482                 -I$(top_srcdir)/src/extras \
483                 -I$(top_builddir)/src/extras \
484                 -D_GUDEV_COMPILATION \
485                 -D_GUDEV_WORK_AROUND_DEV_T_BUG \
486                 $(top_srcdir)/src/extras/gudev/gudev.h \
487                 $(top_srcdir)/src/extras/gudev/gudevtypes.h \
488                 $(top_srcdir)/src/extras/gudev/gudevenums.h \
489                 $(or $(wildcard $(top_builddir)/src/extras/gudev/gudevenumtypes.h),$(top_srcdir)/src/extras/gudev/gudevenumtypes.h) \
490                 $(top_srcdir)/src/extras/gudev/gudevclient.h \
491                 $(top_srcdir)/src/extras/gudev/gudevdevice.h \
492                 $(top_srcdir)/src/extras/gudev/gudevenumerator.h \
493                 $(top_srcdir)/src/extras/gudev/gudevclient.c \
494                 $(top_srcdir)/src/extras/gudev/gudevdevice.c \
495                 $(top_srcdir)/src/extras/gudev/gudevenumerator.c
496
497 src/extras/gudev/GUdev-1.0.typelib: src/extras/gudev/GUdev-1.0.gir $(G_IR_COMPILER)
498         $(AM_V_GEN)g-ir-compiler $< -o $@
499
500 girdir = $(GIRDIR)
501 gir_DATA = src/extras/gudev/GUdev-1.0.gir
502
503 typelibsdir = $(GIRTYPELIBDIR)
504 typelibs_DATA = src/extras/gudev/GUdev-1.0.typelib
505
506 CLEANFILES += $(gir_DATA) $(typelibs_DATA)
507 endif # ENABLE_INTROSPECTION
508
509 # move lib from $(libdir) to $(rootlib_execdir) and update devel link, if needed
510 libgudev-install-move-hook:
511         if test "$(libdir)" != "$(rootlib_execdir)"; then \
512                 mkdir -p $(DESTDIR)$(rootlib_execdir) && \
513                 so_img_name=$$(readlink $(DESTDIR)$(libdir)/libgudev-1.0.so) && \
514                 so_img_rel_target_prefix=$$(echo $(libdir) | sed 's,\(^/\|\)[^/][^/]*,..,g') && \
515                 ln -sf $$so_img_rel_target_prefix$(rootlib_execdir)/$$so_img_name $(DESTDIR)$(libdir)/libgudev-1.0.so && \
516                 mv $(DESTDIR)$(libdir)/libgudev-1.0.so.* $(DESTDIR)$(rootlib_execdir); \
517         fi
518
519 libgudev-uninstall-move-hook:
520         rm -f $(DESTDIR)$(rootlib_execdir)/libgudev-1.0.so*
521
522 INSTALL_EXEC_HOOKS += libgudev-install-move-hook
523 UNINSTALL_EXEC_HOOKS += libgudev-uninstall-move-hook
524 endif
525
526 if ENABLE_KEYMAP
527 # ------------------------------------------------------------------------------
528 # keymap - map custom hardware's multimedia keys
529 # ------------------------------------------------------------------------------
530 src_extras_keymap_keymap_SOURCES = src/extras/keymap/keymap.c
531 src_extras_keymap_keymap_CPPFLAGS = $(AM_CPPFLAGS) -I src/extras/keymap
532 nodist_src_extras_keymap_keymap_SOURCES = \
533         src/extras/keymap/keys-from-name.h \
534         src/extras/keymap/keys-to-name.h
535 BUILT_SOURCES += $(nodist_src_extras_keymap_keymap_SOURCES)
536
537 pkglibexec_PROGRAMS += src/extras/keymap/keymap
538 dist_doc_DATA = src/extras/keymap/README.keymap.txt
539
540 dist_udevrules_DATA += \
541         src/extras/keymap/95-keymap.rules \
542         src/extras/keymap/95-keyboard-force-release.rules
543
544 dist_udevhome_SCRIPTS += src/extras/keymap/findkeyboards
545 udevhome_SCRIPTS += src/extras/keymap/keyboard-force-release.sh
546
547 EXTRA_DIST += \
548         src/extras/keymap/check-keymaps.sh \
549         src/extras/keymap/keyboard-force-release.sh.in
550
551 CLEANFILES += \
552         src/extras/keymap/keys.txt \
553         src/extras/keymap/keys-from-name.gperf \
554         src/extras/keymap/keyboard-force-release.sh
555
556 udevkeymapdir = $(libexecdir)/udev/keymaps
557 dist_udevkeymap_DATA = \
558         src/extras/keymap/keymaps/acer \
559         src/extras/keymap/keymaps/acer-aspire_5720 \
560         src/extras/keymap/keymaps/acer-aspire_8930 \
561         src/extras/keymap/keymaps/acer-aspire_5920g \
562         src/extras/keymap/keymaps/acer-aspire_6920 \
563         src/extras/keymap/keymaps/acer-travelmate_c300 \
564         src/extras/keymap/keymaps/asus \
565         src/extras/keymap/keymaps/compaq-e_evo \
566         src/extras/keymap/keymaps/dell \
567         src/extras/keymap/keymaps/dell-latitude-xt2 \
568         src/extras/keymap/keymaps/everex-xt5000 \
569         src/extras/keymap/keymaps/fujitsu-amilo_pa_2548 \
570         src/extras/keymap/keymaps/fujitsu-amilo_pro_edition_v3505 \
571         src/extras/keymap/keymaps/fujitsu-amilo_pro_v3205 \
572         src/extras/keymap/keymaps/fujitsu-amilo_si_1520 \
573         src/extras/keymap/keymaps/fujitsu-esprimo_mobile_v5 \
574         src/extras/keymap/keymaps/fujitsu-esprimo_mobile_v6 \
575         src/extras/keymap/keymaps/genius-slimstar-320 \
576         src/extras/keymap/keymaps/hewlett-packard \
577         src/extras/keymap/keymaps/hewlett-packard-2510p_2530p \
578         src/extras/keymap/keymaps/hewlett-packard-compaq_elitebook \
579         src/extras/keymap/keymaps/hewlett-packard-pavilion \
580         src/extras/keymap/keymaps/hewlett-packard-presario-2100 \
581         src/extras/keymap/keymaps/hewlett-packard-tablet \
582         src/extras/keymap/keymaps/hewlett-packard-tx2 \
583         src/extras/keymap/keymaps/ibm-thinkpad-usb-keyboard-trackpoint \
584         src/extras/keymap/keymaps/inventec-symphony_6.0_7.0 \
585         src/extras/keymap/keymaps/lenovo-3000 \
586         src/extras/keymap/keymaps/lenovo-ideapad \
587         src/extras/keymap/keymaps/lenovo-thinkpad-usb-keyboard-trackpoint \
588         src/extras/keymap/keymaps/lenovo-thinkpad_x6_tablet \
589         src/extras/keymap/keymaps/lenovo-thinkpad_x200_tablet \
590         src/extras/keymap/keymaps/lg-x110 \
591         src/extras/keymap/keymaps/logitech-wave \
592         src/extras/keymap/keymaps/logitech-wave-cordless \
593         src/extras/keymap/keymaps/logitech-wave-pro-cordless \
594         src/extras/keymap/keymaps/maxdata-pro_7000 \
595         src/extras/keymap/keymaps/medion-fid2060 \
596         src/extras/keymap/keymaps/medionnb-a555 \
597         src/extras/keymap/keymaps/micro-star \
598         src/extras/keymap/keymaps/module-asus-w3j \
599         src/extras/keymap/keymaps/module-ibm \
600         src/extras/keymap/keymaps/module-lenovo \
601         src/extras/keymap/keymaps/module-sony \
602         src/extras/keymap/keymaps/module-sony-old \
603         src/extras/keymap/keymaps/module-sony-vgn \
604         src/extras/keymap/keymaps/olpc-xo \
605         src/extras/keymap/keymaps/onkyo \
606         src/extras/keymap/keymaps/oqo-model2 \
607         src/extras/keymap/keymaps/samsung-other \
608         src/extras/keymap/keymaps/samsung-sq1us \
609         src/extras/keymap/keymaps/samsung-sx20s \
610         src/extras/keymap/keymaps/toshiba-satellite_a100 \
611         src/extras/keymap/keymaps/toshiba-satellite_a110 \
612         src/extras/keymap/keymaps/toshiba-satellite_m30x \
613         src/extras/keymap/keymaps/zepto-znote
614
615 udevkeymapforcereldir = $(libexecdir)/udev/keymaps/force-release
616 dist_udevkeymapforcerel_DATA = \
617         src/extras/keymap/force-release-maps/dell-touchpad \
618         src/extras/keymap/force-release-maps/hp-other \
619         src/extras/keymap/force-release-maps/samsung-other \
620         src/extras/keymap/force-release-maps/common-volume-keys
621
622 src/extras/keymap/keys.txt: $(INCLUDE_PREFIX)/linux/input.h
623         $(AM_V_at)mkdir -p src/extras/keymap
624         $(AM_V_GEN)$(AWK) '/^#define.*KEY_[^ ]+[ \t]+[0-9]/ { if ($$2 != "KEY_MAX") { print $$2 } }' < $< | sed 's/^KEY_COFFEE$$/KEY_SCREENLOCK/' > $@
625
626 src/extras/keymap/keys-from-name.gperf: src/extras/keymap/keys.txt
627         $(AM_V_GEN)$(AWK) 'BEGIN{ print "struct key { const char* name; unsigned short id; };"; print "%null-strings"; print "%%";} { print $$1 ", " $$1 }' < $< > $@
628
629 src/extras/keymap/keys-from-name.h: src/extras/keymap/keys-from-name.gperf Makefile
630         $(AM_V_GEN)$(GPERF) -L ANSI-C -t --ignore-case -N lookup_key -H hash_key_name -p -C < $< > $@
631
632 src/extras/keymap/keys-to-name.h: src/extras/keymap/keys.txt Makefile
633         $(AM_V_GEN)$(AWK) 'BEGIN{ print "const char* const key_names[KEY_CNT] = { "} { print "[" $$1 "] = \"" $$1 "\"," } END{print "};"}' < $< > $@
634
635 keymaps-distcheck-hook: src/extras/keymap/keys.txt
636         $(top_srcdir)/src/extras/keymap/check-keymaps.sh $(top_srcdir) $^
637 DISTCHECK_HOOKS += keymaps-distcheck-hook
638 endif
639
640 if ENABLE_MTD_PROBE
641 # ------------------------------------------------------------------------------
642 # mtd_probe - autoloads FTL module for mtd devices
643 # ------------------------------------------------------------------------------
644 src_extras_mtd_probe_mtd_probe_SOURCES =  \
645         src/extras/mtd_probe/mtd_probe.c \
646         src/extras/mtd_probe/mtd_probe.h \
647         src/extras/mtd_probe/probe_smartmedia.c
648 src_extras_mtd_probe_mtd_probe_CPPFLAGS = $(AM_CPPFLAGS)
649 dist_udevrules_DATA += src/extras/mtd_probe/75-probe_mtd.rules
650 pkglibexec_PROGRAMS += src/extras/mtd_probe/mtd_probe
651 endif
652
653 if ENABLE_RULE_GENERATOR
654 # ------------------------------------------------------------------------------
655 # rule_generator - persistent network and optical device rule generator
656 # ------------------------------------------------------------------------------
657 dist_udevhome_SCRIPTS += \
658         src/extras/rule_generator/write_cd_rules \
659         src/extras/rule_generator/write_net_rules
660
661 udevhome_DATA = src/extras/rule_generator/rule_generator.functions
662 dist_udevhome_DATA += \
663         src/extras/rule_generator/75-cd-aliases-generator.rules \
664         src/extras/rule_generator/75-persistent-net-generator.rules
665 endif
666
667 if ENABLE_UDEV_ACL
668 # ------------------------------------------------------------------------------
669 # udev_acl - apply ACLs for users with local forground sessions
670 # ------------------------------------------------------------------------------
671 src_udev_acl_SOURCES = src/extras/udev-acl/udev-acl.c
672 src_udev_acl_CPPFLAGS = $(AM_CPPFLAGS) $(GLIB_CFLAGS)
673 src_udev_acl_LDADD = src/libudev-private.la -lacl $(GLIB_LIBS)
674 dist_udevrules_DATA += src/extras/udev-acl/70-udev-acl.rules
675 pkglibexec_PROGRAMS += src/udev-acl
676
677 udevacl-install-hook:
678         mkdir -p $(DESTDIR)$(prefix)/lib/ConsoleKit/run-seat.d
679         ln -sf $(libexecdir)/udev/udev-acl $(DESTDIR)$(prefix)/lib/ConsoleKit/run-seat.d/udev-acl.ck
680
681 INSTALL_EXEC_HOOKS += udevacl-install-hook
682 endif
683
684 if ENABLE_FLOPPY
685 # ------------------------------------------------------------------------------
686 # create_floppy_devices - historical floppy kernel device nodes (/dev/fd0h1440, ...)
687 # ------------------------------------------------------------------------------
688 src_create_floppy_devices_SOURCES = src/extras/floppy/create_floppy_devices.c
689 src_create_floppy_devices_LDADD = src/libudev-private.la
690 pkglibexec_PROGRAMS += src/create_floppy_devices
691 dist_udevrules_DATA += src/extras/floppy/60-floppy.rules
692 endif
693
694 if ENABLE_EDD
695 # ------------------------------------------------------------------------------
696 # edd_id - create /dev/disk/by-id/edd-* links for BIOS EDD data
697 # ------------------------------------------------------------------------------
698 src_edd_id_SOURCES = src/extras/edd_id/edd_id.c
699 src_edd_id_LDADD = src/libudev-private.la
700 pkglibexec_PROGRAMS += src/edd_id
701 dist_udevrules_DATA += src/extras/edd_id/61-persistent-storage-edd.rules
702 endif
703
704 # ------------------------------------------------------------------------------
705 # install, uninstall, clean hooks
706 # ------------------------------------------------------------------------------
707 clean-local:
708         rm -rf udev-test-install
709
710 distclean-local:
711         rm -rf autom4te.cache
712
713 EXTRA_DIST += \
714         $(TESTS) \
715         test/rule-syntax-check.py
716
717 CLEANFILES += \
718         $(BUILT_SOURCES)
719
720 install-exec-hook: $(INSTALL_EXEC_HOOKS)
721
722 install-data-hook: $(INSTALL_DATA_HOOKS)
723
724 uninstall-hook: $(UNINSTALL_EXEC_HOOKS)
725
726 distcheck-hook: $(DISTCHECK_HOOKS)
727
728 distclean-local: $(DISTCLEAN_LOCAL_HOOKS)
729
730 # ------------------------------------------------------------------------------
731 # custom release helpers
732 # ------------------------------------------------------------------------------
733 PREVIOUS_VERSION = `expr $(VERSION) - 1`
734 changelog:
735         @ head -1 ChangeLog | grep -q "to v$(PREVIOUS_VERSION)"
736         @ mv ChangeLog ChangeLog.tmp
737         @ echo "Summary of changes from v$(PREVIOUS_VERSION) to v$(VERSION)" >> ChangeLog
738         @ echo "============================================" >> ChangeLog
739         @ echo >> ChangeLog
740         @ git log --pretty=short $(PREVIOUS_VERSION)..HEAD | git shortlog  >> ChangeLog
741         @ echo >> ChangeLog
742         @ cat ChangeLog
743         @ cat ChangeLog.tmp >> ChangeLog
744         @ rm ChangeLog.tmp
745
746 test-install:
747         rm -rf $(PWD)/udev-test-install/
748         make DESTDIR=$(PWD)/udev-test-install install
749         tree $(PWD)/udev-test-install/
750
751 git-release:
752         head -1 ChangeLog | grep -q "to v$(VERSION)"
753         head -1 NEWS | grep -q "udev $(VERSION)"
754         git commit -a -m "release $(VERSION)"
755         git tag -m "udev $(VERSION)" -s $(VERSION)
756         git gc --prune=0
757
758 tar:
759         make distcheck
760         gpg --armor --detach-sign udev-$(VERSION).tar.xz
761
762 git-sync:
763         git push
764         git push --tags $(VERSION)
765
766 tar-sync:
767         scp udev-$(VERSION).tar.xz master.kernel.org:/pub/linux/utils/kernel/hotplug/
768
769 doc-sync:
770         rsync -av src/*.html master.kernel.org:/pub/linux/utils/kernel/hotplug/udev/
771         rsync -av --delete src/docs/html/ master.kernel.org:/pub/linux/utils/kernel/hotplug/src/
772         rsync -av --delete src/extras/gudev/docs/html/ master.kernel.org:/pub/linux/utils/kernel/hotplug/gudev/