summaryrefslogtreecommitdiff
path: root/udev/lib/Makefile.am
blob: f1f5fb74b1876159ad7333b7a840b7d5ad5b94eb (plain)
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
AM_CPPFLAGS = \
	-DSYSCONFDIR=\""$(sysconfdir)"\" \
	-DUDEV_PREFIX=\""$(udev_prefix)"\" \
	-D_LIBUDEV_COMPILATION

noinst_PROGRAMS = \
	test-libudev

test_libudev_SOURCES = \
	test-libudev.c

test_libudev_LDADD = \
	libudev.la

rootlibdir = $(exec_prefix)/$(libdir_name)
rootlib_LTLIBRARIES = \
	libudev.la

include_HEADERS =\
	libudev.h

libudev_la_SOURCES =\
	libudev-private.h \
	libudev.c \
	libudev-utils.c \
	libudev-device.c \
	libudev-enumerate.c \
	libudev-monitor.c \
	../list.h \
	../udev.h \
	../udev_utils.c \
	../udev_utils_string.c \
	../udev_utils_file.c \
	../udev_sysfs.c \
	../udev_device.c \
	../udev_config.c \
	../udev_db.c \
	../udev_sysdeps.c

if USE_SELINUX
libudev_la_SOURCES += \
	../udev_selinux.c
endif

libudev_la_LDFLAGS = \
	-version-info $(LIBUDEV_LT_CURRENT):$(LIBUDEV_LT_REVISION):$(LIBUDEV_LT_AGE) \
	-export-symbols $(top_srcdir)/udev/lib/exported_symbols

if USE_SELINUX
libudev_la_LIBADD = \
	-lselinux
endif

pkgconfigdir = $(prefix)/$(libdir_name)/pkgconfig
pkgconfig_DATA = libudev.pc

EXTRA_DIST = \
	exported_symbols

# move devel files to $(prefix)$(libdir_name) if needed
install-data-hook:
	rm  $(DESTDIR)$(rootlibdir)/libudev.la
	if test "$(prefix)" != "$(exec_prefix)"; then \
		mkdir -p $(DESTDIR)$(prefix)/$(libdir_name); \
		mv $(DESTDIR)$(rootlibdir)/libudev.a $(DESTDIR)$(prefix)/$(libdir_name)/; \
		so_img_name=$$(readlink $(DESTDIR)$(rootlibdir)/libudev.so); \
		rm $(DESTDIR)$(rootlibdir)/libudev.so; \
		so_img_rel_target_prefix=$$(echo $(prefix)/$(libdir_name) | sed 's,\(^/\|\)[^/][^/]*,..,g'); \
		ln -sf  $$so_img_rel_target_prefix$(exec_prefix)/$(libdir_name)/$$so_img_name \
			$(DESTDIR)$(prefix)/$(libdir_name)/libudev.so; \
	fi

uninstall-hook:
	rm -f $(DESTDIR)$(prefix)/$(libdir_name)/libudev.a
	rm -f $(DESTDIR)$(prefix)/$(libdir_name)/libudev.so*