udev / Makefile.am

Kay Sievers ad29a9f 
Kay Sievers 863ad21 
Kay Sievers 0161865 
Kay Sievers 863ad21 
Kay Sievers 5d89ef7 
Matthias Clasen ac03072 
Kay Sievers 6e4025d 

braindamaged a40c0b8 
braindamaged c9dab9c 
braindamaged a40c0b8 
Kay Sievers 183215e 

braindamaged a40c0b8 
Kay Sievers 183215e 

Diego Elio Pette… 51668e2 

Kay Sievers ad29a9f 
Diego Elio Pette… 51668e2 
Kay Sievers 1495719 
Diego Elio Pette… 51668e2 
Kay Sievers f0ed90b 
Kay Sievers f71a558 
Kay Sievers f0ed90b 



Diego Elio Pette… 51668e2 
Kay Sievers f0ed90b 
Diego Elio Pette… 51668e2 

Kay Sievers af23b83 
Kay Sievers e483478 


braindamaged 7e83412 

Kay Sievers d5d6a7f 
Kay Sievers 28e490c 

Kay Sievers a04879b 



Kay Sievers d914e44 
Kay Sievers ad29a9f 




Kay Sievers 9e4e44e 
braindamaged 0f3964e 
Kay Sievers a04879b 
Kay Sievers 28e490c 
Kay Sievers dd8a93e 
Kay Sievers 28e490c 

Kay Sievers dd8a93e 
Kay Sievers 28e490c 



Kay Sievers 1495719 
Kay Sievers 28e490c 







Kay Sievers dd8a93e 
Kay Sievers 28e490c 

Kay Sievers dd8a93e 
Kay Sievers 28e490c 
Kay Sievers dd8a93e 




Kay Sievers 28e490c 
Kay Sievers 863ad21 
Kay Sievers ad29a9f 
Kay Sievers 183215e 

Diego Elio Pette… 59d93ad 
Kay Sievers 183215e 
Kay Sievers ad29a9f 







Diego Elio Pette… 59d93ad 
Kay Sievers 183215e 
Kay Sievers 6a90a51 
Kay Sievers 666fcf0 
Diego Elio Pette… 59d93ad 
Kay Sievers 183215e 

Kay Sievers ad29a9f 


Diego Elio Pette… 59d93ad 
Kay Sievers 863ad21 
Kay Sievers 183215e 

Kay Sievers 863ad21 
Diego Elio Pette… 59d93ad 
Kay Sievers 2016ac8 
Kay Sievers ad29a9f 


Kay Sievers 2016ac8 
Kay Sievers ad29a9f 
Kay Sievers 863ad21 








Diego Elio Pette… 33eb183 
Kay Sievers 863ad21 

Diego Elio Pette… 33eb183 
Kay Sievers a04879b 

Diego Elio Pette… 33eb183 
Diego Elio Pette… 59d93ad 
Kay Sievers a04879b 
Kay Sievers 863ad21 
Kay Sievers 1495719 
Kay Sievers 863ad21 
Kay Sievers a04879b 

Kay Sievers 1495719 
Kay Sievers 863ad21 
Matthew Garrett 3bfc7a9 
Kay Sievers 8e90942 



braindamaged b29dfc9 
Kay Sievers 8e90942 

braindamaged 35f784e 


Kay Sievers 974eb7c 
Kay Sievers 8e90942 



Kay Sievers 863ad21 
Tom Gundersen ac73f9d 




Kay Sievers 863ad21 
Kay Sievers ad29a9f 
Kay Sievers 863ad21 

Kay Sievers ad29a9f 


Diego Elio Pette… 59d93ad 
Kay Sievers 12a362b 
braindamaged 2f95810 
Kay Sievers 183215e 
Kay Sievers d964a4b 
Kay Sievers 81dadce 
Kay Sievers ad29a9f 






Kay Sievers 974eb7c 
Kay Sievers ad29a9f 




Kay Sievers 81dadce 
Anders Olofsson e834aac 




Tom Gundersen ac73f9d 




Kay Sievers 81dadce 
Kay Sievers f71a558 

Kay Sievers 81dadce 

Kay Sievers 183215e 
Kay Sievers f71a558 
Kay Sievers b45ce69 
Diego Elio Pette… 59d93ad 
Kay Sievers 57f4ef6 

Kay Sievers 3cf5266 

Kay Sievers 57f4ef6 
Kay Sievers 183215e 
Diego Elio Pette… 59d93ad 
consus 3a84012 
Kay Sievers 183215e 


Kay Sievers ad29a9f 
Kay Sievers 183215e 
Diego Elio Pette… 59d93ad 
Kay Sievers ad29a9f 







Kay Sievers 183215e 


Kay Sievers 863ad21 

braindamaged 0f3964e 



Kay Sievers 3840d31 
Kay Sievers 9e4e44e 
Kay Sievers ad29a9f 


Kay Sievers 3840d31 
Kay Sievers 863ad21 

Kay Sievers ad29a9f 


Kay Sievers 863ad21 
Kay Sievers 6528a39 





