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