Makefile revision 1.157
11.157Smatt# $NetBSD: Makefile,v 1.157 2013/04/30 01:42:03 matt Exp $ 21.36Scgd# @(#)Makefile 8.2 (Berkeley) 2/3/94 31.1Scgd# 41.1Scgd# All library objects contain sccsid strings by default; they may be 51.1Scgd# excluded as a space-saving measure. To produce a library that does 61.1Scgd# not contain these strings, delete -DLIBC_SCCS and -DSYSLIBC_SCCS 71.71Slukem# from CPPFLAGS below. To remove these strings from just the system call 81.71Slukem# stubs, remove just -DSYSLIBC_SCCS from CPPFLAGS. 91.28Sjtc# 101.28Sjtc# The NLS (message catalog) functions are always in libc. To choose that 111.28Sjtc# strerror(), perror(), strsignal(), psignal(), etc. actually call the NLS 121.71Slukem# functions, put -DNLS on the CPPFLAGS line below. 131.4Sderaadt# 141.6Sderaadt# The YP functions are always in libc. To choose that getpwent() and friends 151.71Slukem# actually call the YP functions, put -DYP on the CPPFLAGS line below. 161.79Slukem# 171.79Slukem# The Hesiod functions are always in libc. To choose that getpwent() and friends 181.79Slukem# actually call the Hesiod functions, put -DHESIOD on the CPPFLAGS line below. 191.4Sderaadt 201.127Schristos.include "Makefile.inc" 211.107Slukem 221.157SmattLIBC_MACHINE_ARCH?= ${MACHINE_ARCH} # for MKCOMPAT 231.157Smatt 241.82StvLIB= c 251.117SchristosCPPFLAGS+= -I${.CURDIR}/include -I${.CURDIR} 261.104Sthorpej 271.136SmrgLIBCDIR= ${.CURDIR} 281.136Smrg 291.82Stv.if exists (${ARCHDIR}/Makefile.inc) 301.82Stv.PATH: ${ARCHDIR} 311.82Stv.include "${ARCHDIR}/Makefile.inc" 321.9Sderaadt.endif 331.127Schristos 341.114Smatt.if exists (${ARCHDIR}/genassym.cf) 351.114SmattDPSRCS+= assym.h 361.114SmattCLEANFILES+= assym.h assym.h.tmp 371.114Smatt 381.122Sthorpejassym.h: ${ARCHDIR}/genassym.cf 391.114Smatt ${_MKTARGET_CREATE} 401.122Sthorpej ${TOOL_GENASSYM} -- ${CC} ${CFLAGS} \ 411.121Smatt ${CPPFLAGS} ${CPPFLAGS.assym.h} ${PROF} \ 421.114Smatt < ${ARCHDIR}/genassym.cf > assym.h.tmp && \ 431.114Smatt mv -f assym.h.tmp assym.h 441.114Smatt.endif 451.1Scgd 461.127Schristos# The following controls how to build compatibility code for old NetBSD 471.150Sjoerg# binaries. If BUILD_LEGACY is yes, then we build a separate library; otherwise 481.127Schristos# we include the code in libc. 491.150SjoergBUILD_LEGACY?= no 501.150Sjoerg.if "${BUILD_LEGACY}" == "yes" 511.127SchristosSUBDIR=compat 521.127Schristos.include <bsd.subdir.mk> 531.127Schristos.else 541.127SchristosCOMPATDIR=${.CURDIR}/compat 551.127Schristos.include "${.CURDIR}/compat/Makefile.inc" 561.150Sjoerg# Marker for compat code that can't be easily isolated 571.150SjoergCPPFLAGS+= -D__BUILD_LEGACY 581.127Schristos.endif 591.127Schristos 601.125Schristos.include "${.CURDIR}/../../common/lib/libc/Makefile.inc" 611.135Sad.include "${.CURDIR}/atomic/Makefile.inc" 621.141Sjoerg.include "${.CURDIR}/cdb/Makefile.inc" 631.7Scgd.include "${.CURDIR}/db/Makefile.inc" 641.111Stshiozak.include "${.CURDIR}/citrus/Makefile.inc" 651.1Scgd.include "${.CURDIR}/compat-43/Makefile.inc" 661.88Sminoura.include "${.CURDIR}/dlfcn/Makefile.inc" 671.126Skleink.include "${.CURDIR}/gdtoa/Makefile.inc" 681.1Scgd.include "${.CURDIR}/gen/Makefile.inc" 691.24Scgd.include "${.CURDIR}/gmon/Makefile.inc" 701.81Sexplorer.include "${.CURDIR}/hash/Makefile.inc" 711.111Stshiozak.include "${.CURDIR}/iconv/Makefile.inc" 721.117Schristos.include "${.CURDIR}/inet/Makefile.inc" 731.117Schristos.include "${.CURDIR}/isc/Makefile.inc" 741.1Scgd.include "${.CURDIR}/locale/Makefile.inc" 751.52Sthorpej.include "${.CURDIR}/md/Makefile.inc" 761.132Sad.include "${.CURDIR}/misc/Makefile.inc" 771.1Scgd.include "${.CURDIR}/net/Makefile.inc" 781.117Schristos.include "${.CURDIR}/nameser/Makefile.inc" 791.25Sjtc.include "${.CURDIR}/nls/Makefile.inc" 801.146Snakayama.if (${MACHINE_ARCH} != "alpha") && (${ARCHSUBDIR} != "sparc64") 811.24Scgd.include "${.CURDIR}/quad/Makefile.inc" 821.34Scgd.endif 831.143Sahoka.if (${USE_LIBTRE} == "yes") 841.143Sahoka.include "${NETBSDSRCDIR}/external/bsd/tre/Makefile.inc" 851.143Sahoka.else 861.24Scgd.include "${.CURDIR}/regex/Makefile.inc" 871.143Sahoka.endif 881.117Schristos.include "${.CURDIR}/resolv/Makefile.inc" 891.24Scgd.include "${.CURDIR}/rpc/Makefile.inc" 901.131Stls.include "${.CURDIR}/ssp/Makefile.inc" 911.1Scgd.include "${.CURDIR}/stdio/Makefile.inc" 921.1Scgd.include "${.CURDIR}/stdlib/Makefile.inc" 931.1Scgd.include "${.CURDIR}/string/Makefile.inc" 941.40Sjtc.include "${.CURDIR}/termios/Makefile.inc" 951.108Sthorpej.include "${.CURDIR}/thread-stub/Makefile.inc" 961.38Sjtc.include "${.CURDIR}/time/Makefile.inc" 971.144Sjoerg.include "${.CURDIR}/tls/Makefile.inc" 981.1Scgd.include "${.CURDIR}/sys/Makefile.inc" 991.119Sthorpej.include "${.CURDIR}/uuid/Makefile.inc" 1001.104Sthorpej.if (${MKYP} != "no") 1011.4Sderaadt.include "${.CURDIR}/yp/Makefile.inc" 1021.104Sthorpej.endif 1031.41Sjtc 1041.138Sdsl# Remove from SRCS the .c files for any .S files added by the MD makefiles, 1051.138Sdsl# also remove from SRCS the .c files for the .S and .c files in NO_SRCS. 1061.138Sdsl# Add the .c file for .S files (in both variables) to LSRCS so that the 1071.138Sdsl# 'normal' .c file for assembly files is used for the lint librray. 1081.138Sdsl# 1091.138Sdsl# Usage: 1101.138Sdsl# Add .S files to NO_SRSC when another .S file provides the entry points. 1111.138Sdsl# Add .c files to NO_SRSC when another .c file provides the entry points. 1121.138Sdsl# (lint is run on all .c files in SRCS) 1131.138Sdsl 1141.138Sdsl.for check_file in ${SRCS:M*.S} ${NO_SRCS} 1151.138Sdslunwanted_file := ${SRCS:M${check_file:.S=.c}} 1161.137Sdsl.if "${unwanted_file}" != "" 1171.137SdslSRCS := ${SRCS:N${unwanted_file}} 1181.138Sdsl.if "${unwanted_file}" != "${check_file}" 1191.138SdslLSRCS := ${LSRCS} ${unwanted_file} 1201.138Sdsl.endif 1211.137Sdsl.endif 1221.137Sdsl.endfor 1231.137Sdsl 1241.109SjmmvNLS= C.msg Pig.msg ca.msg cs.msg de.msg es.msg fi.msg fr.msg nl.msg \ 1251.110Ssalo no.msg pl.msg sk.msg sv.msg 1261.1Scgd 1271.140Suebayasirealall: tags 1281.145Sdrochnertags: ${SRCS} 1291.118Slukem ${_MKTARGET_CREATE} 1301.115Sross -${TOOL_CTAGS} -w ${.ALLSRC:M*.c} 1311.115Sross -egrep "^ENTRY(.*)|^FUNC(.*)|^SYSCALL(.*)" /dev/null ${.ALLSRC:M*.S} | \ 1321.36Scgd sed "s;\([^:]*\):\([^(]*\)(\([^, )]*\)\(.*\);\3 \1 /^\2(\3\4$$/;" \ 1331.64Schristos >> ${.TARGET}; sort -o ${.TARGET} ${.TARGET} 1341.65Schristos 1351.145SdrochnerFILES= tags 1361.82StvFILESNAME= libc.tags 1371.82StvFILESDIR= /var/db 1381.32Scgd 1391.97Sitojun 1401.103Stshiozak# workaround for I18N stuffs: build singlebyte setlocale() for libc.a, 1411.97Sitojun# multibyte for libc.so. the quirk should be removed when we support 1421.97Sitojun# dlopen() from within statically linked binaries. 1431.130StnozakiCSHLIBFLAGS+= -D_I18N_DYNAMIC 1441.105Syamt 1451.105Syamt.include <bsd.lib.mk> 1461.133Sad 1471.133Sad# force the dynamic linker to initialize libc first 1481.134SheSHLIB_SHFLAGS+= -Wl,-z,initfirst 149