Kay Sievers ad29a9f 
Kay Sievers 63749b1 
Kay Sievers 863ad21 
Kay Sievers ad29a9f 
Kay Sievers e99cc72 
Kay Sievers 9e4e44e 
Kay Sievers e99cc72 
Kay Sievers 863ad21 
Kay Sievers dd8a93e 



Kay Sievers 863ad21 
Kay Sievers 183215e 

Kay Sievers 863ad21 
Kay Sievers 183215e 

Kay Sievers 863ad21 
Kay Sievers 183215e 
Kay Sievers 863ad21 
Kay Sievers ad29a9f 
Kay Sievers 183215e 



Piter PUNK 6fb1b63 
Kay Sievers d914e44 
Kay Sievers c03fcc2 
Kay Sievers d914e44 







Piter PUNK 6fb1b63 
Kay Sievers 183215e 

braindamaged 2f95810 
Diego Elio Pette… 59d93ad 
Kay Sievers 863ad21 
Kay Sievers 183215e 


Diego Elio Pette… 59d93ad 
Kay Sievers 863ad21 
Kay Sievers 183215e 


Diego Elio Pette… 59d93ad 
Kay Sievers 863ad21 
Kay Sievers 183215e 
Kay Sievers 6997e3b 



Kay Sievers 183215e 

Kay Sievers 6997e3b 

Diego Elio Pette… 59d93ad 
Kay Sievers 863ad21 
Kay Sievers 183215e 


Diego Elio Pette… 59d93ad 
Gerd Hoffmann 4e54f53 
Kay Sievers 183215e 


Bastien Nocera 24569e2 
Diego Elio Pette… 59d93ad 
Kay Sievers 183215e 
braindamaged 7e83412 
Kay Sievers 183215e 

Kay Sievers 6997e3b 







Kay Sievers 183215e 
Kay Sievers 6997e3b 




Kay Sievers 183215e 
Kay Sievers 6997e3b 











Kay Sievers 183215e 
Kay Sievers 6997e3b 



Kay Sievers 183215e 
Kay Sievers 6997e3b 
Kay Sievers 183215e 
Kay Sievers 863ad21 
Kay Sievers 6997e3b 



Kay Sievers 863ad21 


Kay Sievers f0ed90b 
Kay Sievers 183215e 
Kay Sievers f0ed90b 


Kay Sievers 183215e 
Kay Sievers 863ad21 
Kay Sievers 183215e 
Kay Sievers 863ad21 


Diego Elio Pette… 59d93ad 

Kay Sievers 6997e3b 








Kay Sievers 863ad21 
Diego Elio Pette… 5b528d8 
Kay Sievers 6997e3b 
Kay Sievers 863ad21 

Diego Elio Pette… 5b528d8 
Kay Sievers 6997e3b 
Kay Sievers 863ad21 

Diego Elio Pette… 5b528d8 
Kay Sievers 6997e3b 
Kay Sievers 863ad21 

Diego Elio Pette… 5b528d8 
Koen Kooi 16efbde 
Kay Sievers 183215e 
Kay Sievers f0ed90b 

Kay Sievers 863ad21 



Kay Sievers ad29a9f 
Kay Sievers 6997e3b 
Kay Sievers 863ad21 


nemequ a5f8342 

Kay Sievers 6997e3b 

Kay Sievers 863ad21 
David Zeuthen 4e3664f 
Kay Sievers 6997e3b 











Kay Sievers 863ad21 


Kay Sievers 6997e3b 
Kay Sievers 863ad21 

Kay Sievers 6997e3b 
Kay Sievers 863ad21 

Koen Kooi 16efbde 
Diego Elio Pette… 5b528d8 
David Zeuthen 18f5c80 














Kay Sievers d5d6a7f 
David Zeuthen 18f5c80 
Maxim Levitsky 674c341 
Kay Sievers 183215e 



Kay Sievers 6997e3b 

Kay Sievers 183215e 
Kay Sievers 863ad21 
Kay Sievers 183215e 
braindamaged 0f3964e 
Kay Sievers 28e490c 

Kay Sievers 6997e3b 

Kay Sievers 28e490c 
Kay Sievers 6997e3b 

Kay Sievers 28e490c 

Kay Sievers 6997e3b 

Kay Sievers 28e490c 
Diego Elio Pette… 7d701b0 
Kay Sievers 6997e3b 


Diego Elio Pette… 7d701b0 
Kay Sievers 1495719 
Diego Elio Pette… 7d701b0 
Kay Sievers 6997e3b 

























Martin Pitt e023aba 
Kay Sievers 6997e3b 




















braindamaged 8d89ba6 
Kay Sievers 6997e3b 



Alessandro Crism… 3a07ae2 
Kay Sievers 6997e3b 





Diego Elio Pette… 59d93ad 
Kay Sievers 1495719 
Johannes Stezenb… 8350d0b 
Kay Sievers 6997e3b 
Martin Pitt 6be4243 
Kay Sievers 6997e3b 

