Makefile revision 1.7
1#	$NetBSD: Makefile,v 1.7 2017/11/11 07:49:43 kamil Exp $
2
3.include <bsd.init.mk>
4.include <bsd.shlib.mk>
5
6LIB=		liblto_plugin
7
8DIST=		${GCCDIST}
9GNUHOSTDIST=	${DIST}
10
11SRCS=		lto-plugin.c hashtab.c simple-object.c pex-unix.c \
12		pex-common.c argv.c make-temp-file.c concat.c \
13		simple-object-elf.c simple-object-mach-o.c \
14		simple-object-coff.c simple-object-xcoff.c xstrerror.c \
15		safe-ctype.c
16
17CPPFLAGS+=	-I${DIST}/include -I. 
18CPPFLAGS+=	-DHAVE_CONFIG_H
19CPPFLAGS+=	-Dxstrdup=strdup -Dxexit=exit
20CPPFLAGS+=	-Dxcalloc=calloc -Dxmalloc=malloc -Dxrealloc=realloc
21
22LIBISMODULE=	1
23USE_SHLIBDIR=	yes
24REQUIRETOOLS=	yes
25NOLINT=		# defined
26
27# make this /usr/lib/gcc?
28LIBDIR=		/usr/libexec
29
30.if ${MKGCC} != "no"
31
32SHLIB_MAJOR=	0
33SHLIB_MINOR=	1
34
35# Yuck, we have to run configure to generate this one...
36CLEANFILES+=	config.h
37HOST_CFLAGS+= -I${.OBJDIR}
38DPSRCS+=	config.h
39config.h: Makefile
40	${_MKTARGET_CREATE}
41	rm -rf .ab && \
42	mkdir .ab && \
43	(cd .ab && \
44		AWK=${TOOL_AWK:Q} \
45		CC=${HOST_CC:Q} CFLAGS=${HOST_CFLAGS:Q} \
46		MAKE=${MAKE:Q} \
47		CONFIG_SHELL=${HOST_SH:Q} \
48		${HOST_SH} ${DIST}/libiberty/configure \
49			--build=`${HOST_SH} ${GNUHOSTDIST}/config.guess` \
50			--host=`${HOST_SH} ${GNUHOSTDIST}/config.guess` \
51			--target=${MACHINE_GNU_PLATFORM} && \
52		mv ${.TARGET} ../${.TARGET}) && \
53	rm -rf .ab
54
55.include <bsd.lib.mk>
56
57.PATH:	${DIST}/lto-plugin ${DIST}/libiberty
58COPTS.lto-plugin.c+= -Wno-missing-prototypes
59
60.else
61.include <bsd.prog.mk> # do nothing
62.endif
63