xref: /dragonfly/lib/libelf/Makefile (revision dba3e8e975b88aa7d118fe1b423e50360a6c7394)
1# ELF library is a component of ELF Tool Chain (replacement for binutils)
2# For now, do not expose this library.  It is needed for execinfo library.
3
4
5LIB=                          elf
6INTERNALLIB=                  yes
7INTERNALLIBPROF=    yes
8INSTALL_PIC_ARCHIVE=          yes
9TOOLCHAINDIR=                 ${.CURDIR}/../../contrib/elftoolchain
10SRCDIR=                       ${TOOLCHAINDIR}/libelf
11COMMON=                       ${TOOLCHAINDIR}/common
12CFLAGS+=            -I. -I${SRCDIR} -I${COMMON}
13
14.PATH:                        ${SRCDIR}
15
16# verbatim from vendor sourcefile
17SRCS=     elf.c                                                                 \
18          elf_begin.c                                                           \
19          elf_cntl.c                                                            \
20          elf_end.c elf_errmsg.c elf_errno.c                          \
21          elf_data.c                                                            \
22          elf_fill.c                                                            \
23          elf_flag.c                                                            \
24          elf_getarhdr.c                                                        \
25          elf_getarsym.c                                                        \
26          elf_getbase.c                                                         \
27          elf_getident.c                                                        \
28          elf_hash.c                                                            \
29          elf_kind.c                                                            \
30          elf_memory.c                                                          \
31          elf_next.c                                                            \
32          elf_open.c                                                            \
33          elf_rand.c                                                            \
34          elf_rawfile.c                                                         \
35          elf_phnum.c                                                           \
36          elf_shnum.c                                                           \
37          elf_shstrndx.c                                                        \
38          elf_scn.c                                                   \
39          elf_strptr.c                                                          \
40          elf_update.c                                                          \
41          elf_version.c                                                         \
42          gelf_cap.c                                                            \
43          gelf_checksum.c                                                       \
44          gelf_dyn.c                                                            \
45          gelf_ehdr.c                                                           \
46          gelf_getclass.c                                                       \
47          gelf_fsize.c                                                          \
48          gelf_move.c                                                           \
49          gelf_phdr.c                                                           \
50          gelf_rel.c                                                            \
51          gelf_rela.c                                                           \
52          gelf_shdr.c                                                           \
53          gelf_sym.c                                                            \
54          gelf_syminfo.c                                                        \
55          gelf_symshndx.c                                                       \
56          gelf_xlate.c                                                          \
57          libelf_align.c                                                        \
58          libelf_allocate.c                                           \
59          libelf_ar.c                                                           \
60          libelf_ar_util.c                                            \
61          libelf_checksum.c                                           \
62          libelf_data.c                                                         \
63          libelf_ehdr.c                                                         \
64          libelf_extended.c                                           \
65          libelf_memory.c                                                       \
66          libelf_open.c                                                         \
67          libelf_phdr.c                                                         \
68          libelf_shdr.c                                                         \
69          libelf_xlate.c                                                        \
70          ${GENSRCS}
71
72GENSRCS=  libelf_fsize.c libelf_msize.c libelf_convert.c
73
74libelf_convert.c:   elf_types.m4 libelf_convert.m4
75libelf_fsize.c:               elf_types.m4 libelf_fsize.m4
76libelf_msize.c:               elf_types.m4 libelf_msize.m4
77
78# Copy correct headers over to object directory
79
80ELFHEAD=  sys/elf32.h sys/elf64.h sys/elf_common.h
81SRCS+=              ${ELFHEAD}
82
83${.OBJDIR}/sys:
84          mkdir -p ${.TARGET}
85
86${ELFHEAD}: ${.OBJDIR}/sys ${.CURDIR}/../../sys/${.TARGET}
87          ln -sf ${.CURDIR}/../../sys/${.TARGET} ${.TARGET}
88
89CLEANFILES=         ${GENSRCS}
90CLEANDIRS=          sys
91
92.include <bsd.lib.mk>
93
94# Keep the .SUFFIXES line after the include of <bsd.lib.mk>
95.SUFFIXES:          .m4 .c
96.m4.c:
97          m4 -D SRCDIR=${SRCDIR} ${M4FLAGS} ${.IMPSRC} > ${.TARGET}
98