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