consus 540b686 
Kay Sievers 6997e3b 
Johannes Stezenb… 8350d0b 
Kay Sievers 6997e3b 

Martin Pitt 82c6558 
Diego Elio Pette… 59d93ad 
Kay Sievers 6997e3b 
Kay Sievers 863ad21 
Diego Elio Pette… 33eb183 
Kay Sievers 6997e3b 
Kay Sievers 863ad21 
Diego Elio Pette… 33eb183 
Kay Sievers 6997e3b 
Kay Sievers 863ad21 
Diego Elio Pette… 33eb183 
Kay Sievers 6997e3b 

Kay Sievers a04879b 
Kay Sievers d5d6a7f 

Kay Sievers e3c14a7 

Kay Sievers 183215e 
Kay Sievers 6997e3b 


Kay Sievers 183215e 
Kay Sievers 6997e3b 
Kay Sievers 183215e 
Kay Sievers e3c14a7 


Kay Sievers 183215e 
Kay Sievers ad29a9f 
Kay Sievers 6997e3b 

Kay Sievers e3c14a7 
Kay Sievers ccf4fd4 
Kay Sievers 6997e3b 
Kay Sievers ccf4fd4 
Kay Sievers 00e3573 
Kay Sievers 6997e3b 

Kay Sievers e3c14a7 

Kay Sievers d5d6a7f 
Kay Sievers 183215e 



Kay Sievers 6997e3b 
Kay Sievers d5d6a7f 

Diego Elio Pette… 59d93ad 
Kay Sievers 863ad21 

Diego Elio Pette… b02140b 
Kay Sievers 863ad21 

Diego Elio Pette… b02140b 
Kay Sievers 28e490c 



Kay Sievers 863ad21 

Diego Elio Pette… eab32c2 
Kay Sievers 863ad21 
Diego Elio Pette… 59d93ad 
Kay Sievers a04879b 

Kay Sievers 863ad21 
Diego Elio Pette… 7d701b0 
Kay Sievers 863ad21 
Diego Elio Pette… eab32c2 
Kay Sievers d914e44 
  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
# Copyright (C) 2008-2012 Kay Sievers <kay.sievers@vrfy.org>
# Copyright (C) 2009 Diego Elio 'Flameeyes' Pettenò <flameeyes@gmail.com>

SUBDIRS = .

ACLOCAL_AMFLAGS = -I m4 ${ACLOCAL_FLAGS}
AM_MAKEFLAGS = --no-print-directory

LIBUDEV_CURRENT=2
LIBUDEV_REVISION=6
LIBUDEV_AGE=1

LIBGUDEV_CURRENT=1
LIBGUDEV_REVISION=2
LIBGUDEV_AGE=1

AM_CPPFLAGS = \
	-include $(top_builddir)/config.h \
	-I$(top_srcdir)/src \
	-DSYSCONFDIR=\""$(sysconfdir)"\" \
	-DPKGLIBEXECDIR=\""$(libexecdir)/udev"\"

AM_CFLAGS = \
	${my_CFLAGS} \
	-fvisibility=hidden \
	-ffunction-sections \
	-fdata-sections

AM_LDFLAGS = \
	-Wl,--gc-sections \
	-Wl,--as-needed

DISTCHECK_CONFIGURE_FLAGS = \
	--enable-debug \
	--enable-rule_generator \
	--enable-floppy \
	--with-selinux

BUILT_SOURCES =
EXTRA_DIST =
CLEANFILES =
INSTALL_EXEC_HOOKS =
INSTALL_DATA_HOOKS =
UNINSTALL_EXEC_HOOKS =
DISTCHECK_HOOKS =
DISTCLEAN_LOCAL_HOOKS =

udevhomedir = $(libexecdir)/udev
udevhome_SCRIPTS =
dist_udevhome_SCRIPTS =
dist_udevhome_DATA =
dist_man_MANS =
dist_doc_DATA =

SED_PROCESS = \
	$(AM_V_GEN)$(MKDIR_P) $(dir $@) && $(SED) \
	-e 's,@VERSION\@,$(VERSION),g' \
	-e 's,@prefix\@,$(prefix),g' \
	-e 's,@rootprefix\@,$(rootprefix),g' \
	-e 's,@exec_prefix\@,$(exec_prefix),g' \
	-e 's,@libdir\@,$(libdir),g' \
	-e 's,@includedir\@,$(includedir),g' \
	-e 's,@bindir\@,$(bindir),g' \
	-e 's,@pkglibexecdir\@,$(libexecdir)/udev,g' \
	< $< > $@ || rm $@

%.pc: %.pc.in Makefile
	$(SED_PROCESS)

%.rules: %.rules.in Makefile
	$(SED_PROCESS)

%.service: %.service.in Makefile
	$(SED_PROCESS)

%.sh: %.sh.in Makefile
	$(SED_PROCESS)
	$(AM_V_GEN)chmod +x $@

%.pl: %.pl.in Makefile
	$(SED_PROCESS)
	$(AM_V_GEN)chmod +x $@

