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