1## Makefile.am for libdebuginfod library subdirectory in elfutils. 2## 3## Process this file with automake to create Makefile.in 4## 5## Copyright (C) 2019 Red Hat, Inc. 6## This file is part of elfutils. 7## 8## This file is free software; you can redistribute it and/or modify 9## it under the terms of either 10## 11## * the GNU Lesser General Public License as published by the Free 12## Software Foundation; either version 3 of the License, or (at 13## your option) any later version 14## 15## or 16## 17## * the GNU General Public License as published by the Free 18## Software Foundation; either version 2 of the License, or (at 19## your option) any later version 20## 21## or both in parallel, as here. 22## 23## elfutils is distributed in the hope that it will be useful, but 24## WITHOUT ANY WARRANTY; without even the implied warranty of 25## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 26## General Public License for more details. 27## 28## You should have received copies of the GNU General Public License and 29## the GNU Lesser General Public License along with this program. If 30## not, see <http://www.gnu.org/licenses/>. 31## 32include $(top_srcdir)/config/eu.am 33AM_CPPFLAGS += -I$(srcdir) -I$(srcdir)/../libelf -I$(srcdir)/../libebl \ 34 -I$(srcdir)/../libdw -I$(srcdir)/../libdwelf \ 35 $(libmicrohttpd_CFLAGS) $(libcurl_CFLAGS) $(sqlite3_CFLAGS) \ 36 $(libarchive_CFLAGS) 37VERSION = 1 38 39# Disable eu- prefixing for artifacts (binaries & man pages) in this 40# directory, since they do not conflict with binutils tools. 41program_prefix= 42program_transform_name = s,x,x, 43 44if BUILD_STATIC 45libasm = ../libasm/libasm.a 46libdw = ../libdw/libdw.a -lz $(zip_LIBS) $(libelf) $(libebl) -ldl -lpthread 47libelf = ../libelf/libelf.a -lz 48libdebuginfod = ./libdebuginfod.a $(libcurl_LIBS) 49else 50libasm = ../libasm/libasm.so 51libdw = ../libdw/libdw.so 52libelf = ../libelf/libelf.so 53libdebuginfod = ./libdebuginfod.so 54endif 55libebl = ../libebl/libebl.a 56libeu = ../lib/libeu.a 57 58AM_LDFLAGS = -Wl,-rpath-link,../libelf:../libdw:. 59 60bin_PROGRAMS = debuginfod debuginfod-find 61debuginfod_SOURCES = debuginfod.cxx 62debuginfod_LDADD = $(libdw) $(libelf) $(libeu) $(libdebuginfod) $(libmicrohttpd_LIBS) $(libcurl_LIBS) $(sqlite3_LIBS) $(libarchive_LIBS) -lpthread -ldl 63 64debuginfod_find_SOURCES = debuginfod-find.c 65debuginfod_find_LDADD = $(libeu) $(libdebuginfod) 66 67noinst_LIBRARIES = libdebuginfod.a 68noinst_LIBRARIES += libdebuginfod_pic.a 69 70libdebuginfod_a_SOURCES = debuginfod-client.c 71libdebuginfod_pic_a_SOURCES = debuginfod-client.c 72am_libdebuginfod_pic_a_OBJECTS = $(libdebuginfod_a_SOURCES:.c=.os) 73 74pkginclude_HEADERS = debuginfod.h 75 76libdebuginfod_so_LIBS = libdebuginfod_pic.a 77libdebuginfod_so_LDLIBS = $(libcurl_LIBS) 78libdebuginfod.so$(EXEEXT): $(srcdir)/libdebuginfod.map $(libdebuginfod_so_LIBS) 79 $(AM_V_CCLD)$(LINK) $(dso_LDFLAGS) -o $@ \ 80 -Wl,--soname,$@.$(VERSION) \ 81 -Wl,--version-script,$<,--no-undefined \ 82 -Wl,--whole-archive $(libdebuginfod_so_LIBS) -Wl,--no-whole-archive \ 83 $(libdebuginfod_so_LDLIBS) 84 @$(textrel_check) 85 $(AM_V_at)ln -fs $@ $@.$(VERSION) 86 87install: install-am libdebuginfod.so 88 $(mkinstalldirs) $(DESTDIR)$(libdir) 89 $(INSTALL_PROGRAM) libdebuginfod.so $(DESTDIR)$(libdir)/libdebuginfod-$(PACKAGE_VERSION).so 90 ln -fs libdebuginfod-$(PACKAGE_VERSION).so $(DESTDIR)$(libdir)/libdebuginfod.so.$(VERSION) 91 ln -fs libdebuginfod.so.$(VERSION) $(DESTDIR)$(libdir)/libdebuginfod.so 92 93uninstall: uninstall-am 94 rm -f $(DESTDIR)$(libdir)/libdebuginfod-$(PACKAGE_VERSION).so 95 rm -f $(DESTDIR)$(libdir)/libdebuginfod.so.$(VERSION) 96 rm -f $(DESTDIR)$(libdir)/libdebuginfod.so 97 rmdir --ignore-fail-on-non-empty $(DESTDIR)$(includedir)/elfutils 98 99EXTRA_DIST = libdebuginfod.map 100MOSTLYCLEANFILES = $(am_libdebuginfod_pic_a_OBJECTS) libdebuginfod.so.$(VERSION) 101CLEANFILES += $(am_libdebuginfod_pic_a_OBJECTS) libdebuginfod.so 102 103# automake std-options override: arrange to pass LD_LIBRARY_PATH 104installcheck-binPROGRAMS: $(bin_PROGRAMS) 105 bad=0; pid=$$$$; list="$(bin_PROGRAMS)"; for p in $$list; do \ 106 case ' $(AM_INSTALLCHECK_STD_OPTIONS_EXEMPT) ' in \ 107 *" $$p "* | *" $(srcdir)/$$p "*) continue;; \ 108 esac; \ 109 f=`echo "$$p" | \ 110 sed 's,^.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/'`; \ 111 for opt in --help --version; do \ 112 if LD_LIBRARY_PATH=$(DESTDIR)$(libdir) \ 113 $(DESTDIR)$(bindir)/$$f $$opt > c$${pid}_.out 2> c$${pid}_.err \ 114 && test -n "`cat c$${pid}_.out`" \ 115 && test -z "`cat c$${pid}_.err`"; then :; \ 116 else echo "$$f does not support $$opt" 1>&2; bad=1; fi; \ 117 done; \ 118 done; rm -f c$${pid}_.???; exit $$bad 119