# ------------------------------------------------------------------------------
include_HEADERS = src/libudev.h
lib_LTLIBRARIES = libudev.la
noinst_LTLIBRARIES = libudev-private.la

libudev_la_SOURCES =\
	src/libudev-private.h \
	src/libudev.c \
	src/libudev-list.c \
	src/libudev-util.c \
	src/libudev-device.c \
	src/libudev-enumerate.c \
	src/libudev-monitor.c \
	src/libudev-queue.c

libudev_la_LDFLAGS = \
	$(AM_LDFLAGS) \
	-version-info $(LIBUDEV_CURRENT):$(LIBUDEV_REVISION):$(LIBUDEV_AGE)

libudev_private_la_SOURCES =\
	$(libudev_la_SOURCES) \
	src/libudev-util-private.c \
	src/libudev-device-private.c \
	src/libudev-queue-private.c

if WITH_SELINUX
libudev_private_la_SOURCES += src/libudev-selinux-private.c
libudev_private_la_LIBADD = $(SELINUX_LIBS)
endif

pkgconfigdir = $(libdir)/pkgconfig
pkgconfig_DATA = src/libudev.pc
EXTRA_DIST += src/libudev.pc.in
CLEANFILES += src/libudev.pc

EXTRA_DIST += src/COPYING
# move lib from $(libdir) to $(rootlib_execdir) and update devel link, if needed
libudev-install-move-hook:
	if test "$(libdir)" != "$(rootlib_execdir)"; then \
		mkdir -p $(DESTDIR)$(rootlib_execdir) && \
		so_img_name=$$(readlink $(DESTDIR)$(libdir)/libudev.so) && \
		so_img_rel_target_prefix=$$(echo $(libdir) | sed 's,\(^/\|\)[^/][^/]*,..,g') && \
		ln -sf $$so_img_rel_target_prefix$(rootlib_execdir)/$$so_img_name $(DESTDIR)$(libdir)/libudev.so && \
		mv $(DESTDIR)$(libdir)/libudev.so.* $(DESTDIR)$(rootlib_execdir); \
	fi

libudev-uninstall-move-hook:
	rm -f $(DESTDIR)$(rootlib_execdir)/libudev.so*

INSTALL_EXEC_HOOKS += libudev-install-move-hook
UNINSTALL_EXEC_HOOKS += libudev-uninstall-move-hook

# ------------------------------------------------------------------------------
udev-confdirs:
	-mkdir -p $(DESTDIR)$(sysconfdir)/udev/rules.d
	-mkdir -p $(DESTDIR)$(libexecdir)/udev/devices

INSTALL_DATA_HOOKS += udev-confdirs

udevrulesdir = $(libexecdir)/udev/rules.d
dist_udevrules_DATA = \
	rules/42-usb-hid-pm.rules \
	rules/50-udev-default.rules \
	rules/60-persistent-storage-tape.rules \
	rules/60-persistent-serial.rules \
	rules/60-persistent-input.rules \
	rules/60-persistent-net.rules \
	rules/60-persistent-alsa.rules \
	rules/60-persistent-storage.rules \
	rules/60-persistent-v4l.rules \
	rules/60-cdrom_id.rules \
	rules/61-accelerometer.rules \
	rules/64-btrfs.rules \
	rules/75-net-description.rules \
	rules/75-tty-description.rules \
	rules/78-sound-card.rules \
	rules/95-udev-late.rules

if HAVE_KMOD
dist_udevrules_DATA += \
	rules/80-drivers.rules
endif

udevconfdir = $(sysconfdir)/udev
dist_udevconf_DATA = src/udev.conf

sharepkgconfigdir = $(datadir)/pkgconfig
sharepkgconfig_DATA = src/udev.pc
EXTRA_DIST += src/udev.pc.in
CLEANFILES += src/udev.pc

bin_PROGRAMS = \
	udevadm \
	udevd

udev_common_sources = \
	src/udev.h \
	src/udev-event.c \
	src/udev-watch.c \
	src/udev-node.c \
	src/udev-rules.c \
	src/udev-ctrl.c \
	src/udev-builtin.c \
	src/udev-builtin-btrfs.c \
	src/udev-builtin-firmware.c \
	src/udev-builtin-hwdb.c \
	src/udev-builtin-input_id.c \
	src/udev-builtin-path_id.c \
	src/udev-builtin-usb_id.c

if HAVE_BLKID
udev_common_sources += \
	src/udev-builtin-blkid.c
endif

if HAVE_KMOD
udev_common_sources += \
	src/udev-builtin-kmod.c
endif

udev_common_CFLAGS = \
	$(BLKID_CFLAGS) \
	$(KMOD_CFLAGS)

udev_common_LDADD = \
	libudev-private.la \
	$(BLKID_LIBS) \
	$(KMOD_LIBS)

udev_common_CPPFLAGS = \
	$(AM_CPPFLAGS) \
	-DFIRMWARE_PATH="$(FIRMWARE_PATH)" \
	-DUSB_DATABASE=\"$(USB_DATABASE)\" -DPCI_DATABASE=\"$(PCI_DATABASE)\"

