No empty .Rs/.Re
[netbsd-mini2440.git] / tools / libelf / Makefile
blob826872c05f0c4d9e32942c09e4c46e1e4f2998ae
1 # $NetBSD: Makefile,v 1.2 2009/12/23 20:28:29 cegger Exp $
3 .include <bsd.own.mk>
5 HOSTLIB= elf
7 SRCS= elf_begin.c \
8 elf_cntl.c \
9 elf_end.c elf_errmsg.c elf_errno.c \
10 elf_data.c \
11 elf_fill.c elf_flag.c \
12 elf_getarhdr.c elf_getarsym.c elf_getbase.c \
13 elf_getident.c \
14 elf_hash.c \
15 elf_kind.c \
16 elf_memory.c \
17 elf_next.c \
18 elf_rand.c elf_rawfile.c \
19 elf_phnum.c \
20 elf_shnum.c elf_shstrndx.c elf_scn.c elf_strptr.c \
21 elf_update.c \
22 elf_version.c \
23 gelf_cap.c \
24 gelf_checksum.c \
25 gelf_dyn.c \
26 gelf_ehdr.c \
27 gelf_getclass.c \
28 gelf_fsize.c \
29 gelf_move.c \
30 gelf_phdr.c \
31 gelf_rel.c gelf_rela.c \
32 gelf_shdr.c gelf_sym.c gelf_syminfo.c gelf_symshndx.c \
33 gelf_xlate.c \
34 libelf.c \
35 libelf_align.c libelf_allocate.c libelf_ar.c \
36 libelf_checksum.c \
37 libelf_data.c \
38 libelf_ehdr.c libelf_extended.c \
39 libelf_phdr.c \
40 libelf_shdr.c \
41 libelf_xlate.c \
42 ${LIBELF_GENSRCS}
44 LIBELF_GENSRCS= libelf_fsize.c libelf_msize.c libelf_convert.c
46 LIBELF_DIR= ${.CURDIR}/../../external/bsd/libelf/dist
48 CLEANFILES+= ${LIBELF_GENSRCS}
49 CPPFLAGS+= -I${.CURDIR}/../compat -I${LIBELF_DIR}
50 CPPFLAGS+= -I${TOOLDIR}/include/nbinclude
52 CPPFLAGS+= -DLIBELF_TEST_HOOKS
54 libelf_convert.c: elf_types.m4 libelf_convert.m4
55 libelf_fsize.c: elf_types.m4 libelf_fsize.m4
56 libelf_msize.c: elf_types.m4 libelf_msize.m4
58 BUILD_OSTYPE!= uname -s
60 # Disable use of pre-compiled headers on Darwin.
61 .if ${BUILD_OSTYPE} == "Darwin"
62 CPPFLAGS+= -no-cpp-precomp
63 .endif
65 # -D_FILE_OFFSET_BITS=64 produces a much more amenable `struct stat', and
66 # other file ops, on many systems, without changing function names.
68 CPPFLAGS+= -DHAVE_NBTOOL_CONFIG_H=1 -D_FILE_OFFSET_BITS=64
69 .ifndef NOCOMPATLIB
70 COMPATOBJ!= cd ${.CURDIR}/../compat && ${PRINTOBJDIR}
71 CPPFLAGS+= -I${COMPATOBJ}
72 .endif
74 .PATH: ${LIBELF_DIR}
76 HOST_CPPFLAGS:= ${CPPFLAGS}
77 CPPFLAGS:= # empty
79 .include "${.CURDIR}/../Makefile.disklabel"
80 .include <bsd.hostlib.mk>
82 # Keep the .SUFFIXES line after the include of bsd.hostlib.mk
83 M4OBJDIR!= cd ${.CURDIR}/../m4 && ${PRINTOBJDIR}
84 .SUFFIXES: .m4 .c
85 .m4.c:
86 ${M4OBJDIR}/m4 -D SRCDIR=${LIBELF_DIR} ${.IMPSRC} > ${.TARGET}