1#	$OpenBSD: Makefile.bsd-wrapper,v 1.19 2018/09/14 13:37:52 naddy Exp $
2
3LIB=		iberty
4CPPFLAGS+=	-DHAVE_CONFIG_H -I$(.CURDIR)/src -I$(.CURDIR)/include -I$(.OBJDIR)
5XCFLAGS=	CC="${CC}" CFLAGS="${CFLAGS} ${COPTS}" LDFLAGS="${LDFLAGS}"
6
7HOST_FILES!=	cat $(.OBJDIR)/needed-list 2>/dev/null||true
8
9.PATH: ${.CURDIR}/src
10
11SRCS=		argv.c choose-temp.c concat.c cplus-dem.c cp-demangle.c \
12		cp-demint.c \
13		dyn-string.c fdmatch.c fopen_unlocked.c \
14		getopt.c getopt1.c getpwd.c getruntime.c \
15		hashtab.c hex.c fibheap.c partition.c \
16		floatformat.c make-temp-file.c make-relative-prefix.c \
17		md5.c objalloc.c obstack.c \
18		pex-common.c pex-unix.c pexecute.c \
19		regex.c safe-ctype.c spaces.c splay-tree.c \
20		strerror.c strsignal.c strverscmp.c \
21		xatexit.c xexit.c xmalloc.c xmemdup.c xstrerror.c xstrdup.c \
22		physmem.c lbasename.c lrealpath.c unlink-if-ordinary.c \
23		$(HOST_FILES)
24
25# XXX -- These files are generated during the PREREQ variable assignment.
26CLEANFILES+=	config.h config.status needed-list
27
28# and more
29CLEANFILES+=	Makefile config.cache config.log stamp-h xhost-mkfrag \
30		testsuite/Makefile libiberty.info
31
32
33BUILDFIRST = needed-list
34
35needed-list: config.status
36	${MAKE} ${XCFLAGS} needed-list
37
38config.status: Makefile.in configure
39	PATH="/bin:/usr/bin:/sbin:/usr/sbin" \
40	INSTALL_PROGRAM="${INSTALL} ${INSTALL_COPY} ${INSTALL_STRIP}" \
41	MAKEINFO='makeinfo --no-split' \
42	${XCFLAGS} \
43	/bin/sh ${.CURDIR}/src/configure \
44		--prefix=/usr --with-local-prefix=/usr ${CF} \
45		&& touch config.status
46
47all:	libiberty.info
48
49libiberty.info:
50	makeinfo --no-split -I${.CURDIR}/src ${.CURDIR}/src/libiberty.texi
51
52afterinstall:
53	${INSTALL} ${INSTALL_COPY} -o ${DOCOWN} -g ${DOCGRP} -m ${DOCMODE} \
54	    libiberty.info $(DESTDIR)/usr/share/info
55
56.include <bsd.lib.mk>
57