udevd_SOURCES = \
	$(udev_common_sources) \
	src/udevd.c
udevd_CFLAGS = $(udev_common_CFLAGS)
udevd_LDADD = $(udev_common_LDADD)
udevd_CPPFLAGS = $(udev_common_CPPFLAGS)

udevadm_SOURCES = \
	$(udev_common_sources) \
	src/udevadm.c \
	src/udevadm-info.c \
	src/udevadm-control.c \
	src/udevadm-monitor.c \
	src/udevadm-settle.c \
	src/udevadm-trigger.c \
	src/udevadm-test.c \
	src/udevadm-test-builtin.c
udevadm_CFLAGS = $(udev_common_CFLAGS)
udevadm_LDADD = $(udev_common_LDADD)
udevadm_CPPFLAGS = $(udev_common_CPPFLAGS)

# ------------------------------------------------------------------------------
if DX_COND_doc
SUBDIRS += docs
endif

if ENABLE_MANPAGES
dist_man_MANS += \
	src/udev.7 \
	src/udevadm.8 \
	src/udevd.8
endif

EXTRA_DIST += \
	src/udev.xml \
	src/udevadm.xml \
	src/udevd.xml

if HAVE_XSLTPROC
dist_noinst_DATA = \
	src/udev.html \
	src/udevadm.html \
	src/udevd.html

src/%.7 src/%.8 : src/%.xml
	$(AM_V_GEN)$(XSLTPROC) -o $@ -nonet http://docbook.sourceforge.net/release/xsl/current/manpages/docbook.xsl $<

src/%.html : src/%.xml
	$(AM_V_GEN)$(XSLTPROC) -o $@ -nonet http://docbook.sourceforge.net/release/xsl/current/xhtml-1_1/docbook.xsl $<
endif

# ------------------------------------------------------------------------------
TESTS = \
	test/udev-test.pl \
	test/rules-test.sh

check_PROGRAMS = \
	test-libudev \
	test-udev

test_libudev_SOURCES = src/test-libudev.c
test_libudev_LDADD = libudev.la

test_udev_SOURCES = \
	$(udev_common_sources) \
	src/test-udev.c
test_udev_CFLAGS = $(udev_common_CFLAGS)
test_udev_LDADD = $(udev_common_LDADD)
test_udev_CPPFLAGS = $(udev_common_CPPFLAGS)
test_udev_DEPENDENCIES = test/sys

# packed sysfs test tree
test/sys:
	$(AM_V_GEN)mkdir -p test && tar -C test/ -xJf $(top_srcdir)/test/sys.tar.xz

test-sys-distclean:
	-rm -rf test/sys
DISTCLEAN_LOCAL_HOOKS += test-sys-distclean

EXTRA_DIST += test/sys.tar.xz

# ------------------------------------------------------------------------------
ata_id_SOURCES = src/ata_id/ata_id.c
ata_id_LDADD = libudev-private.la
pkglibexec_PROGRAMS = ata_id

# ------------------------------------------------------------------------------
cdrom_id_SOURCES = src/cdrom_id/cdrom_id.c
cdrom_id_LDADD = libudev-private.la
pkglibexec_PROGRAMS += cdrom_id

# ------------------------------------------------------------------------------
collect_SOURCES = src/collect/collect.c
collect_LDADD = libudev-private.la
pkglibexec_PROGRAMS += collect

# ------------------------------------------------------------------------------
scsi_id_SOURCES =\
	src/scsi_id/scsi_id.c \
	src/scsi_id/scsi_serial.c \
	src/scsi_id/scsi.h \
	src/scsi_id/scsi_id.h
scsi_id_LDADD = libudev-private.la
pkglibexec_PROGRAMS += scsi_id
dist_man_MANS += src/scsi_id/scsi_id.8
EXTRA_DIST += src/scsi_id/README

# ------------------------------------------------------------------------------
v4l_id_SOURCES = src/v4l_id/v4l_id.c
v4l_id_LDADD = libudev-private.la
pkglibexec_PROGRAMS += v4l_id

# ------------------------------------------------------------------------------
accelerometer_SOURCES = src/accelerometer/accelerometer.c
accelerometer_LDADD = libudev-private.la -lm
pkglibexec_PROGRAMS += accelerometer

# ------------------------------------------------------------------------------
if ENABLE_GUDEV

libgudev_includedir=$(includedir)/gudev-1.0/gudev
libgudev_include_HEADERS = \
	src/gudev/gudev.h \
	src/gudev/gudevenums.h \
	src/gudev/gudevenumtypes.h \
	src/gudev/gudevtypes.h \
	src/gudev/gudevclient.h \
	src/gudev/gudevdevice.h \
	src/gudev/gudevenumerator.h

lib_LTLIBRARIES += libgudev-1.0.la

pkgconfig_DATA += src/gudev/gudev-1.0.pc
EXTRA_DIST += src/gudev/gudev-1.0.pc.in
CLEANFILES += src/gudev/gudev-1.0.pc

