• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1## Process this file with automake to create Makefile.in
2## Configure input file for elfutils.
3##
4## Copyright (C) 2002, 2004 Red Hat, Inc.
5##
6## This program is Open Source software; you can redistribute it and/or
7## modify it under the terms of the Open Software License version 1.0 as
8## published by the Open Source Initiative.
9##
10## You should have received a copy of the Open Software License along
11## with this program; if not, you may obtain a copy of the Open Software
12## License version 1.0 from http://www.opensource.org/licenses/osl.php or
13## by writing the Open Source Initiative c/o Lawrence Rosen, Esq.,
14## 3001 King Ranch Road, Ukiah, CA 95482.
15##
16DEFS = -D_GNU_SOURCE -DHAVE_CONFIG_H
17if MUDFLAP
18AM_CFLAGS = -Wall
19else
20AM_CFLAGS = -Wall -Werror
21endif
22INCLUDES = -I. -I$(srcdir) -I.. -I$(top_srcdir)/libelf -I$(top_srcdir)/libebl \
23	   -I$(top_srcdir)/lib
24GCC_INCLUDE = -I$(shell $(CC) -print-file-name=include)
25VERSION = 1
26
27LINT = splint
28
29lib_LIBRARIES = libasm.a
30if !MUDFLAP
31noinst_LIBRARIES = libasm_pic.a
32noinst_PROGRAMS = $(noinst_LIBRARIES:_pic.a=.so)
33endif
34euincludedir = ${includedir}/elfutils
35euinclude_HEADERS = libasm.h
36
37libasm_a_SOURCES = asm_begin.c asm_abort.c asm_end.c asm_error.c \
38		   asm_getelf.c asm_newscn.c asm_newscn_ingrp.c \
39		   asm_newsubscn.c asm_newsym.c asm_newcomsym.c \
40		   asm_newabssym.c \
41		   asm_newscngrp.c asm_scngrp_newsignature.c \
42		   asm_fill.c asm_align.c asm_addstrz.c \
43		   asm_addint8.c asm_adduint8.c \
44		   asm_addint16.c asm_adduint16.c \
45		   asm_addint32.c asm_adduint32.c \
46		   asm_addint64.c asm_adduint64.c \
47		   asm_adduleb128.c asm_addsleb128.c \
48		   symbolhash.c
49
50if !MUDFLAP
51libasm_pic_a_SOURCES =
52am_libasm_pic_a_OBJECTS = $(libasm_a_SOURCES:.c=.os)
53
54libasm_so_SOURCES =
55libasm.so: libasm_pic.a libasm.map
56	$(CC) -shared -o $@ -Wl,--whole-archive,$<,--no-whole-archive \
57	      -Wl,--version-script,$(srcdir)/libasm.map,--no-undefined \
58	      -Wl,--soname,$@.$(VERSION) \
59	      ../libebl/libebl.a ../libelf/libelf.so
60	ln -fs $@ $@.$(VERSION)
61
62
63%.os: %.c %.o
64	if $(COMPILE) -c -o $@ -fpic -DPIC -DSHARED -MT $@ -MD -MP \
65	  -MF "$(DEPDIR)/$*.Tpo" `test -f '$<' || echo '$(srcdir)/'`$<; \
66	then cat "$(DEPDIR)/$*.Tpo" >> "$(DEPDIR)/$*.Po"; \
67	     rm -f "$(DEPDIR)/$*.Tpo"; \
68	else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; \
69	fi
70
71install: install-am libasm.so
72	$(mkinstalldirs) $(DESTDIR)$(libdir)
73	$(INSTALL_PROGRAM) libasm.so $(DESTDIR)$(libdir)/libasm-$(PACKAGE_VERSION).so
74	ln -fs libasm-$(PACKAGE_VERSION).so $(DESTDIR)$(libdir)/libasm.so.$(VERSION)
75	ln -fs libasm.so.$(VERSION) $(DESTDIR)$(libdir)/libasm.so
76
77uninstall: uninstall-am
78	rm -f $(DESTDIR)$(libdir)/libasm-$(PACKAGE_VERSION).so
79	rm -f $(DESTDIR)$(libdir)/libasm.so.$(VERSION)
80	rm -f $(DESTDIR)$(libdir)/libasm.so
81	rmdir --ignore-fail-on-non-empty $(DESTDIR)$(includedir)/elfutils
82endif
83
84.PSEUDO: lint
85lint:
86	$(LINT) $(DEFS) $(INCLUDES) $(GCC_INCLUDE) -f $(top_srcdir)/splint.rc \
87		$(addprefix $(srcdir)/,$(libelf_la_SOURCES))
88
89noinst_HEADERS = libasmP.h symbolhash.h
90EXTRA_DIST = libasm.map
91
92CLEANFILES = $(am_libasm_pic_a_OBJECTS)
93