NetBSD/sys/lib/libz/Makefile
drochner 192b3c733c Build libraries for kernel/standalone code from within their compilation
directories and use .PATH to lookup the source files.
(Formerly, the libs were built from the source dirs, with MAKEOBJDIR
set to the compilation directory.)
This solves 2 problems:
-"mkdep" and "make" are now consistent about the file lookup, this fixes
 bad interactions with amd reported in PR bin/7374 (Arne Juul) and
 lossage reported by Andrew Gillham ("obj" dirs and relative paths still
 don't work well together)
-kernel compile trees can be moved around without forcing a new
 "make depend" - fixing PR kern/4021 by Martin Husemann
1999-05-07 14:28:50 +00:00

41 lines
1.0 KiB
Makefile

# $NetBSD: Makefile,v 1.10 1999/05/07 14:28:51 drochner Exp $
LIB= z
MKPIC= no
MKPROFILE=no
CPPFLAGS= -I${ZDIR} ${ZCPPFLAGS} ${ZMISCCPPFLAGS} -D_ZLIB_PRIVATE
.PATH.c: ${ZDIR}
# files to be copied down from libz.
LIBZSRCS= adler32.c crc32.c infblock.c infcodes.c inffast.c \
inflate.c inftrees.c infutil.c uncompr.c
LIBZHDRS= infblock.h infcodes.h inffast.h inftrees.h infutil.h \
zconf.h zlib.h zutil.h
# Other stuff
SRCS= ${LIBZSRCS} zalloc.c
# Files to clean up
CLEANFILES+= lib${LIB}.o
# only needed during build
libinstall::
.include <bsd.lib.mk>
lib${LIB}.o:: ${OBJS}
@echo building standard ${LIB} library
@rm -f lib${LIB}.o
@${LD} -r -o lib${LIB}.o `lorder ${OBJS} | tsort`
update-sources:
-@for file in ${LIBZSRCS} ${LIBZHDRS}; do \
tail +2 ${.CURDIR}/../../../lib/libz/$$file > .tmp1.$$file ; \
tail +2 ${.CURDIR}/$$file > .tmp2.$$file ; \
cmp -s .tmp1.$$file .tmp2.$$file || ( echo Updating $$file ; \
cp ${.CURDIR}/../../../lib/libz/$$file ${.CURDIR} ) ; \
rm .tmp1.$$file .tmp2.$$file ; \
done