libgudev_1_0_la_SOURCES = \
	src/gudev/gudevenums.h \
	src/gudev/gudevenumtypes.h \
	src/gudev/gudevenumtypes.h\
	src/gudev/gudevtypes.h \
	src/gudev/gudevclient.h \
	src/gudev/gudevclient.c \
	src/gudev/gudevdevice.h \
	src/gudev/gudevdevice.c \
	src/gudev/gudevenumerator.h \
	src/gudev/gudevenumerator.c \
	src/gudev/gudevprivate.h

nodist_libgudev_1_0_la_SOURCES = \
	src/gudev/gudevmarshal.h \
	src/gudev/gudevmarshal.c \
	src/gudev/gudevenumtypes.h \
	src/gudev/gudevenumtypes.c
BUILT_SOURCES += $(nodist_libgudev_1_0_la_SOURCES)

libgudev_1_0_la_CPPFLAGS = \
	$(AM_CPPFLAGS) \
	-I$(top_builddir)/src\
	-I$(top_srcdir)/src\
	-I$(top_builddir)/src/gudev \
	-I$(top_srcdir)/src/gudev \
	-D_POSIX_PTHREAD_SEMANTICS -D_REENTRANT \
	-D_GUDEV_COMPILATION \
	-DG_LOG_DOMAIN=\"GUdev\"

libgudev_1_0_la_CFLAGS = \
	-fvisibility=default \
	$(GLIB_CFLAGS)

libgudev_1_0_la_LIBADD = libudev.la $(GLIB_LIBS)

libgudev_1_0_la_LDFLAGS = \
	-version-info $(LIBGUDEV_CURRENT):$(LIBGUDEV_REVISION):$(LIBGUDEV_AGE) \
	-export-dynamic -no-undefined \
	-export-symbols-regex '^g_udev_.*'

EXTRA_DIST += \
	src/gudev/COPYING \
	src/gudev/gudevmarshal.list \
	src/gudev/gudevenumtypes.h.template \
	src/gudev/gudevenumtypes.c.template \
	src/gudev/gjs-example.js \
	src/gudev/seed-example-enum.js \
	src/gudev/seed-example.js

src/gudev/gudevmarshal.h: src/gudev/gudevmarshal.list
	$(AM_V_GEN)glib-genmarshal $< --prefix=g_udev_marshal --header > $@

src/gudev/gudevmarshal.c: src/gudev/gudevmarshal.list
	$(AM_V_GEN)echo "#include \"gudevmarshal.h\"" > $@ && \
	glib-genmarshal $< --prefix=g_udev_marshal --body >> $@

src/gudev/gudevenumtypes.h: src/gudev/gudevenumtypes.h.template src/gudev/gudevenums.h
	$(AM_V_GEN)glib-mkenums --template $^ > \
	    $@.tmp && mv $@.tmp $@

src/gudev/gudevenumtypes.c: src/gudev/gudevenumtypes.c.template src/gudev/gudevenums.h
	$(AM_V_GEN)glib-mkenums --template $^ > \
	    $@.tmp && mv $@.tmp $@

if ENABLE_INTROSPECTION
src/gudev/GUdev-1.0.gir: libgudev-1.0.la $(G_IR_SCANNER)
	$(AM_V_GEN)$(G_IR_SCANNER) -v \
		--warn-all \
		--namespace GUdev \
		--nsversion=1.0 \
		--include=GObject-2.0 \
		--library=gudev-1.0 \
		--library-path=$(top_builddir)/src \
		--library-path=$(top_builddir)/src/gudev \
		--output $@ \
		--pkg=glib-2.0 \
		--pkg=gobject-2.0 \
		--pkg-export=gudev-1.0 \
		--c-include=gudev/gudev.h \
		-I$(top_srcdir)/src/\
		-I$(top_builddir)/src/\
		-D_GUDEV_COMPILATION \
		-D_GUDEV_WORK_AROUND_DEV_T_BUG \
		$(top_srcdir)/src/gudev/gudev.h \
		$(top_srcdir)/src/gudev/gudevtypes.h \
		$(top_srcdir)/src/gudev/gudevenums.h \
		$(or $(wildcard $(top_builddir)/src/gudev/gudevenumtypes.h),$(top_srcdir)/src/gudev/gudevenumtypes.h) \
		$(top_srcdir)/src/gudev/gudevclient.h \
		$(top_srcdir)/src/gudev/gudevdevice.h \
		$(top_srcdir)/src/gudev/gudevenumerator.h \
		$(top_srcdir)/src/gudev/gudevclient.c \
		$(top_srcdir)/src/gudev/gudevdevice.c \
		$(top_srcdir)/src/gudev/gudevenumerator.c

src/gudev/GUdev-1.0.typelib: src/gudev/GUdev-1.0.gir $(G_IR_COMPILER)
	$(AM_V_GEN)g-ir-compiler $< -o $@

girdir = $(GIRDIR)
gir_DATA = src/gudev/GUdev-1.0.gir

typelibsdir = $(GIRTYPELIBDIR)
typelibs_DATA = src/gudev/GUdev-1.0.typelib

