Home | History | Annotate | Line # | Download | only in compat
Makefile revision 1.88
      1  1.88     lukem #	$NetBSD: Makefile,v 1.88 2020/06/13 10:49:17 lukem Exp $
      2  1.67  christos 
      3  1.67  christos HOSTLIB=	nbcompat
      4  1.63  christos 
      5  1.83  christos .include <bsd.hostinit.mk>
      6   1.1        tv 
      7  1.59     joerg SRCS=		atoll.c basename.c cdbr.c cdbw.c dirname.c \
      8  1.68  christos 		dprintf.c fgetln.c flock.c fparseln.c fpurge.c \
      9  1.58     joerg 		getcap.c getline.c getmode.c getopt_long.c gettemp.c \
     10  1.86  christos 		heapsort.c getsubopt.c \
     11  1.39      elad 		issetugid.c lchflags.c lchmod.c lchown.c libyywrap.c \
     12  1.54       roy 		md2.c md2hl.c md4c.c md4hl.c md5c.c md5hl.c \
     13  1.54       roy 		mi_vector_hash.c mkdtemp.c \
     14  1.22   thorpej 		mkstemp.c pread.c putc_unlocked.c pwcache.c pwrite.c \
     15  1.51     lukem 		pw_scan.c \
     16  1.87   thorpej 		raise_default_signal.c rb.c reallocarr.c rmd160.c rmd160hl.c \
     17  1.81   aymeric 		regcomp.c regerror.c regexec.c regfree.c \
     18  1.51     lukem 		setenv.c setgroupent.c \
     19  1.34      elad 		setpassent.c setprogname.c sha1.c sha1hl.c sha2.c \
     20  1.69       apb 		sha256hl.c sha384hl.c sha512hl.c snprintb.c snprintf.c \
     21  1.71       apb 		stat_flags.c strlcat.c strlcpy.c strmode.c \
     22  1.85  christos 		strcasecmp.c strncasecmp.c strndup.c strnlen.c \
     23  1.69       apb 		strsep.c strsuftoll.c strtoll.c \
     24  1.73  christos 		strtoi.c strtou.c \
     25  1.72  christos 		unvis.c vis.c err.c errx.c errc.c verr.c verrx.c verrc.c \
     26  1.72  christos 		vwarn.c vwarnx.c vwarnc.c warn.c warnx.c warnc.c \
     27  1.72  christos 		fts.c glob.c efun.c
     28  1.21   thorpej 
     29  1.21   thorpej BUILD_OSTYPE!=  uname -s
     30  1.21   thorpej 
     31  1.21   thorpej # Disable use of pre-compiled headers on Darwin.
     32  1.21   thorpej .if ${BUILD_OSTYPE} == "Darwin"
     33  1.21   thorpej CPPFLAGS+=	-no-cpp-precomp
     34  1.21   thorpej .endif
     35   1.6        tv 
     36   1.6        tv # -D_FILE_OFFSET_BITS=64 produces a much more amenable `struct stat', and
     37   1.6        tv # other file ops, on many systems, without changing function names.
     38   1.6        tv 
     39  1.47    dogcow CPPFLAGS+=	-I. -I./include -I${.CURDIR} -I${.CURDIR}/sys \
     40  1.47    dogcow 		-DHAVE_NBTOOL_CONFIG_H=1 -D_FILE_OFFSET_BITS=64
     41   1.3        tv 
     42  1.57     joerg .PATH:		${.CURDIR}/../../lib/libc/cdb \
     43  1.57     joerg 		${.CURDIR}/../../lib/libc/gen \
     44   1.9     bjh21 		${.CURDIR}/../../lib/libc/hash \
     45  1.39      elad 		${.CURDIR}/../../lib/libc/hash/md2 \
     46  1.38      elad 		${.CURDIR}/../../lib/libc/hash/md5 \
     47  1.38      elad 		${.CURDIR}/../../lib/libc/hash/rmd160 \
     48  1.38      elad 		${.CURDIR}/../../lib/libc/hash/sha1 \
     49  1.34      elad 		${.CURDIR}/../../lib/libc/hash/sha2 \
     50   1.9     bjh21 		${.CURDIR}/../../lib/libc/md \
     51  1.81   aymeric 		${.CURDIR}/../../lib/libc/regex \
     52  1.15   thorpej 		${.CURDIR}/../../lib/libc/stdio \
     53   1.6        tv 		${.CURDIR}/../../lib/libc/stdlib \
     54   1.4     lukem 		${.CURDIR}/../../lib/libc/string \
     55  1.44  christos 		${.CURDIR}/../../lib/libutil \
     56  1.70     joerg 		${.CURDIR}/../../common/lib/libc/cdb \
     57  1.87   thorpej 		${.CURDIR}/../../common/lib/libc/gen \
     58  1.40  christos 		${.CURDIR}/../../common/lib/libc/string \
     59  1.46       mrg 		${.CURDIR}/../../common/lib/libc/hash/rmd160 \
     60  1.40  christos 		${.CURDIR}/../../common/lib/libc/hash/sha1 \
     61  1.46       mrg 		${.CURDIR}/../../common/lib/libc/hash/sha2 \
     62  1.40  christos 		${.CURDIR}/../../common/lib/libc/md \
     63  1.45   thorpej 		${.CURDIR}/../../common/lib/libc/stdlib \
     64  1.69       apb 		${.CURDIR}/../../common/lib/libutil \
     65  1.77  christos 		${.CURDIR}/../../external/bsd/flex/dist/src
     66   1.1        tv 
     67   1.6        tv DPSRCS+=	defs.mk
     68  1.43  christos CLEANFILES+=	config.log config.status configure.lineno *.stamp
     69  1.61       apb CLEANDIRFILES+=	defs.mk config.cache confdefs.h
     70   1.3        tv 
     71   1.3        tv # Get components of Berkeley DB.
     72   1.3        tv _CURDIR:=	${.CURDIR}
     73   1.3        tv .CURDIR:=	${_CURDIR}/../../lib/libc
     74   1.3        tv .include "${.CURDIR}/db/Makefile.inc"
     75   1.3        tv .CURDIR:=	${_CURDIR}
     76   1.3        tv 
     77  1.54       roy SRCS:=		${SRCS:M*.c}
     78   1.1        tv 
     79  1.88     lukem CONFIGURE_ARGS=	--cache-file=config.cache
     80  1.88     lukem .if ${MAKEVERBOSE} == 0
     81  1.88     lukem CONFIGURE_ARGS+=--silent
     82  1.88     lukem .endif
     83  1.88     lukem 
     84  1.42       wiz config.cache: include/.stamp configure nbtool_config.h.in defs.mk.in
     85  1.20     lukem 	rm -f ${.TARGET}
     86   1.3        tv 	CC=${HOST_CC:Q} CFLAGS=${HOST_CFLAGS:Q} LDFLAGS=${HOST_LDFLAGS:Q} \
     87  1.88     lukem 		${HOST_SH} ${.CURDIR}/configure ${CONFIGURE_ARGS}
     88  1.20     lukem 
     89  1.20     lukem defs.mk: config.cache
     90  1.20     lukem 	@touch ${.TARGET}
     91   1.1        tv 
     92  1.61       apb INCFILES=	nbtool_config.h
     93  1.66  christos INCSUBDIRS=	sys machine rpc arpa
     94  1.61       apb CLEANDIRFILES+= ${INCFILES}
     95  1.61       apb 
     96  1.61       apb # CLEANDIRFILES may not contain directory names
     97  1.61       apb cleandir:	cleandir.include
     98  1.61       apb cleandir.include: .PHONY
     99  1.61       apb 		rm -rf include
    100  1.61       apb 
    101  1.13        tv include/.stamp:
    102  1.61       apb 	mkdir -p ${INCSUBDIRS:@d@ include/$d @}
    103  1.20     lukem 	@touch ${.TARGET}
    104   1.6        tv 
    105  1.61       apb # Install rules
    106  1.61       apb 
    107  1.61       apb HOST_LIBDIR=	${TOOLDIR}/lib
    108  1.61       apb HOST_INCSDIR=	${TOOLDIR}/include
    109  1.66  christos HOST_SHAREDIR= ${TOOLDIR}/share
    110  1.61       apb 
    111  1.64  christos install:	.PHONY install.lib includes install.defs.mk
    112  1.61       apb 
    113  1.61       apb # Install lib${HOSTLIB}.a in ${TOOLDIR}/lib
    114  1.61       apb install.lib: .PHONY ${HOST_LIBDIR}/lib${HOSTLIB}.a
    115  1.61       apb ${HOST_LIBDIR}/lib${HOSTLIB}.a: lib${HOSTLIB}.a
    116  1.61       apb 	${_MKTARGET_INSTALL}
    117  1.61       apb 	${HOST_INSTALL_DIR} ${HOST_LIBDIR}
    118  1.61       apb 	${HOST_INSTALL_FILE} -m ${LIBMODE} ${.ALLSRC} ${.TARGET}
    119  1.61       apb 
    120  1.64  christos .for _f in ${INCFILES}
    121  1.64  christos HOST_INCINSTFILES+= ${HOST_INCSDIR}/compat/${_f}
    122  1.64  christos ${HOST_INCSDIR}/compat/${_f}: ${_f}
    123  1.64  christos 	${_MKTARGET_INSTALL}
    124  1.64  christos 	${HOST_INSTALL_FILE} ${.ALLSRC} ${.TARGET}
    125  1.64  christos .endfor
    126  1.64  christos 
    127  1.61       apb .for _d in ${INCSUBDIRS}
    128  1.64  christos HOST_INCINSTDIRS+= ${HOST_INCSDIR}/compat/${_d}
    129  1.64  christos ${HOST_INCSDIR}/compat/${_d}:
    130  1.64  christos 	${_MKTARGET_INSTALL}
    131  1.64  christos 	${HOST_INSTALL_DIR} ${.TARGET}
    132  1.61       apb .endfor
    133  1.64  christos 
    134  1.64  christos # Install include files in ${TOOLDIR}/include/compat
    135  1.64  christos includes: .PHONY ${HOST_INCINSTDIRS} .WAIT ${HOST_INCINSTFILES}
    136  1.76  christos 	@(cd include && find . -name '*.h' -print | while read f ; do \
    137  1.66  christos 	    ${HOST_INSTALL_FILE} $$f ${HOST_INCSDIR}/compat/$$f ; \
    138  1.66  christos 	done)
    139  1.66  christos 
    140  1.61       apb 
    141  1.61       apb # Install defs.mk in ${TOOLDIR}/share/compat
    142  1.61       apb install.defs.mk: .PHONY ${HOST_SHAREDIR}/compat/defs.mk
    143  1.61       apb ${HOST_SHAREDIR}/compat/defs.mk: defs.mk
    144  1.61       apb 	${_MKTARGET_INSTALL}
    145  1.61       apb 	${HOST_INSTALL_DIR} ${HOST_SHAREDIR}
    146  1.61       apb 	${HOST_INSTALL_DIR} ${HOST_SHAREDIR}/compat
    147  1.61       apb 	${HOST_INSTALL_FILE} ${.ALLSRC} ${.TARGET}
    148  1.61       apb 
    149  1.61       apb # bsd.hostlib.mk wants HOST_CPPFLAGS, not CPPFLAGS
    150   1.6        tv 
    151   1.6        tv HOST_CPPFLAGS:=	${CPPFLAGS}
    152   1.6        tv CPPFLAGS:=	# empty
    153   1.1        tv 
    154   1.1        tv .include <bsd.hostlib.mk>
    155  1.60       apb 
    156  1.60       apb # Use uninstalled copy of host-mkdep
    157  1.60       apb HOST_MKDEP_OBJ!= cd ${.CURDIR}/../host-mkdep && ${PRINTOBJDIR}
    158  1.60       apb HOST_MKDEP=	${HOST_MKDEP_OBJ}/host-mkdep
    159  1.60       apb MKDEP=		${HOST_MKDEP}
    160  1.60       apb 
    161  1.61       apb # Use uninstalled copy of the install program
    162  1.61       apb INSTALL_OBJ!=	cd ${NETBSDSRCDIR}/tools/binstall && ${PRINTOBJDIR}
    163  1.61       apb INSTALL=	${INSTALL_OBJ}/xinstall
    164  1.61       apb 
    165  1.60       apb # Run "${TOOLDIR}/bin/nbmake-${MACHINE} regen" by hand after editing
    166  1.60       apb # configure.ac.  See more detailed instructions in configure.ac.
    167  1.60       apb regen:
    168  1.60       apb 	cd ${.CURDIR} && ${TOOLDIR}/bin/${_TOOL_PREFIX}autoconf
    169  1.60       apb 	cd ${.CURDIR} && ${TOOLDIR}/bin/${_TOOL_PREFIX}autoheader
    170