Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. =================================================================== RCS file: /ftp/cvs/cvsroot/src/share/mk/bsd.prog.mk,v rcsdiff: /ftp/cvs/cvsroot/src/share/mk/bsd.prog.mk,v: warning: Unknown phrases like `commitid ...;' are present. retrieving revision 1.257.2.3 retrieving revision 1.270.2.1 diff -u -p -r1.257.2.3 -r1.270.2.1 --- src/share/mk/bsd.prog.mk 2011/03/05 15:09:27 1.257.2.3 +++ src/share/mk/bsd.prog.mk 2012/03/02 18:27:55 1.270.2.1 @@ -1,4 +1,4 @@ -# $NetBSD: bsd.prog.mk,v 1.257.2.3 2011/03/05 15:09:27 bouyer Exp $ +# $NetBSD: bsd.prog.mk,v 1.270.2.1 2012/03/02 18:27:55 riz Exp $ # @(#)bsd.prog.mk 8.2 (Berkeley) 4/2/94 .ifndef HOSTPROG @@ -14,7 +14,6 @@ ##### Basic targets realinstall: proginstall scriptsinstall -clean: cleanprog .gdbinit: rm -f .gdbinit @@ -27,10 +26,7 @@ clean: cleanprog echo "source ${__gdbinit}" >> .gdbinit .endfor -cleanobjs: .PHONY - -cleanprog: .PHONY cleanobjs cleanextra - rm -f a.out [Ee]rrs mklog core *.core .gdbinit +CLEANFILES+= a.out [Ee]rrs mklog core *.core .gdbinit .if defined(SHAREDSTRINGS) CLEANFILES+=strings @@ -52,16 +48,6 @@ AFLAGS+= ${PIE_AFLAGS} LDFLAGS+= ${PIE_LDFLAGS} .endif -##### Default values -.if !defined(HOSTLIB) -.if empty(CPPFLAGS:M-nostdinc) -CPPFLAGS+= ${DESTDIR:D-nostdinc ${CPPFLAG_ISYSTEM} ${DESTDIR}/usr/include} -.endif -.if empty(CXXFLAGS:M-nostdinc++) -CXXFLAGS+= ${DESTDIR:D-nostdinc++ ${CPPFLAG_ISYSTEMXX} ${DESTDIR}/usr/include/g++} -.endif -.endif - CFLAGS+= ${COPTS} OBJCFLAGS+= ${OBJCOPTS} MKDEP_SUFFIXES?= .o .ln @@ -94,30 +80,119 @@ LIBCRT0= ${DESTDIR}/usr/lib/crt0.o # LIBC?=${DESTDIR}/usr/lib/libc.a # LIBX11?=${DESTDIR}/usr/X11R7/lib/libX11.a # etc.. +# NB: If you are a library here, add it in bsd.README .for _lib in \ - archive asn1 bluetooth bsdmalloc bz2 c c_pic cdk com_err compat \ - crypt crypto crypto_idea crypto_mdc2 crypto_rc5 \ - curses dbm des edit event \ - fetch form fl g2c gcc gnumalloc gssapi hdb heimntlm hx509 intl ipsec \ - kadm5clnt kadm5srv kafs krb5 kvm l lber ldap ldap_r lua \ - m magic menu objc ossaudio pam pcap pci pmc posix pthread pthread_dbg \ - puffs radius resolv rmt roken rpcsvc rt rump rumpuser saslc skey sl ss \ - ssh ssl termcap usbhid util wrap y z bind9 dns lwres isccfg isccc isc \ - \ - rumpfs_cd9660fs rumpfs_efs rumpfs_ext2fs rumpfs_ffs rumpfs_hfs \ - rumpfs_lfs rumpfs_msdosfs rumpfs_nfs rumpfs_ntfs rumpfs_syspuffs \ - rumpfs_tmpfs rumpfs_udf rumpfs_ufs + archive \ + asn1 \ + atf_c \ + atf_cxx \ + bind9 \ + bluetooth \ + bsdmalloc \ + bz2 \ + c \ + c_pic \ + com_err \ + compat \ + crt0 \ + crypt \ + crypto \ + crypto_idea \ + crypto_mdc2 \ + crypto_rc5 \ + curses \ + dbm \ + des \ + dns \ + edit \ + event \ + expat \ + fetch \ + fl \ + form \ + g2c \ + gcc \ + gnumalloc \ + gssapi \ + hdb \ + heimbase \ + heimntlm \ + hx509 \ + intl \ + ipsec \ + isc \ + isccc \ + isccfg \ + kadm5clnt \ + kadm5srv \ + kafs \ + krb5 \ + kvm \ + l \ + lber \ + ldap \ + ldap_r \ + lua \ + lwres \ + m \ + magic \ + menu \ + objc \ + ossaudio \ + pam \ + pcap \ + pci \ + pmc \ + posix \ + pthread \ + pthread_dbg \ + puffs \ + quota \ + radius \ + resolv \ + rmt \ + roken \ + rpcsvc \ + rt \ + rump \ + rumpfs_cd9660fs \ + rumpfs_efs \ + rumpfs_ext2fs \ + rumpfs_ffs \ + rumpfs_hfs \ + rumpfs_lfs \ + rumpfs_msdosfs \ + rumpfs_nfs \ + rumpfs_ntfs \ + rumpfs_syspuffs \ + rumpfs_tmpfs \ + rumpfs_udf \ + rumpfs_ufs \ + rumpuser \ + saslc \ + skey \ + sl \ + sqlite3 \ + ss \ + ssh \ + ssl \ + ssp \ + stdcxx \ + supcxx \ + terminfo \ + tre \ + usbhid \ + util \ + wind \ + wrap \ + y \ + z .ifndef LIB${_lib:tu} -LIB${_lib:tu}= ${DESTDIR}/usr/lib/lib${_lib}.a +LIB${_lib:tu}= ${DESTDIR}/usr/lib/lib${_lib:S/xx/++/:S/atf_c/atf-c/}.a .MADE: ${LIB${_lib:tu}} # Note: ${DESTDIR} will be expanded .endif .endfor -# atf-c and atf-c++ are special cases because we cannot use [-+] as part of -# make(1) variable names. Just define them here. -LIBATF_C= ${DESTDIR}/usr/lib/libatf-c.a -LIBATF_CXX= ${DESTDIR}/usr/lib/libatf-c++.a -.MADE: ${LIBATF_C} ${LIBATF_CXX} # PAM applications, if linked statically, need more libraries .if (${MKPIC} == "no") @@ -126,9 +201,10 @@ PAM_STATIC_LDADD+= -lssh PAM_STATIC_DPADD+= ${LIBSSH} .endif .if (${MKKERBEROS} != "no") -PAM_STATIC_LDADD+= -lkafs -lkrb5 -lhx509 -lasn1 -lroken -lcom_err -lcrypto -PAM_STATIC_DPADD+= ${LIBKAFS} ${LIBKRB5} ${LIBHX509} ${LIBASN1} ${LIBROKEN} \ - ${LIBCOM_ERR} ${LIBCRYPTO} +PAM_STATIC_LDADD+= -lkafs -lkrb5 -lhx509 -lwind -lasn1 \ + -lroken -lcom_err -lheimbase -lcrypto +PAM_STATIC_DPADD+= ${LIBKAFS} ${LIBKRB5} ${LIBHX509} ${LIBWIND} ${LIBASN1} \ + ${LIBROKEN} ${LIBCOM_ERR} ${LIBHEIMBASE} ${LIBCRYPTO} .endif .if (${MKSKEY} != "no") PAM_STATIC_LDADD+= -lskey @@ -141,22 +217,43 @@ PAM_STATIC_LDADD= PAM_STATIC_DPADD= .endif -# These need + -> X transformations -.ifndef LIBSTDCXX -LIBSTDCXX= ${DESTDIR}/usr/lib/libstdc++.a -.MADE: ${LIBSTDCXX} -.endif - -.ifndef LIBSUPCXX -LIBSUPCXX= ${DESTDIR}/usr/lib/libsupc++.a -.MADE: ${LIBSUPCXX} -.endif - +# NB: If you are a library here, add it in bsd.README .for _lib in \ - dps expat fntstubs fontcache fontconfig fontenc freetype FS \ - GL GLU ICE lbxutil SM X11 Xau Xaw Xdmcp Xext Xfont Xft \ - Xi Xinerama xkbfile Xmu Xmuu Xpm Xrandr Xrender Xss Xt \ - XTrap Xtst Xv Xxf86dga Xxf86misc Xxf86vm + FS \ + GL \ + GLU \ + ICE \ + SM \ + X11 \ + XTrap \ + Xau \ + Xaw \ + Xdmcp \ + Xext \ + Xfont \ + Xft \ + Xi \ + Xinerama \ + Xmu \ + Xmuu \ + Xpm \ + Xrandr \ + Xrender \ + Xss \ + Xt \ + Xtst \ + Xv \ + Xxf86dga \ + Xxf86misc \ + Xxf86vm \ + dps \ + fntstubs \ + fontcache \ + fontconfig \ + fontenc \ + freetype \ + lbxutil \ + xkbfile .ifndef LIB${_lib:tu} LIB${_lib:tu}= ${DESTDIR}${X11USRLIBDIR}/lib${_lib}.a .MADE: ${LIB${_lib:tu}} # Note: ${DESTDIR} will be expanded @@ -172,15 +269,12 @@ _PROGLDOPTS= _PROGLDOPTS+= -Wl,-dynamic-linker=${_SHLINKER} .endif .if ${SHLIBDIR} != "/usr/lib" -_PROGLDOPTS+= -Wl,-rpath-link,${DESTDIR}${SHLIBDIR} \ - -Wl,-rpath,${SHLIBDIR} \ - -L${DESTDIR}${SHLIBDIR} +_PROGLDOPTS+= -Wl,-rpath,${SHLIBDIR} \ + -L=${SHLIBDIR} .elif ${SHLIBINSTALLDIR} != "/usr/lib" _PROGLDOPTS+= -Wl,-rpath-link,${DESTDIR}${SHLIBINSTALLDIR} \ - -L${DESTDIR}${SHLIBINSTALLDIR} + -L=${SHLIBINSTALLDIR} .endif -_PROGLDOPTS+= -Wl,-rpath-link,${DESTDIR}/usr/lib \ - -L${DESTDIR}/usr/lib __proginstall: .USE ${_MKTARGET_INSTALL} @@ -208,9 +302,6 @@ _APPEND_MANS=yes _APPEND_SRCS=yes _CCLINKFLAGS= -.if defined(DESTDIR) -_CCLINKFLAGS+= -B${_GCC_CRTDIR}/ -B${DESTDIR}/usr/lib/ -.endif .if defined(PROG_CXX) PROG= ${PROG_CXX} @@ -327,10 +418,8 @@ ${_P}: .gdbinit ${LIBCRT0} ${OBJS.${_P}} .if !commands(${_P}) ${_MKTARGET_LINK} ${_CCLINK.${_P}} \ - ${DESTDIR:D-Wl,-nostdlib} \ ${_LDFLAGS.${_P}} ${_LDSTATIC.${_P}} -o ${.TARGET} \ ${OBJS.${_P}} ${_LDADD.${_P}} \ - ${DESTDIR:D-L${_GCC_LIBGCCDIR}} \ ${_PROGLDOPTS} .if defined(CTFMERGE) ${CTFMERGE} ${CTFMFLAGS} -o ${.TARGET} ${OBJS.${_P}} @@ -367,14 +456,10 @@ MAN+= ${MAN.${_P}} realall: ${_P} ${_PROGDEBUG.${_P}} -cleanprog: cleanprog-${_P} -cleanprog-${_P}: - rm -f ${_P} ${_PROGDEBUG.${_P}} +CLEANFILES+= ${_P} ${_PROGDEBUG.${_P}} .if defined(OBJS.${_P}) && !empty(OBJS.${_P}) -cleanobjs: cleanobjs-${_P} -cleanobjs-${_P}: - rm -f ${OBJS.${_P}} ${LOBJS.${_P}} +CLEANFILES+= ${OBJS.${_P}} ${LOBJS.${_P}} .endif _PROG_INSTALL+= proginstall-${_P} @@ -429,9 +514,7 @@ lint-${_P}: ${LOBJS.${_P}} .if defined(OBJS) && !empty(OBJS) && \ (empty(PROGS) && empty(PROGS_CXX)) -cleanobjs: cleanobjs-plain -cleanobjs-plain: - rm -f ${OBJS} ${LOBJS} +CLEANFILES+= ${OBJS} ${LOBJS} .endif .if !target(proginstall) @@ -490,11 +573,8 @@ LINKSMODE?= ${BINMODE} .include .include .include - -cleanextra: .PHONY -.if defined(CLEANFILES) && !empty(CLEANFILES) - rm -f ${CLEANFILES} -.endif +.include +.include ${TARGETS}: # ensure existence