CLEANFILES += $(gir_DATA) $(typelibs_DATA)
endif # ENABLE_INTROSPECTION

# move lib from $(libdir) to $(rootlib_execdir) and update devel link, if needed
libgudev-install-move-hook:
	if test "$(libdir)" != "$(rootlib_execdir)"; then \
		mkdir -p $(DESTDIR)$(rootlib_execdir) && \
		so_img_name=$$(readlink $(DESTDIR)$(libdir)/libgudev-1.0.so) && \
		so_img_rel_target_prefix=$$(echo $(libdir) | sed 's,\(^/\|\)[^/][^/]*,..,g') && \
		ln -sf $$so_img_rel_target_prefix$(rootlib_execdir)/$$so_img_name $(DESTDIR)$(libdir)/libgudev-1.0.so && \
		mv $(DESTDIR)$(libdir)/libgudev-1.0.so.* $(DESTDIR)$(rootlib_execdir); \
	fi

libgudev-uninstall-move-hook:
	rm -f $(DESTDIR)$(rootlib_execdir)/libgudev-1.0.so*

INSTALL_EXEC_HOOKS += libgudev-install-move-hook
UNINSTALL_EXEC_HOOKS += libgudev-uninstall-move-hook
endif

# ------------------------------------------------------------------------------
if ENABLE_KEYMAP
keymap_SOURCES = src/keymap/keymap.c
keymap_CPPFLAGS = $(AM_CPPFLAGS) -I src/keymap
nodist_keymap_SOURCES = \
	src/keymap/keys-from-name.h \
	src/keymap/keys-to-name.h
BUILT_SOURCES += $(nodist_keymap_SOURCES)

pkglibexec_PROGRAMS += keymap
dist_doc_DATA += src/keymap/README.keymap.txt

dist_udevrules_DATA += \
	src/keymap/95-keymap.rules \
	src/keymap/95-keyboard-force-release.rules

dist_udevhome_SCRIPTS += src/keymap/findkeyboards
udevhome_SCRIPTS += src/keymap/keyboard-force-release.sh

EXTRA_DIST += \
	src/keymap/check-keymaps.sh \
	src/keymap/keyboard-force-release.sh.in

CLEANFILES += \
	src/keymap/keys.txt \
	src/keymap/keys-from-name.gperf \
	src/keymap/keyboard-force-release.sh

udevkeymapdir = $(libexecdir)/udev/keymaps
dist_udevkeymap_DATA = \
	src/keymap/keymaps/acer \
	src/keymap/keymaps/acer-aspire_5720 \
	src/keymap/keymaps/acer-aspire_8930 \
	src/keymap/keymaps/acer-aspire_5920g \
	src/keymap/keymaps/acer-aspire_6920 \
	src/keymap/keymaps/acer-travelmate_c300 \
	src/keymap/keymaps/asus \
	src/keymap/keymaps/compaq-e_evo \
	src/keymap/keymaps/dell \
	src/keymap/keymaps/dell-latitude-xt2 \
	src/keymap/keymaps/everex-xt5000 \
	src/keymap/keymaps/fujitsu-amilo_li_2732 \
	src/keymap/keymaps/fujitsu-amilo_pa_2548 \
	src/keymap/keymaps/fujitsu-amilo_pro_edition_v3505 \
	src/keymap/keymaps/fujitsu-amilo_pro_v3205 \
	src/keymap/keymaps/fujitsu-amilo_si_1520 \
	src/keymap/keymaps/fujitsu-esprimo_mobile_v5 \
	src/keymap/keymaps/fujitsu-esprimo_mobile_v6 \
	src/keymap/keymaps/genius-slimstar-320 \
	src/keymap/keymaps/hewlett-packard \
	src/keymap/keymaps/hewlett-packard-2510p_2530p \
	src/keymap/keymaps/hewlett-packard-compaq_elitebook \
	src/keymap/keymaps/hewlett-packard-pavilion \
	src/keymap/keymaps/hewlett-packard-presario-2100 \
	src/keymap/keymaps/hewlett-packard-tablet \
	src/keymap/keymaps/hewlett-packard-tx2 \
	src/keymap/keymaps/hewlett-packard_elitebook-8440p \
	src/keymap/keymaps/ibm-thinkpad-usb-keyboard-trackpoint \
	src/keymap/keymaps/inventec-symphony_6.0_7.0 \
	src/keymap/keymaps/lenovo-3000 \
	src/keymap/keymaps/lenovo-ideapad \
	src/keymap/keymaps/lenovo-thinkpad-usb-keyboard-trackpoint \
	src/keymap/keymaps/lenovo-thinkpad_x6_tablet \
	src/keymap/keymaps/lenovo-thinkpad_x200_tablet \
	src/keymap/keymaps/lg-x110 \
	src/keymap/keymaps/logitech-wave \
	src/keymap/keymaps/logitech-wave-cordless \
	src/keymap/keymaps/logitech-wave-pro-cordless \
	src/keymap/keymaps/maxdata-pro_7000 \
	src/keymap/keymaps/medion-fid2060 \
	src/keymap/keymaps/medionnb-a555 \
	src/keymap/keymaps/micro-star \
	src/keymap/keymaps/module-asus-w3j \
	src/keymap/keymaps/module-ibm \
	src/keymap/keymaps/module-lenovo \
	src/keymap/keymaps/module-sony \
	src/keymap/keymaps/module-sony-old \
	src/keymap/keymaps/module-sony-vgn \
	src/keymap/keymaps/module-sony-vpc \
	src/keymap/keymaps/olpc-xo \
	src/keymap/keymaps/onkyo \
	src/keymap/keymaps/oqo-model2 \
	src/keymap/keymaps/samsung-other \
	src/keymap/keymaps/samsung-series-9 \
	src/keymap/keymaps/samsung-sq1us \
	src/keymap/keymaps/samsung-sx20s \
	src/keymap/keymaps/toshiba-satellite_a100 \
	src/keymap/keymaps/toshiba-satellite_a110 \
	src/keymap/keymaps/toshiba-satellite_m30x \
	src/keymap/keymaps/zepto-znote

