bigbiff | 7b4c7a6 | 2015-01-01 19:44:14 -0500 | [diff] [blame^] | 1 | |
| 2 | # libfdisk.h is generated, so it's stored in builddir! |
| 3 | fdiskincdir = $(includedir)/libfdisk |
| 4 | nodist_fdiskinc_HEADERS = $(top_builddir)/libfdisk/src/libfdisk.h |
| 5 | |
| 6 | usrlib_exec_LTLIBRARIES += libfdisk.la |
| 7 | libfdisk_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 | |
| 32 | nodist_libfdisk_la_SOURCES = libfdisk/src/fdiskP.h |
| 33 | |
| 34 | libfdisk_la_LIBADD = libcommon.la libuuid.la |
| 35 | |
| 36 | libfdisk_la_CFLAGS = \ |
| 37 | $(SOLIB_CFLAGS) \ |
| 38 | -I$(ul_libuuid_incdir) \ |
| 39 | -I$(ul_libfdisk_incdir) \ |
| 40 | -I$(top_srcdir)/libfdisk/src |
| 41 | |
| 42 | libfdisk_la_DEPENDENCIES = \ |
| 43 | libcommon.la \ |
| 44 | libuuid.la \ |
| 45 | libfdisk/src/libfdisk.sym \ |
| 46 | libfdisk/src/libfdisk.h.in |
| 47 | |
| 48 | libfdisk_la_LDFLAGS = \ |
| 49 | $(SOLIB_LDFLAGS) \ |
| 50 | -Wl,--version-script=$(top_srcdir)/libfdisk/src/libfdisk.sym \ |
| 51 | -version-info $(LIBFDISK_VERSION_INFO) |
| 52 | |
| 53 | if BUILD_LIBBLKID |
| 54 | libfdisk_la_LIBADD += libblkid.la |
| 55 | libfdisk_la_DEPENDENCIES += libblkid.la |
| 56 | libfdisk_la_CFLAGS += -I$(ul_libblkid_incdir) |
| 57 | endif |
| 58 | |
| 59 | EXTRA_DIST += \ |
| 60 | libfdisk/src/libfdisk.sym \ |
| 61 | libfdisk/src/libfdisk.h.in |
| 62 | |
| 63 | if BUILD_LIBFDISK_TESTS |
| 64 | check_PROGRAMS += \ |
| 65 | test_fdisk_ask \ |
| 66 | test_fdisk_script \ |
| 67 | test_fdisk_utils |
| 68 | |
| 69 | libfdisk_tests_cflags = -DTEST_PROGRAM $(libfdisk_la_CFLAGS) |
| 70 | libfdisk_tests_ldflags = libuuid.la -static |
| 71 | libfdisk_tests_ldadd = libfdisk.la $(UUID_LIBS) |
| 72 | |
| 73 | if BUILD_LIBBLKID |
| 74 | libfdisk_tests_ldflags += libblkid.la |
| 75 | endif |
| 76 | |
| 77 | test_fdisk_ask_SOURCES = libfdisk/src/ask.c |
| 78 | test_fdisk_ask_CFLAGS = $(libfdisk_tests_cflags) |
| 79 | test_fdisk_ask_LDFLAGS = $(libfdisk_tests_ldflags) |
| 80 | test_fdisk_ask_LDADD = $(libfdisk_tests_ldadd) |
| 81 | |
| 82 | test_fdisk_utils_SOURCES = libfdisk/src/utils.c |
| 83 | test_fdisk_utils_CFLAGS = $(libfdisk_tests_cflags) |
| 84 | test_fdisk_utils_LDFLAGS = $(libfdisk_tests_ldflags) |
| 85 | test_fdisk_utils_LDADD = $(libfdisk_tests_ldadd) |
| 86 | |
| 87 | test_fdisk_script_SOURCES = libfdisk/src/script.c |
| 88 | test_fdisk_script_CFLAGS = $(libfdisk_tests_cflags) |
| 89 | test_fdisk_script_LDFLAGS = $(libfdisk_tests_ldflags) |
| 90 | test_fdisk_script_LDADD = $(libfdisk_tests_ldadd) |
| 91 | |
| 92 | endif # BUILD_LIBFDISK_TESTS |
| 93 | |
| 94 | |
| 95 | # move lib from $(usrlib_execdir) to $(libdir) if needed |
| 96 | install-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 | |
| 107 | uninstall-hook-libfdisk: |
| 108 | rm -f $(DESTDIR)$(libdir)/libfdisk.so* |
| 109 | |
| 110 | INSTALL_EXEC_HOOKS += install-exec-hook-libfdisk |
| 111 | UNINSTALL_HOOKS += uninstall-hook-libfdisk |
| 112 | |