]> git.ipfire.org Git - thirdparty/util-linux.git/blob - shlibs/uuid/src/Makefile.am
build-sys: rename to _execdir
[thirdparty/util-linux.git] / shlibs / uuid / src / Makefile.am
1 include $(top_srcdir)/config/include-Makefile.am
2
3 AM_CPPFLAGS += -I$(ul_libuuid_srcdir)
4
5 noinst_PROGRAMS = tst_uuid
6 tst_uuid_LDADD = $(ul_libuuid_la)
7 tst_uuid_CFLAGS = -I$(ul_libuuid_srcdir)
8
9 # includes
10 uuidincdir = $(includedir)/uuid
11 uuidinc_HEADERS = uuid.h
12
13 usrlib_exec_LTLIBRARIES = libuuid.la
14 libuuid_la_SOURCES = clear.c compare.c copy.c gen_uuid.c \
15 isnull.c pack.c parse.c unpack.c unparse.c uuidd.h \
16 uuidd.h uuidP.h uuid_time.c $(uuidinc_HEADERS)
17
18 libuuid_la_DEPENDENCIES = $(libuuid_la_LIBADD) uuid.sym
19
20 libuuid_la_LDFLAGS = -Wl,--version-script=$(ul_libuuid_srcdir)/uuid.sym \
21 -version-info 1:0:0
22
23 #tests = test_uuid_time
24
25 EXTRA_DIST = uuid.sym gen_uuid_nt.c
26 CLEANFILES = $(tests)
27
28 tests: all $(tests)
29 test_%: %.c
30 $(COMPILE) -DTEST_PROGRAM $< .libs/libuuid.a -o $@
31
32
33 # move lib from $(usrlib_execdir) to $(libdir) if needed
34 install-exec-hook:
35 if test "$(usrlib_execdir)" != "$(libdir)"; then \
36 mkdir -p $(DESTDIR)$(libdir); \
37 mv $(DESTDIR)$(usrlib_execdir)/libuuid.so.* $(DESTDIR)$(libdir); \
38 so_img_name=$$(readlink $(DESTDIR)$(usrlib_execdir)/libuuid.so); \
39 so_img_rel_target=$$(echo $(usrlib_execdir) | sed 's,\(^/\|\)[^/][^/]*,..,g'); \
40 (cd $(DESTDIR)$(usrlib_execdir) && \
41 rm -f libuuid.so && \
42 $(LN_S) $$so_img_rel_target$(libdir)/$$so_img_name libuuid.so); \
43 fi
44
45 uninstall-hook:
46 rm -f $(DESTDIR)$(libdir)/libuuid.so*
47