xref: /freebsd/contrib/elftoolchain/elfcopy/Makefile (revision 7d8f797b725e3efc0a4256554654780df83c456c)
1# $Id: Makefile 2290 2011-12-04 07:20:46Z jkoshy $
2
3TOP=	..
4
5PROG=	elfcopy
6
7SRCS=	archive.c ascii.c binary.c main.c sections.c segments.c symbols.c
8
9WARNS?=	5
10
11DPADD=	${LIBELF} ${LIBELFTC}
12LDADD=	-lelf -lelftc
13
14.if !defined(LIBELF_AR)
15LDADD+= -larchive
16.endif
17
18MAN=	elfcopy.1 mcs.1 strip.1
19
20NO_SHARED?=	yes
21
22LINKS=	${BINDIR}/elfcopy ${BINDIR}/strip 	\
23	${BINDIR}/elfcopy ${BINDIR}/mcs
24
25EXTRA_TARGETS=	strip mcs
26
27CLEANFILES+=	${EXTRA_TARGETS}
28
29# Create in-place symbolic links to "elfcopy" at build time.
30
31all:	${EXTRA_TARGETS}
32
33${EXTRA_TARGETS}:	${PROG}
34	ln -s ${PROG} ${.TARGET}
35
36.include "${TOP}/mk/elftoolchain.prog.mk"
37
38.if ${OS_HOST} == "OpenBSD"
39CFLAGS+=	-I/usr/local/include
40LDFLAGS+=	-L/usr/local/lib
41.endif
42