blob: 18ddec73966996b184bf4c517d73ebc1d0e76a3b [file] [log] [blame]
bigbiff7b4c7a62015-01-01 19:44:14 -05001
2# libfdisk.h is generated, so it's stored in builddir!
3fdiskincdir = $(includedir)/libfdisk
4nodist_fdiskinc_HEADERS = $(top_builddir)/libfdisk/src/libfdisk.h
5
6usrlib_exec_LTLIBRARIES += libfdisk.la
7libfdisk_la_SOURCES = \
8 include/list.h \
9 \
10 libfdisk/src/fdiskP.h \
11 libfdisk/src/init.c \
12 libfdisk/src/test.c \
13 libfdisk/src/ask.c \
14 libfdisk/src/alignment.c \
15 libfdisk/src/label.c \
16 libfdisk/src/utils.c \
17 libfdisk/src/context.c \
18 libfdisk/src/parttype.c \
19 libfdisk/src/partition.c \
20 libfdisk/src/table.c \
21 libfdisk/src/iter.c \
22 libfdisk/src/script.c \
23 \
24 libfdisk/src/sun.c \
25 libfdisk/src/sgi.c \
26 libfdisk/src/dos.c \
27 libfdisk/src/bsd.c \
28 libfdisk/src/gpt.c \
29 $(nodist_fdiskinc_HEADERS)
30
31
32nodist_libfdisk_la_SOURCES = libfdisk/src/fdiskP.h
33
34libfdisk_la_LIBADD = libcommon.la libuuid.la
35
36libfdisk_la_CFLAGS = \
37 $(SOLIB_CFLAGS) \
38 -I$(ul_libuuid_incdir) \
39 -I$(ul_libfdisk_incdir) \
40 -I$(top_srcdir)/libfdisk/src
41
42libfdisk_la_DEPENDENCIES = \
43 libcommon.la \
44 libuuid.la \
45 libfdisk/src/libfdisk.sym \
46 libfdisk/src/libfdisk.h.in
47
48libfdisk_la_LDFLAGS = \
49 $(SOLIB_LDFLAGS) \
50 -Wl,--version-script=$(top_srcdir)/libfdisk/src/libfdisk.sym \
51 -version-info $(LIBFDISK_VERSION_INFO)
52
53if BUILD_LIBBLKID
54libfdisk_la_LIBADD += libblkid.la
55libfdisk_la_DEPENDENCIES += libblkid.la
56libfdisk_la_CFLAGS += -I$(ul_libblkid_incdir)
57endif
58
59EXTRA_DIST += \
60 libfdisk/src/libfdisk.sym \
61 libfdisk/src/libfdisk.h.in
62
63if BUILD_LIBFDISK_TESTS
64check_PROGRAMS += \
65 test_fdisk_ask \
66 test_fdisk_script \
67 test_fdisk_utils
68
69libfdisk_tests_cflags = -DTEST_PROGRAM $(libfdisk_la_CFLAGS)
70libfdisk_tests_ldflags = libuuid.la -static
71libfdisk_tests_ldadd = libfdisk.la $(UUID_LIBS)
72
73if BUILD_LIBBLKID
74libfdisk_tests_ldflags += libblkid.la
75endif
76
77test_fdisk_ask_SOURCES = libfdisk/src/ask.c
78test_fdisk_ask_CFLAGS = $(libfdisk_tests_cflags)
79test_fdisk_ask_LDFLAGS = $(libfdisk_tests_ldflags)
80test_fdisk_ask_LDADD = $(libfdisk_tests_ldadd)
81
82test_fdisk_utils_SOURCES = libfdisk/src/utils.c
83test_fdisk_utils_CFLAGS = $(libfdisk_tests_cflags)
84test_fdisk_utils_LDFLAGS = $(libfdisk_tests_ldflags)
85test_fdisk_utils_LDADD = $(libfdisk_tests_ldadd)
86
87test_fdisk_script_SOURCES = libfdisk/src/script.c
88test_fdisk_script_CFLAGS = $(libfdisk_tests_cflags)
89test_fdisk_script_LDFLAGS = $(libfdisk_tests_ldflags)
90test_fdisk_script_LDADD = $(libfdisk_tests_ldadd)
91
92endif # BUILD_LIBFDISK_TESTS
93
94
95# move lib from $(usrlib_execdir) to $(libdir) if needed
96install-exec-hook-libfdisk:
97 if test "$(usrlib_execdir)" != "$(libdir)" -a -f "$(DESTDIR)$(usrlib_execdir)/libfdisk.so"; then \
98 mkdir -p $(DESTDIR)$(libdir); \
99 mv $(DESTDIR)$(usrlib_execdir)/libfdisk.so.* $(DESTDIR)$(libdir); \
100 so_img_name=$$(readlink $(DESTDIR)$(usrlib_execdir)/libfdisk.so); \
101 so_img_rel_target=$$(echo $(usrlib_execdir) | sed 's,\(^/\|\)[^/][^/]*,..,g'); \
102 (cd $(DESTDIR)$(usrlib_execdir) && \
103 rm -f libfdisk.so && \
104 $(LN_S) $$so_img_rel_target$(libdir)/$$so_img_name libfdisk.so); \
105 fi
106
107uninstall-hook-libfdisk:
108 rm -f $(DESTDIR)$(libdir)/libfdisk.so*
109
110INSTALL_EXEC_HOOKS += install-exec-hook-libfdisk
111UNINSTALL_HOOKS += uninstall-hook-libfdisk
112