chiark / gitweb /
rules: drop OSS audio rule
[elogind.git] / Makefile.am
1 # ------------------------------------------------------------------------------
2 # Copyright (C) 2008-2009 Kay Sievers <kay.sievers@vrfy.org>
3 # Copyright (C) 2009 Diego Elio 'Flameeyes' Pettenò <flameeyes@gmail.com>
4 # ------------------------------------------------------------------------------
5
6 SUBDIRS = .
7
8 EXTRA_DIST = autogen.sh
9
10 ACLOCAL_AMFLAGS = -I m4
11
12 AM_MAKEFLAGS = --no-print-directory
13
14 AM_CPPFLAGS = \
15         -include $(top_builddir)/config.h \
16         -I$(top_srcdir)/libudev \
17         -DSYSCONFDIR=\""$(sysconfdir)"\" \
18         -DLIBEXECDIR=\""$(libexecdir)"\"
19
20 AM_LDFLAGS = \
21         -Wl,--as-needed
22
23 DISTCHECK_CONFIGURE_FLAGS = \
24         --enable-gtk-doc \
25         --with-systemdsystemunitdir=$$dc_install_base/$(systemdsystemunitdir)
26
27 CLEANFILES =
28
29 INSTALL_EXEC_HOOKS =
30 INSTALL_DATA_HOOKS =
31 UNINSTALL_EXEC_HOOKS =
32 DISTCHECK_HOOKS =
33
34 # ------------------------------------------------------------------------------
35 # libudev
36 # ------------------------------------------------------------------------------
37 LIBUDEV_CURRENT=9
38 LIBUDEV_REVISION=3
39 LIBUDEV_AGE=9
40
41 SUBDIRS += libudev/docs
42
43 include_HEADERS = libudev/libudev.h
44 lib_LTLIBRARIES = libudev/libudev.la
45
46 libudev_libudev_la_SOURCES =\
47         libudev/libudev-private.h \
48         libudev/libudev.c \
49         libudev/libudev-list.c \
50         libudev/libudev-util.c \
51         libudev/libudev-device.c \
52         libudev/libudev-enumerate.c \
53         libudev/libudev-monitor.c \
54         libudev/libudev-queue.c
55
56 libudev_libudev_la_LDFLAGS = \
57         -version-info $(LIBUDEV_CURRENT):$(LIBUDEV_REVISION):$(LIBUDEV_AGE) \
58         -export-symbols $(top_srcdir)/libudev/exported_symbols
59
60 noinst_LTLIBRARIES = \
61         libudev/libudev-private.la
62
63 libudev_libudev_private_la_SOURCES =\
64         $(libudev_libudev_la_SOURCES) \
65         libudev/libudev-ctrl.c \
66         libudev/libudev-util-private.c \
67         libudev/libudev-device-private.c \
68         libudev/libudev-queue-private.c
69
70 if WITH_SELINUX
71 libudev_libudev_private_la_SOURCES += libudev/libudev-selinux-private.c
72 libudev_libudev_private_la_LIBADD = $(SELINUX_LIBS)
73 endif
74
75 pkgconfigdir = $(libdir)/pkgconfig
76 pkgconfig_DATA = libudev/libudev.pc
77
78 EXTRA_DIST += libudev/exported_symbols libudev/COPYING
79 # move lib from $(libdir) to $(rootlib_execdir) and update devel link, if needed
80 libudev-install-move-hook:
81         if test "$(libdir)" != "$(rootlib_execdir)"; then \
82                 mkdir -p $(DESTDIR)$(rootlib_execdir) && \
83                 so_img_name=$$(readlink $(DESTDIR)$(libdir)/libudev.so) && \
84                 so_img_rel_target_prefix=$$(echo $(libdir) | sed 's,\(^/\|\)[^/][^/]*,..,g') && \
85                 ln -sf $$so_img_rel_target_prefix$(rootlib_execdir)/$$so_img_name $(DESTDIR)$(libdir)/libudev.so && \
86                 mv $(DESTDIR)$(libdir)/libudev.so.* $(DESTDIR)$(rootlib_execdir); \
87         fi
88
89 libudev-uninstall-move-hook:
90         rm -f $(DESTDIR)$(rootlib_execdir)/libudev.so*
91
92 INSTALL_EXEC_HOOKS += libudev-install-move-hook
93 UNINSTALL_EXEC_HOOKS += libudev-uninstall-move-hook
94
95 # ------------------------------------------------------------------------------
96 # main udev
97 # ------------------------------------------------------------------------------
98 udev-confdirs:
99         -mkdir -p $(DESTDIR)$(sysconfdir)/udev/rules.d
100         -mkdir -p $(DESTDIR)$(libexecdir)/devices
101
102 INSTALL_DATA_HOOKS += udev-confdirs
103
104 EXTRA_DIST += \
105         rules/arch \
106         rules/misc
107
108 udevrulesdir = $(libexecdir)/rules.d
109 dist_udevrules_DATA = \
110         rules/rules.d/50-udev-default.rules \
111         rules/rules.d/60-persistent-storage.rules \
112         rules/rules.d/60-persistent-storage-tape.rules \
113         rules/rules.d/60-persistent-serial.rules \
114         rules/rules.d/60-persistent-input.rules \
115         rules/rules.d/60-persistent-alsa.rules \
116         rules/rules.d/80-drivers.rules \
117         rules/rules.d/95-udev-late.rules
118
119 udevconfdir = $(sysconfdir)/udev
120 dist_udevconf_DATA = udev.conf
121
122 sharepkgconfigdir = $(datadir)/pkgconfig
123 sharepkgconfig_DATA = udev/udev.pc
124
125 if WITH_SYSTEMD
126 systemdsystemunit_DATA = \
127         init/udev.service \
128         init/udev-settle.service \
129         init/udev-retry.service
130
131 systemd-install-hook:
132         mkdir -p $(DESTDIR)$(systemdsystemunitdir)/basic.target.wants
133         ln -sf ../udev.service $(DESTDIR)$(systemdsystemunitdir)/basic.target.wants/udev.service
134         ln -sf ../udev-settle.service $(DESTDIR)$(systemdsystemunitdir)/basic.target.wants/udev-settle.service
135         ln -sf ../udev-retry.service $(DESTDIR)$(systemdsystemunitdir)/basic.target.wants/udev-retry.service
136
137 INSTALL_DATA_HOOKS += systemd-install-hook
138 endif
139
140 sbin_PROGRAMS = \
141         udev/udevd \
142         udev/udevadm
143
144 udev_common_sources =\
145         udev/udev.h \
146         udev/udev-event.c \
147         udev/udev-watch.c \
148         udev/udev-node.c \
149         udev/udev-rules.c
150
151 udev_udevd_SOURCES = \
152         $(udev_common_sources) \
153         udev/udevd.c \
154         udev/sd-daemon.h \
155         udev/sd-daemon.c
156 udev_udevd_LDADD = libudev/libudev-private.la
157
158 udev_udevadm_SOURCES = \
159         $(udev_common_sources) \
160         udev/udevadm.c \
161         udev/udevadm-info.c \
162         udev/udevadm-control.c \
163         udev/udevadm-test.c \
164         udev/udevadm-monitor.c \
165         udev/udevadm-settle.c \
166         udev/udevadm-trigger.c
167 udev_udevadm_LDADD = libudev/libudev-private.la
168
169 # ------------------------------------------------------------------------------
170 # udev man pages
171 # ------------------------------------------------------------------------------
172 dist_man_MANS = \
173         udev/udev.7 \
174         udev/udevadm.8 \
175         udev/udevd.8
176
177 EXTRA_DIST += \
178         udev/udev.xml \
179         udev/udevadm.xml \
180         udev/udevd.xml
181
182 %.7 %.8 : %.xml
183         $(AM_V_GEN)$(XSLTPROC) -o $@ -nonet http://docbook.sourceforge.net/release/xsl/current/manpages/docbook.xsl $<
184
185 # ------------------------------------------------------------------------------
186 # udev tests
187 # ------------------------------------------------------------------------------
188 TESTS = test/udev-test.pl test/rules-test.sh
189
190 check_PROGRAMS = \
191         libudev/test-libudev \
192         udev/test-udev
193
194 libudev_test_libudev_SOURCES = libudev/test-libudev.c
195 libudev_test_libudev_LDADD = libudev/libudev.la
196
197 udev_test_udev_SOURCES = \
198         $(udev_common_sources) \
199         udev/test-udev.c
200 udev_test_udev_LDADD = libudev/libudev-private.la
201
202 # ------------------------------------------------------------------------------
203 # rule_generator - persistent network and optical device rule generator
204 # ------------------------------------------------------------------------------
205 dist_libexec_SCRIPTS = \
206         extras/rule_generator/write_cd_rules \
207         extras/rule_generator/write_net_rules
208
209 udevhomedir = $(libexecdir)
210 dist_udevhome_DATA = extras/rule_generator/rule_generator.functions
211
212 dist_udevrules_DATA += \
213         extras/rule_generator/75-cd-aliases-generator.rules \
214         extras/rule_generator/75-persistent-net-generator.rules
215
216 # ------------------------------------------------------------------------------
217 # firmware - firmware loading
218 # ------------------------------------------------------------------------------
219 extras_firmware_firmware_SOURCES = extras/firmware/firmware.c
220 extras_firmware_firmware_LDADD = libudev/libudev-private.la
221 extras_firmware_firmware_CPPFLAGS = $(AM_CPPFLAGS) -DFIRMWARE_PATH="$(FIRMWARE_PATH)"
222 dist_udevrules_DATA += extras/firmware/50-firmware.rules
223 libexec_PROGRAMS = extras/firmware/firmware
224
225 # ------------------------------------------------------------------------------
226 # ata_id - ATA identify
227 # ------------------------------------------------------------------------------
228 extras_ata_id_ata_id_SOURCES = extras/ata_id/ata_id.c
229 extras_ata_id_ata_id_LDADD = libudev/libudev-private.la
230 libexec_PROGRAMS += extras/ata_id/ata_id
231
232 # ------------------------------------------------------------------------------
233 # cdrom_id - optical drive/media capability
234 # ------------------------------------------------------------------------------
235 extras_cdrom_id_cdrom_id_SOURCES = extras/cdrom_id/cdrom_id.c
236 extras_cdrom_id_cdrom_id_LDADD = libudev/libudev-private.la
237 libexec_PROGRAMS += extras/cdrom_id/cdrom_id
238 dist_udevrules_DATA += extras/cdrom_id/60-cdrom_id.rules
239
240 # ------------------------------------------------------------------------------
241 # collect - trigger action when a collection of devices appeared
242 # ------------------------------------------------------------------------------
243 extras_collect_collect_SOURCES = extras/collect/collect.c
244 extras_collect_collect_LDADD = libudev/libudev-private.la
245 libexec_PROGRAMS += extras/collect/collect
246
247 # ------------------------------------------------------------------------------
248 # edd_id - BIOS EDD block device match
249 # ------------------------------------------------------------------------------
250 extras_edd_id_edd_id_SOURCES = extras/edd_id/edd_id.c
251 extras_edd_id_edd_id_LDADD = libudev/libudev-private.la
252 libexec_PROGRAMS += extras/edd_id/edd_id
253 dist_udevrules_DATA += extras/edd_id/61-persistent-storage-edd.rules
254
255 # ------------------------------------------------------------------------------
256 # create_floppy_devices - historical floppy kernel device nodes (/dev/fd0h1440, ...)
257 # ------------------------------------------------------------------------------
258 extras_floppy_create_floppy_devices_SOURCES = extras/floppy/create_floppy_devices.c
259 extras_floppy_create_floppy_devices_LDADD = libudev/libudev-private.la
260 libexec_PROGRAMS += extras/floppy/create_floppy_devices
261 dist_udevrules_DATA += extras/floppy/60-floppy.rules
262
263 # ------------------------------------------------------------------------------
264 # input_id - import input device class
265 # ------------------------------------------------------------------------------
266 extras_input_id_input_id_SOURCES = extras/input_id/input_id.c
267 extras_input_id_input_id_LDADD = libudev/libudev-private.la
268 libexec_PROGRAMS += extras/input_id/input_id
269
270 # ------------------------------------------------------------------------------
271 # path_id - compose identifier of persistent elements of the parent buses
272 # ------------------------------------------------------------------------------
273 extras_path_id_path_id_SOURCES = extras/path_id/path_id.c
274 extras_path_id_path_id_LDADD = libudev/libudev-private.la
275 libexec_PROGRAMS += extras/path_id/path_id
276
277 # ------------------------------------------------------------------------------
278 # fstab_import - import /etc/fstab entry for block device
279 # ------------------------------------------------------------------------------
280 extras_fstab_import_fstab_import_SOURCES = extras/fstab_import/fstab_import.c
281 extras_fstab_import_fstab_import_LDADD = libudev/libudev-private.la
282 libexec_PROGRAMS += extras/fstab_import/fstab_import
283 dist_udevrules_DATA += extras/fstab_import/79-fstab_import.rules
284
285 # ------------------------------------------------------------------------------
286 # scsi_id - SCSI inquiry to get various serial numbers
287 # ------------------------------------------------------------------------------
288 extras_scsi_id_scsi_id_SOURCES =\
289         extras/scsi_id/scsi_id.c \
290         extras/scsi_id/scsi_serial.c \
291         extras/scsi_id/scsi.h \
292         extras/scsi_id/scsi_id.h
293 extras_scsi_id_scsi_id_LDADD = libudev/libudev-private.la
294 libexec_PROGRAMS += extras/scsi_id/scsi_id
295 dist_man_MANS += extras/scsi_id/scsi_id.8
296
297 # ------------------------------------------------------------------------------
298 # usb_id - USB device property import
299 # ------------------------------------------------------------------------------
300 extras_usb_id_usb_id_SOURCES = extras/usb_id/usb_id.c
301 extras_usb_id_usb_id_LDADD = libudev/libudev-private.la
302 libexec_PROGRAMS += extras/usb_id/usb_id
303
304 # ------------------------------------------------------------------------------
305 # v4l_id - video4linux capabilities
306 # ------------------------------------------------------------------------------
307 extras_v4l_id_v4l_id_SOURCES = extras/v4l_id/v4l_id.c
308 extras_v4l_id_v4l_id_LDADD = libudev/libudev-private.la
309 libexec_PROGRAMS += extras/v4l_id/v4l_id
310 dist_udevrules_DATA += extras/v4l_id/60-persistent-v4l.rules
311
312 if ENABLE_EXTRAS
313 # ------------------------------------------------------------------------------
314 # conditional extras (need glib, libusb, libacl, ...)
315 # ------------------------------------------------------------------------------
316 dist_udevrules_DATA += \
317         rules/rules.d/75-net-description.rules \
318         rules/rules.d/75-tty-description.rules \
319         rules/rules.d/78-sound-card.rules
320
321 # ------------------------------------------------------------------------------
322 # GUdev - libudev gobject interface
323 # ------------------------------------------------------------------------------
324 LIBGUDEV_CURRENT=0
325 LIBGUDEV_REVISION=1
326 LIBGUDEV_AGE=0
327
328 SUBDIRS += extras/gudev/docs
329
330 libgudev_includedir=$(includedir)/gudev-1.0/gudev
331 libgudev_include_HEADERS = \
332         extras/gudev/gudev.h \
333         extras/gudev/gudevenums.h \
334         extras/gudev/gudevenumtypes.h \
335         extras/gudev/gudevtypes.h \
336         extras/gudev/gudevclient.h \
337         extras/gudev/gudevdevice.h
338
339 lib_LTLIBRARIES += extras/gudev/libgudev-1.0.la
340 pkgconfig_DATA += extras/gudev/gudev-1.0.pc
341
342 extras_gudev_libgudev_1_0_la_SOURCES = \
343         extras/gudev/gudevenums.h \
344         extras/gudev/gudevenumtypes.h \
345         extras/gudev/gudevenumtypes.h\
346         extras/gudev/gudevtypes.h \
347         extras/gudev/gudevclient.h \
348         extras/gudev/gudevclient.c \
349         extras/gudev/gudevdevice.h \
350         extras/gudev/gudevdevice.c \
351         extras/gudev/gudevprivate.h
352
353 dist_extras_gudev_libgudev_1_0_la_SOURCES = \
354         extras/gudev/gudevmarshal.h \
355         extras/gudev/gudevmarshal.c \
356         extras/gudev/gudevenumtypes.h \
357         extras/gudev/gudevenumtypes.c
358 BUILT_SOURCES = $(dist_extras_gudev_libgudev_1_0_la_SOURCES)
359
360 extras_gudev_libgudev_1_0_la_CPPFLAGS = \
361         $(AM_CPPFLAGS) \
362         -I$(top_builddir)/extras \
363         -I$(top_srcdir)/extras \
364         -I$(top_builddir)/extras/gudev \
365         -I$(top_srcdir)/extras/gudev \
366         -D_POSIX_PTHREAD_SEMANTICS -D_REENTRANT \
367         -D_GUDEV_COMPILATION \
368         -DG_LOG_DOMAIN=\"GUdev\"
369 extras_gudev_libgudev_1_0_la_CFLAGS = $(GLIB_CFLAGS)
370 extras_gudev_libgudev_1_0_la_LIBADD = libudev/libudev.la $(GLIB_LIBS)
371
372 extras_gudev_libgudev_1_0_la_LDFLAGS = \
373         -version-info $(LIBGUDEV_CURRENT):$(LIBGUDEV_REVISION):$(LIBGUDEV_AGE) \
374         -export-dynamic -no-undefined \
375         -export-symbols-regex '^g_udev_.*'
376
377 EXTRA_DIST += \
378         extras/gudev/COPYING \
379         extras/gudev/gudevmarshal.list \
380         extras/gudev/gudevenumtypes.h.template \
381         extras/gudev/gudevenumtypes.c.template
382
383 extras/gudev/gudevmarshal.h: extras/gudev/gudevmarshal.list
384         $(AM_V_GEN)glib-genmarshal $< --prefix=g_udev_marshal --header > $@
385
386 extras/gudev/gudevmarshal.c: extras/gudev/gudevmarshal.list
387         $(AM_V_GEN)echo "#include \"gudevmarshal.h\"" > $@ && \
388         glib-genmarshal $< --prefix=g_udev_marshal --body >> $@
389
390 extras/gudev/gudevenumtypes.h: extras/gudev/gudevenumtypes.h.template extras/gudev/gudevenums.h
391         $(AM_V_GEN)glib-mkenums --template $^ > \
392             $@.tmp && mv $@.tmp $@
393
394 extras/gudev/gudevenumtypes.c: extras/gudev/gudevenumtypes.c.template extras/gudev/gudevenums.h
395         $(AM_V_GEN)glib-mkenums --template $^ > \
396             $@.tmp && mv $@.tmp $@
397
398 if ENABLE_INTROSPECTION
399 extras/gudev/GUdev-1.0.gir: extras/gudev/libgudev-1.0.la $(G_IR_SCANNER) Makefile.am
400         $(AM_V_GEN)PKG_CONFIG_PATH=$(top_builddir)/data:$$PKG_CONFIG_PATH \
401         LD_LIBRARY_PATH=$(top_builddir)/extras/gudev:$$LD_LIBRARY_PATH \
402         $(G_IR_SCANNER) -v \
403                 --namespace GUdev \
404                 --nsversion=1.0 \
405                 --include=GObject-2.0 \
406                 --library=gudev-1.0 \
407                 --library-path=extras/gudev \
408                 --output $@ \
409                 --pkg=glib-2.0 \
410                 --pkg=gobject-2.0 \
411                 -I$(top_builddir)/extras \
412                 -I$(top_srcdir)/extras \
413                 -D_GUDEV_COMPILATION \
414                 -D_GUDEV_WORK_AROUND_DEV_T_BUG \
415                 $(top_srcdir)/extras/gudev/gudev.h \
416                 $(top_srcdir)/extras/gudev/gudevtypes.h \
417                 $(top_srcdir)/extras/gudev/gudevenums.h \
418                 $(or $(wildcard $(top_builddir)/extras/gudev/gudevenumtypes.h),$(top_srcdir)/extras/gudev/gudevenumtypes.h) \
419                 $(top_srcdir)/extras/gudev/gudevclient.h \
420                 $(top_srcdir)/extras/gudev/gudevdevice.h \
421                 $(top_srcdir)/extras/gudev/gudevclient.c \
422                 $(top_srcdir)/extras/gudev/gudevdevice.c
423
424 extras/gudev/GUdev-1.0.typelib: extras/gudev/GUdev-1.0.gir $(G_IR_COMPILER)
425         $(AM_V_GEN)g-ir-compiler $< -o $@
426
427 girdir = $(GIRDIR)
428 gir_DATA = extras/gudev/GUdev-1.0.gir
429
430 typelibsdir = $(GIRTYPELIBDIR)
431 typelibs_DATA = extras/gudev/GUdev-1.0.typelib
432
433 CLEANFILES += $(gir_DATA) $(typelibs_DATA)
434 endif # ENABLE_INTROSPECTION
435
436 # move lib from $(libdir) to $(rootlib_execdir) and update devel link, if needed
437 libgudev-install-move-hook:
438         if test "$(libdir)" != "$(rootlib_execdir)"; then \
439                 mkdir -p $(DESTDIR)$(rootlib_execdir) && \
440                 so_img_name=$$(readlink $(DESTDIR)$(libdir)/libgudev-1.0.so) && \
441                 so_img_rel_target_prefix=$$(echo $(libdir) | sed 's,\(^/\|\)[^/][^/]*,..,g') && \
442                 ln -sf $$so_img_rel_target_prefix$(rootlib_execdir)/$$so_img_name $(DESTDIR)$(libdir)/libgudev-1.0.so && \
443                 mv $(DESTDIR)$(libdir)/libgudev-1.0.so.* $(DESTDIR)$(rootlib_execdir); \
444         fi
445
446 libgudev-uninstall-move-hook:
447         rm -f $(DESTDIR)$(rootlib_execdir)/libgudev-1.0.so*
448
449 INSTALL_EXEC_HOOKS += libgudev-install-move-hook
450 UNINSTALL_EXEC_HOOKS += libgudev-uninstall-move-hook
451
452 # ------------------------------------------------------------------------------
453 # Bluetooth HID devices with special magic to switch the device
454 # ------------------------------------------------------------------------------
455 extras_hid2hci_hid2hci_SOURCES = extras/hid2hci/hid2hci.c
456 extras_hid2hci_hid2hci_CPPFLAGS = $(AM_CPPFLAGS) $(LIBUSB_CFLAGS)
457 extras_hid2hci_hid2hci_LDADD = libudev/libudev-private.la $(LIBUSB_LIBS)
458 dist_udevrules_DATA += extras/hid2hci/70-hid2hci.rules
459 libexec_PROGRAMS += extras/hid2hci/hid2hci
460
461 # ------------------------------------------------------------------------------
462 # udev_acl - apply ACLs for users with local forground sessions
463 # ------------------------------------------------------------------------------
464 extras_udev_acl_udev_acl_SOURCES = extras/udev-acl/udev-acl.c
465 extras_udev_acl_udev_acl_CPPFLAGS = $(AM_CPPFLAGS) $(GLIB_CFLAGS)
466 extras_udev_acl_udev_acl_LDADD = libudev/libudev-private.la -lacl $(GLIB_LIBS)
467 dist_udevrules_DATA += extras/udev-acl/70-acl.rules
468 libexec_PROGRAMS += extras/udev-acl/udev-acl
469
470 udevacl-install-hook:
471         mkdir -p $(DESTDIR)$(prefix)/lib/ConsoleKit/run-seat.d
472         ln -sf $(libexecdir)/udev-acl $(DESTDIR)$(prefix)/lib/ConsoleKit/run-seat.d/udev-acl.ck
473
474 INSTALL_EXEC_HOOKS += udevacl-install-hook
475
476 # ------------------------------------------------------------------------------
477 # usb-db - read USB vendor/device string database
478 # ------------------------------------------------------------------------------
479 extras_usb_db_usb_db_SOURCES = extras/usb-db/usb-db.c
480 extras_usb_db_usb_db_CPPFLAGS = $(AM_CPPFLAGS) -DUSB_DATABASE=\"$(USB_DATABASE)\" -DBUILD_FOR_USB
481 extras_usb_db_usb_db_LDADD = libudev/libudev-private.la
482 libexec_PROGRAMS += extras/usb-db/usb-db
483
484 # ------------------------------------------------------------------------------
485 # pci-db - read PCI vendor/device string database
486 # ------------------------------------------------------------------------------
487 extras_usb_db_pci_db_SOURCES = extras/usb-db/usb-db.c
488 extras_usb_db_pci_db_CPPFLAGS = $(AM_CPPFLAGS) -DPCI_DATABASE=\"$(PCI_DATABASE)\" -DBUILD_FOR_PCI
489 extras_usb_db_pci_db_LDADD = libudev/libudev-private.la
490 libexec_PROGRAMS += extras/usb-db/pci-db
491
492 # ------------------------------------------------------------------------------
493 # mobile-action-modeswitch - switch Mobile Action cables into serial mode
494 # ------------------------------------------------------------------------------
495 extras_mobile_action_modeswitch_mobile_action_modeswitch_SOURCES =\
496         extras/mobile-action-modeswitch/mobile-action-modeswitch.c \
497         extras/mobile-action-modeswitch/utils.c \
498         extras/mobile-action-modeswitch/utils.h \
499         extras/mobile-action-modeswitch/ma8280p_us.c \
500         extras/mobile-action-modeswitch/ma8280p_us.h
501 extras_mobile_action_modeswitch_mobile_action_modeswitch_CPPFLAGS = $(AM_CPPFLAGS) $(LIBUSB_CFLAGS)
502 extras_mobile_action_modeswitch_mobile_action_modeswitch_LDADD = libudev/libudev-private.la $(LIBUSB_LIBS)
503
504 dist_udevrules_DATA += \
505         extras/mobile-action-modeswitch/61-mobile-action.rules
506
507 libexec_PROGRAMS += extras/mobile-action-modeswitch/mobile-action-modeswitch
508
509 # ------------------------------------------------------------------------------
510 # mtd_probe - autoloads FTL module for mtd devices
511 # ------------------------------------------------------------------------------
512 extras_mtd_probe_mtd_probe_SOURCES =  \
513                                                         extras/mtd_probe/mtd_probe.c \
514                                                         extras/mtd_probe/mtd_probe.h \
515                                                         extras/mtd_probe/probe_smartmedia.c
516
517 extras_mtd_probe_mtd_probe_CPPFLAGS = $(AM_CPPFLAGS)
518
519 dist_udevrules_DATA += extras/mtd_probe/75-probe_mtd.rules
520
521 libexec_PROGRAMS += extras/mtd_probe/mtd_probe
522  
523
524 # ------------------------------------------------------------------------------
525 # keymap - map custom hardware's multimedia keys
526 # ------------------------------------------------------------------------------
527 extras_keymap_keymap_SOURCES = extras/keymap/keymap.c
528 extras_keymap_keymap_CPPFLAGS = $(AM_CPPFLAGS) -I extras/keymap
529 nodist_extras_keymap_keymap_SOURCES = \
530         extras/keymap/keys-from-name.h \
531         extras/keymap/keys-to-name.h
532 BUILT_SOURCES += $(nodist_extras_keymap_keymap_SOURCES)
533
534 EXTRA_DIST += extras/keymap/check-keymaps.sh
535 dist_udevrules_DATA += extras/keymap/95-keymap.rules
536 dist_udevrules_DATA += extras/keymap/95-keyboard-force-release.rules
537 libexec_PROGRAMS += extras/keymap/keymap
538 dist_libexec_SCRIPTS += extras/keymap/findkeyboards
539 dist_libexec_SCRIPTS += extras/keymap/keyboard-force-release.sh
540 dist_doc_DATA = extras/keymap/README.keymap.txt
541
542 CLEANFILES += \
543         extras/keymap/keys.txt \
544         extras/keymap/keys-from-name.gperf
545
546 udevkeymapdir = $(libexecdir)/keymaps
547 dist_udevkeymap_DATA = \
548         extras/keymap/keymaps/acer \
549         extras/keymap/keymaps/acer-aspire_5720 \
550         extras/keymap/keymaps/acer-aspire_5920g \
551         extras/keymap/keymaps/acer-aspire_6920 \
552         extras/keymap/keymaps/acer-travelmate_c300 \
553         extras/keymap/keymaps/asus \
554         extras/keymap/keymaps/compaq-e_evo \
555         extras/keymap/keymaps/dell \
556         extras/keymap/keymaps/everex-xt5000 \
557         extras/keymap/keymaps/fujitsu-amilo_pa_2548 \
558         extras/keymap/keymaps/fujitsu-amilo_pro_edition_v3505 \
559         extras/keymap/keymaps/fujitsu-amilo_pro_v3205 \
560         extras/keymap/keymaps/fujitsu-amilo_si_1520 \
561         extras/keymap/keymaps/fujitsu-esprimo_mobile_v5 \
562         extras/keymap/keymaps/fujitsu-esprimo_mobile_v6 \
563         extras/keymap/keymaps/hewlett-packard \
564         extras/keymap/keymaps/hewlett-packard-2510p_2530p \
565         extras/keymap/keymaps/hewlett-packard-compaq_elitebook \
566         extras/keymap/keymaps/hewlett-packard-pavilion \
567         extras/keymap/keymaps/hewlett-packard-presario-2100 \
568         extras/keymap/keymaps/hewlett-packard-tablet \
569         extras/keymap/keymaps/hewlett-packard-tx2 \
570         extras/keymap/keymaps/ibm-thinkpad-usb-keyboard-trackpoint \
571         extras/keymap/keymaps/inventec-symphony_6.0_7.0 \
572         extras/keymap/keymaps/lenovo-3000 \
573         extras/keymap/keymaps/lenovo-ideapad \
574         extras/keymap/keymaps/lenovo-thinkpad-usb-keyboard-trackpoint \
575         extras/keymap/keymaps/lenovo-thinkpad_x6_tablet \
576         extras/keymap/keymaps/lenovo-thinkpad_x200_tablet \
577         extras/keymap/keymaps/lg-x110 \
578         extras/keymap/keymaps/logitech-wave \
579         extras/keymap/keymaps/logitech-wave-cordless \
580         extras/keymap/keymaps/logitech-wave-pro-cordless \
581         extras/keymap/keymaps/maxdata-pro_7000 \
582         extras/keymap/keymaps/medion-fid2060 \
583         extras/keymap/keymaps/medionnb-a555 \
584         extras/keymap/keymaps/micro-star \
585         extras/keymap/keymaps/module-asus-w3j \
586         extras/keymap/keymaps/module-ibm \
587         extras/keymap/keymaps/module-lenovo \
588         extras/keymap/keymaps/module-sony \
589         extras/keymap/keymaps/module-sony-old \
590         extras/keymap/keymaps/module-sony-vgn \
591         extras/keymap/keymaps/olpc-xo \
592         extras/keymap/keymaps/onkyo \
593         extras/keymap/keymaps/oqo-model2 \
594         extras/keymap/keymaps/samsung-other \
595         extras/keymap/keymaps/samsung-sq1us \
596         extras/keymap/keymaps/samsung-sx20s \
597         extras/keymap/keymaps/toshiba-satellite_a100 \
598         extras/keymap/keymaps/toshiba-satellite_a110 \
599         extras/keymap/keymaps/toshiba-satellite_m30x \
600         extras/keymap/keymaps/zepto-znote
601
602 udevkeymapforcereldir = $(libexecdir)/keymaps/force-release
603 dist_udevkeymapforcerel_DATA = \
604         extras/keymap/force-release-maps/hp-other \
605         extras/keymap/force-release-maps/samsung-other \
606         extras/keymap/force-release-maps/common-volume-keys
607
608 extras/keymap/keys.txt: $(INCLUDE_PREFIX)/linux/input.h
609         $(AM_V_at)mkdir -p extras/keymap
610         $(AM_V_GEN)$(AWK) '/^#define.*KEY_[^ ]+[ \t]+[0-9]/ { if ($$2 != "KEY_MAX") { print $$2 } }' < $< | sed 's/^KEY_COFFEE$$/KEY_SCREENLOCK/' > $@
611
612 extras/keymap/keys-from-name.gperf: extras/keymap/keys.txt
613         $(AM_V_GEN)$(AWK) 'BEGIN{ print "struct key { const char* name; unsigned short id; };"; print "%null-strings"; print "%%";} { print $$1 ", " $$1 }' < $< > $@
614
615 extras/keymap/keys-from-name.h: extras/keymap/keys-from-name.gperf Makefile
616         $(AM_V_GEN)$(GPERF) -L ANSI-C -t --ignore-case -N lookup_key -H hash_key_name -p -C < $< > $@
617
618 extras/keymap/keys-to-name.h: extras/keymap/keys.txt Makefile
619         $(AM_V_GEN)$(AWK) 'BEGIN{ print "const char* const key_names[KEY_CNT] = { "} { print "[" $$1 "] = \"" $$1 "\"," } END{print "};"}' < $< > $@
620
621 keymaps-distcheck-hook: extras/keymap/keys.txt
622         $(top_srcdir)/extras/keymap/check-keymaps.sh $(top_srcdir) $^
623 DISTCHECK_HOOKS += keymaps-distcheck-hook
624
625 endif # ENABLE_EXTRAS
626
627 # ------------------------------------------------------------------------------
628 # install, uninstall, clean hooks
629 # ------------------------------------------------------------------------------
630 clean-local:
631         rm -rf udev-test-install
632
633 distclean-local:
634         rm -rf autom4te.cache
635
636 CLEANFILES += \
637         udev-$(VERSION).tar.gz \
638         udev-$(VERSION).tar.bz2 \
639         $(BUILT_SOURCES)
640
641 EXTRA_DIST += $(TESTS)
642 EXTRA_DIST += test/rule-syntax-check.py
643
644 install-exec-hook: $(INSTALL_EXEC_HOOKS)
645
646 install-data-hook: $(INSTALL_DATA_HOOKS)
647
648 uninstall-hook: $(UNINSTALL_EXEC_HOOKS)
649
650 distcheck-hook: $(DISTCHECK_HOOKS)
651
652 # ------------------------------------------------------------------------------
653 # custom release helpers
654 # ------------------------------------------------------------------------------
655 PREVIOUS_VERSION = `expr $(VERSION) - 1`
656 changelog:
657         @ head -1 ChangeLog | grep -q "to v$(PREVIOUS_VERSION)"
658         @ mv ChangeLog ChangeLog.tmp
659         @ echo "Summary of changes from v$(PREVIOUS_VERSION) to v$(VERSION)" >> ChangeLog
660         @ echo "============================================" >> ChangeLog
661         @ echo >> ChangeLog
662         @ git log --pretty=short $(PREVIOUS_VERSION)..HEAD | git shortlog  >> ChangeLog
663         @ echo >> ChangeLog
664         @ cat ChangeLog
665         @ cat ChangeLog.tmp >> ChangeLog
666         @ rm ChangeLog.tmp
667
668 test-install:
669         rm -rf $(PWD)/udev-test-install/
670         make DESTDIR=$(PWD)/udev-test-install install
671         tree $(PWD)/udev-test-install/
672
673 git-release:
674         head -1 ChangeLog | grep -q "to v$(VERSION)"
675         head -1 NEWS | grep -q "udev $(VERSION)"
676         git commit -a -m "release $(VERSION)"
677         cat .git/refs/heads/master > .git/refs/tags/$(VERSION)
678         git gc
679         git prune
680
681 doc-sync:
682         rsync -av --delete libudev/docs/html/ master.kernel.org:/pub/linux/utils/kernel/hotplug/libudev/
683         rsync -av --delete extras/gudev/docs/html/ master.kernel.org:/pub/linux/utils/kernel/hotplug/gudev/