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