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