udevkeymapforcereldir = $(libexecdir)/udev/keymaps/force-release
dist_udevkeymapforcerel_DATA = \
	src/keymap/force-release-maps/dell-touchpad \
	src/keymap/force-release-maps/dell-xps \
	src/keymap/force-release-maps/hp-other \
	src/keymap/force-release-maps/samsung-other \
	src/keymap/force-release-maps/samsung-series-9 \
	src/keymap/force-release-maps/common-volume-keys

src/keymap/keys.txt: $(INCLUDE_PREFIX)/linux/input.h
	$(AM_V_at)mkdir -p src/keymap
	$(AM_V_GEN)$(AWK) '/^#define.*KEY_[^ ]+[ \t]+[0-9]/ { if ($$2 != "KEY_MAX") { print $$2 } }' < $< | sed 's/^KEY_COFFEE$$/KEY_SCREENLOCK/' > $@

src/keymap/keys-from-name.gperf: src/keymap/keys.txt
	$(AM_V_GEN)$(AWK) 'BEGIN{ print "struct key { const char* name; unsigned short id; };"; print "%null-strings"; print "%%";} { print $$1 ", " $$1 }' < $< > $@

src/keymap/keys-from-name.h: src/keymap/keys-from-name.gperf Makefile
	$(AM_V_GEN)$(GPERF) -L ANSI-C -t --ignore-case -N lookup_key -H hash_key_name -p -C < $< > $@

src/keymap/keys-to-name.h: src/keymap/keys.txt Makefile
	$(AM_V_GEN)$(AWK) 'BEGIN{ print "const char* const key_names[KEY_CNT] = { "} { print "[" $$1 "] = \"" $$1 "\"," } END{print "};"}' < $< > $@

keymaps-distcheck-hook: src/keymap/keys.txt
	$(top_srcdir)/src/keymap/check-keymaps.sh $(top_srcdir) $^
DISTCHECK_HOOKS += keymaps-distcheck-hook
endif

if ENABLE_MTD_PROBE
# ------------------------------------------------------------------------------
mtd_probe_SOURCES =  \
	src/mtd_probe/mtd_probe.c \
	src/mtd_probe/mtd_probe.h \
	src/mtd_probe/probe_smartmedia.c
mtd_probe_CPPFLAGS = $(AM_CPPFLAGS)
dist_udevrules_DATA += src/mtd_probe/75-probe_mtd.rules
pkglibexec_PROGRAMS += mtd_probe
endif

# ------------------------------------------------------------------------------
if ENABLE_RULE_GENERATOR
dist_udevhome_SCRIPTS += \
	src/rule_generator/write_cd_rules \
	src/rule_generator/write_net_rules

dist_udevhome_DATA += \
	src/rule_generator/rule_generator.functions

dist_udevrules_DATA += \
	src/rule_generator/75-cd-aliases-generator.rules \
	src/rule_generator/75-persistent-net-generator.rules
endif

# ------------------------------------------------------------------------------
if ENABLE_FLOPPY
create_floppy_devices_SOURCES = src/floppy/create_floppy_devices.c
create_floppy_devices_LDADD = libudev-private.la
pkglibexec_PROGRAMS += create_floppy_devices
dist_udevrules_DATA += src/floppy/60-floppy.rules
endif

# ------------------------------------------------------------------------------
clean-local:
	rm -rf udev-test-install

distclean-local:
	rm -rf autom4te.cache

EXTRA_DIST += \
	$(TESTS) \
	test/rule-syntax-check.py

CLEANFILES += \
	$(BUILT_SOURCES)

install-exec-hook: $(INSTALL_EXEC_HOOKS)

install-data-hook: $(INSTALL_DATA_HOOKS)

uninstall-hook: $(UNINSTALL_EXEC_HOOKS)

distcheck-hook: $(DISTCHECK_HOOKS)

distclean-local: $(DISTCLEAN_LOCAL_HOOKS)
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.