version 1.209, 2006/03/16 18:43:34 |
version 1.269.2.3, 2012/10/30 18:59:47 |
|
|
.include <bsd.shlib.mk> |
.include <bsd.shlib.mk> |
.include <bsd.gcc.mk> |
.include <bsd.gcc.mk> |
|
|
.if defined(PROG_CXX) |
# |
PROG= ${PROG_CXX} |
# Definitions and targets shared among all programs built by a single |
.endif |
# Makefile. |
|
# |
|
|
##### Basic targets |
##### Basic targets |
realinstall: proginstall scriptsinstall |
realinstall: proginstall scriptsinstall |
clean: cleanprog |
|
|
|
##### PROG specific flags. |
.gdbinit: |
COPTS+= ${COPTS.${PROG}} |
rm -f .gdbinit |
CPPFLAGS+= ${CPPFLAGS.${PROG}} |
.if defined(DESTDIR) && !empty(DESTDIR) |
CXXFLAGS+= ${CXXFLAGS.${PROG}} |
echo "set solib-absolute-prefix ${DESTDIR}" > .gdbinit |
LDADD+= ${LDADD.${PROG}} |
.else |
LDFLAGS+= ${LDFLAGS.${PROG}} |
touch .gdbinit |
LDSTATIC+= ${LDSTATIC.${PROG}} |
.endif |
|
.for __gdbinit in ${GDBINIT} |
##### Default values |
echo "source ${__gdbinit}" >> .gdbinit |
CPPFLAGS+= ${DESTDIR:D-nostdinc ${CPPFLAG_ISYSTEM} ${DESTDIR}/usr/include} |
.endfor |
CXXFLAGS+= ${DESTDIR:D-nostdinc++ ${CPPFLAG_ISYSTEMXX} ${DESTDIR}/usr/include/g++} |
|
|
CLEANFILES+= a.out [Ee]rrs mklog core *.core .gdbinit |
|
|
|
.if defined(SHAREDSTRINGS) |
|
CLEANFILES+=strings |
|
.c.o: |
|
${CC} -E ${CPPFLAGS} ${CFLAGS} ${.IMPSRC} | xstr -c - |
|
@${CC} ${CPPFLAGS} ${CFLAGS} -c x.c -o ${.TARGET} |
|
@rm -f x.c |
|
|
|
.cc.o .cpp.o .cxx.o .C.o: |
|
${CXX} -E ${CPPFLAGS} ${CXXFLAGS} ${.IMPSRC} | xstr -c - |
|
@mv -f x.c x.cc |
|
@${CXX} ${CPPFLAGS} ${CXXFLAGS} -c x.cc -o ${.TARGET} |
|
@rm -f x.cc |
|
.endif |
|
|
|
.if defined(MKPIE) && (${MKPIE} != "no") |
|
CFLAGS+= ${PIE_CFLAGS} |
|
AFLAGS+= ${PIE_AFLAGS} |
|
LDFLAGS+= ${PIE_LDFLAGS} |
|
.endif |
|
|
CFLAGS+= ${COPTS} |
CFLAGS+= ${COPTS} |
|
OBJCFLAGS+= ${OBJCOPTS} |
MKDEP_SUFFIXES?= .o .ln |
MKDEP_SUFFIXES?= .o .ln |
|
|
|
# CTF preserve debug symbols |
|
.if defined(MKDTRACE) && (${MKDTRACE} != "no") && (${CFLAGS:M-g} != "") |
|
CTFFLAGS+= -g |
|
CTFMFLAGS+= -g |
|
.endif |
|
|
# ELF platforms depend on crti.o, crtbegin.o, crtend.o, and crtn.o |
# ELF platforms depend on crti.o, crtbegin.o, crtend.o, and crtn.o |
.if ${OBJECT_FMT} == "ELF" |
|
.ifndef LIBCRTBEGIN |
.ifndef LIBCRTBEGIN |
LIBCRTBEGIN= ${DESTDIR}/usr/lib/crti.o ${_GCC_CRTBEGIN} |
LIBCRTBEGIN= ${DESTDIR}/usr/lib/crti.o ${_GCC_CRTBEGIN} |
.MADE: ${LIBCRTBEGIN} |
.MADE: ${LIBCRTBEGIN} |
Line 40 LIBCRTEND= ${_GCC_CRTEND} ${DESTDIR}/usr |
|
Line 68 LIBCRTEND= ${_GCC_CRTEND} ${DESTDIR}/usr |
|
.MADE: ${LIBCRTEND} |
.MADE: ${LIBCRTEND} |
.endif |
.endif |
_SHLINKER= ${SHLINKDIR}/ld.elf_so |
_SHLINKER= ${SHLINKDIR}/ld.elf_so |
.else |
|
LIBCRTBEGIN?= |
|
LIBCRTEND?= |
|
_SHLINKER= ${SHLINKDIR}/ld.so |
|
.endif |
|
|
|
.ifndef LIBCRT0 |
.ifndef LIBCRT0 |
LIBCRT0= ${DESTDIR}/usr/lib/crt0.o |
LIBCRT0= ${DESTDIR}/usr/lib/crt0.o |
Line 55 LIBCRT0= ${DESTDIR}/usr/lib/crt0.o |
|
Line 78 LIBCRT0= ${DESTDIR}/usr/lib/crt0.o |
|
# |
# |
# E.g. |
# E.g. |
# LIBC?=${DESTDIR}/usr/lib/libc.a |
# LIBC?=${DESTDIR}/usr/lib/libc.a |
# LIBX11?=${DESTDIR}/usr/X11R6/lib/libX11.a |
# LIBX11?=${DESTDIR}/usr/X11R7/lib/libX11.a |
# etc.. |
# etc.. |
|
# NB: If you are a library here, add it in bsd.README |
|
|
.for _lib in \ |
.for _lib in \ |
asn1 bsdmalloc bz2 c c_pic cdk com_err compat crypt \ |
archive \ |
crypto crypto_idea crypto_mdc2 crypto_rc5 \ |
asn1 \ |
curses dbm des edit event \ |
atf_c \ |
form fl g2c gcc gnumalloc gssapi hdb intl ipsec \ |
atf_cxx \ |
kadm kadm5clnt kadm5srv kafs kdb krb krb5 kstream kvm l \ |
bind9 \ |
m magic menu objc ossaudio pam pcap pci pmc posix pthread pthread_dbg \ |
bluetooth \ |
radius resolv rmt roken rpcsvc rt skey sl ss ssh ssl termcap \ |
bsdmalloc \ |
usbhid util wrap y z |
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} |
.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 |
.MADE: ${LIB${_lib:tu}} # Note: ${DESTDIR} will be expanded |
.endif |
.endif |
.endfor |
.endfor |
Line 80 PAM_STATIC_LDADD+= -lssh |
|
Line 201 PAM_STATIC_LDADD+= -lssh |
|
PAM_STATIC_DPADD+= ${LIBSSH} |
PAM_STATIC_DPADD+= ${LIBSSH} |
.endif |
.endif |
.if (${MKKERBEROS} != "no") |
.if (${MKKERBEROS} != "no") |
PAM_STATIC_LDADD+= -lkafs -lkrb -lkrb5 -lasn1 -lroken -lcom_err -lcrypto |
PAM_STATIC_LDADD+= -lkafs -lkrb5 -lhx509 -lwind -lasn1 \ |
PAM_STATIC_DPADD+= ${LIBKAFS} ${LIBKRB} ${LIBKRB5} ${LIBASN1} ${LIBROKEN} \ |
-lroken -lcom_err -lheimbase -lcrypto |
${LIBCOM_ERR} ${LIBCRYPTO} |
PAM_STATIC_DPADD+= ${LIBKAFS} ${LIBKRB5} ${LIBHX509} ${LIBWIND} ${LIBASN1} \ |
|
${LIBROKEN} ${LIBCOM_ERR} ${LIBHEIMBASE} ${LIBCRYPTO} |
.endif |
.endif |
.if (${MKSKEY} != "no") |
.if (${MKSKEY} != "no") |
PAM_STATIC_LDADD+= -lskey |
PAM_STATIC_LDADD+= -lskey |
Line 95 PAM_STATIC_LDADD= |
|
Line 217 PAM_STATIC_LDADD= |
|
PAM_STATIC_DPADD= |
PAM_STATIC_DPADD= |
.endif |
.endif |
|
|
.ifndef LIBSTDCXX |
# NB: If you are a library here, add it in bsd.README |
LIBSTDCXX= ${DESTDIR}/usr/lib/libstdc++.a |
|
.MADE: ${LIBSTDCXX} |
|
.endif |
|
|
|
.for _lib in \ |
.for _lib in \ |
dps expat fntstubs fontcache fontconfig fontenc freetype FS \ |
FS \ |
GL GLU ICE lbxutil SM X11 Xau Xaw Xdmcp Xext Xfont Xft \ |
GL \ |
Xi Xinerama xkbfile Xmu Xmuu Xpm Xrandr Xrender Xss Xt \ |
GLU \ |
XTrap Xtst Xv Xxf86dga Xxf86misc Xxf86vm |
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} |
.ifndef LIB${_lib:tu} |
LIB${_lib:tu}= ${DESTDIR}/usr/X11R6/lib/lib${_lib}.a |
LIB${_lib:tu}= ${DESTDIR}${X11USRLIBDIR}/lib${_lib}.a |
.MADE: ${LIB${_lib:tu}} # Note: ${DESTDIR} will be expanded |
.MADE: ${LIB${_lib:tu}} # Note: ${DESTDIR} will be expanded |
.endif |
.endif |
.endfor |
.endfor |
|
|
|
.if defined(RESCUEDIR) |
|
CPPFLAGS+= -DRESCUEDIR=\"${RESCUEDIR}\" |
|
.endif |
|
|
##### Build and install rules |
_PROGLDOPTS= |
.if defined(SHAREDSTRINGS) |
.if ${SHLINKDIR} != "/usr/libexec" # XXX: change or remove if ld.so moves |
CLEANFILES+=strings |
_PROGLDOPTS+= -Wl,-dynamic-linker=${_SHLINKER} |
.c.o: |
.endif |
${CC} -E ${CFLAGS} ${.IMPSRC} | xstr -c - |
.if ${SHLIBDIR} != "/usr/lib" |
@${CC} ${CFLAGS} -c x.c -o ${.TARGET} |
_PROGLDOPTS+= -Wl,-rpath,${SHLIBDIR} \ |
@rm -f x.c |
-L=${SHLIBDIR} |
|
.elif ${SHLIBINSTALLDIR} != "/usr/lib" |
.cc.o .cpp.o .cxx.o .C.o: |
_PROGLDOPTS+= -Wl,-rpath-link,${DESTDIR}${SHLIBINSTALLDIR} \ |
${CXX} -E ${CXXFLAGS} ${.IMPSRC} | xstr -c - |
-L=${SHLIBINSTALLDIR} |
@mv -f x.c x.cc |
|
@${CXX} ${CXXFLAGS} -c x.cc -o ${.TARGET} |
|
@rm -f x.cc |
|
.endif |
.endif |
|
|
.if defined(PROG) |
__proginstall: .USE |
|
${_MKTARGET_INSTALL} |
|
${INSTALL_FILE} -o ${BINOWN} -g ${BINGRP} -m ${BINMODE} \ |
|
${STRIPFLAG} ${.ALLSRC} ${.TARGET} |
|
|
|
__progrumpinstall: .USE |
|
${_MKTARGET_INSTALL} |
|
${INSTALL_FILE} -o ${RUMPBINOWN} -g ${RUMPBINGRP} -m ${RUMPBINMODE} \ |
|
${STRIPFLAG} ${.ALLSRC} ${.TARGET} |
|
|
|
__progdebuginstall: .USE |
|
${_MKTARGET_INSTALL} |
|
${INSTALL_FILE} -o ${DEBUGOWN} -g ${DEBUGGRP} -m ${DEBUGMODE} \ |
|
${.ALLSRC} ${.TARGET} |
|
|
|
|
|
|
|
# |
|
# Backwards compatibility with Makefiles that assume that bsd.prog.mk |
|
# can only build a single binary. |
|
# |
|
|
|
_APPEND_MANS=yes |
|
_APPEND_SRCS=yes |
|
|
|
_CCLINKFLAGS= |
|
|
.if defined(PROG_CXX) |
.if defined(PROG_CXX) |
SRCS?= ${PROG}.cc |
PROG= ${PROG_CXX} |
.else |
_CCLINK= ${CXX} ${_CCLINKFLAGS} |
SRCS?= ${PROG}.c |
|
.endif |
.endif |
|
|
.if defined(RESCUEDIR) |
.if defined(RUMPPRG) |
CPPFLAGS+= -DRESCUEDIR=\"${RESCUEDIR}\" |
PROG= ${RUMPPRG} |
|
. ifndef CRUNCHEDPROG |
|
. if (${MKRUMP} != "no") |
|
PROGS= ${RUMPPRG} rump.${RUMPPRG} |
|
. else |
|
PROGS= ${RUMPPRG} |
|
. endif |
|
. if defined(SRCS) |
|
. if (${MKRUMP} != "no") |
|
SRCS.rump.${PROG}:= ${SRCS} ${PROG}_rumpops.c ${RUMPSRCS} |
|
. endif |
|
SRCS+= ${PROG}_hostops.c |
|
. else |
|
SRCS= ${PROG}.c ${PROG}_hostops.c |
|
. if (${MKRUMP} != "no") |
|
SRCS.rump.${PROG}= ${PROG}.c ${PROG}_rumpops.c ${RUMPSRCS} |
|
. endif |
|
. endif |
|
. if (${MKRUMP} != "no") |
|
DPSRCS+= ${PROG}_rumpops.c ${RUMPSRCS} |
|
LDADD.rump.${PROG}+= -lrumpclient |
|
DPADD.rump.${PROG}+= ${LIBRUMPCLIENT} |
|
MAN.rump.${PROG}= # defined but feeling empty |
|
_RUMPINSTALL.rump.${PROG}=# defined |
|
. endif |
|
. else # CRUNCHEDPROG |
|
PROGS= ${PROG} |
|
CPPFLAGS+= -DCRUNCHOPS |
|
. endif |
.endif |
.endif |
|
|
_YPSRCS= ${SRCS:M*.[ly]:C/\..$/.c/} ${YHEADER:D${SRCS:M*.y:.y=.h}} |
.if defined(PROG) |
|
_CCLINK?= ${CC} ${_CCLINKFLAGS} |
|
. if defined(MAN) |
|
MAN.${PROG}= ${MAN} |
|
_APPEND_MANS= no |
|
. endif |
|
. if !defined(OBJS) |
|
OBJS= ${OBJS.${PROG}} |
|
. endif |
|
. if defined(PROGNAME) |
|
PROGNAME.${PROG}= ${PROGNAME} |
|
. endif |
|
. if defined(SRCS) |
|
SRCS.${PROG}= ${SRCS} |
|
_APPEND_SRCS= no |
|
. endif |
|
.endif |
|
|
|
# Turn the single-program PROG and PROG_CXX variables into their multi-word |
|
# counterparts, PROGS and PROGS_CXX. |
|
.if !defined(RUMPPRG) |
|
. if defined(PROG_CXX) && !defined(PROGS_CXX) |
|
PROGS_CXX= ${PROG_CXX} |
|
. elif defined(PROG) && !defined(PROGS) |
|
PROGS= ${PROG} |
|
. endif |
|
.endif |
|
|
DPSRCS+= ${_YPSRCS} |
# |
CLEANFILES+= ${_YPSRCS} |
# Per-program definitions and targets. |
|
# |
|
|
.if !empty(SRCS:N*.h:N*.sh:N*.fth) |
_CCLINK.CDEFAULT= ${CC} ${_CCLINKFLAGS} |
OBJS+= ${SRCS:N*.h:N*.sh:N*.fth:R:S/$/.o/g} |
# Definitions specific to C programs. |
LOBJS+= ${LSRCS:.c=.ln} ${SRCS:M*.c:.c=.ln} |
.for _P in ${PROGS} |
.endif |
SRCS.${_P}?= ${_P}.c |
|
_CCLINK.${_P}= ${CC} ${_CCLINKFLAGS} |
|
_CFLAGS.${_P}= ${CFLAGS} ${CPUFLAGS} |
|
_CPPFLAGS.${_P}= ${CPPFLAGS} |
|
_COPTS.${_P}= ${COPTS} |
|
.endfor |
|
|
.if defined(OBJS) && !empty(OBJS) |
_CCLINK.CXXDEFAULT= ${CXX} ${_CCLINKFLAGS} |
.NOPATH: ${OBJS} ${PROG} ${_YPSRCS} |
# Definitions specific to C++ programs. |
|
.for _P in ${PROGS_CXX} |
|
SRCS.${_P}?= ${_P}.cc |
|
_CCLINK.${_P}= ${CXX} ${_CCLINKFLAGS} |
|
.endfor |
|
|
_PROGLDOPTS= |
# Language-independent definitions. |
.if ${SHLINKDIR} != "/usr/libexec" # XXX: change or remove if ld.so moves |
.for _P in ${PROGS} ${PROGS_CXX} # { |
.if ${OBJECT_FMT} == "ELF" |
|
_PROGLDOPTS+= -Wl,-dynamic-linker=${_SHLINKER} |
BINDIR.${_P}?= ${BINDIR} |
.endif |
PROGNAME.${_P}?= ${_P} |
.endif |
|
.if ${SHLIBDIR} != "/usr/lib" |
.if ${MKDEBUG} != "no" && !commands(${_P}) |
_PROGLDOPTS+= -Wl,-rpath-link,${DESTDIR}${SHLIBDIR}:${DESTDIR}/usr/lib \ |
_PROGDEBUG.${_P}:= ${PROGNAME.${_P}}.debug |
-R${SHLIBDIR} \ |
|
-L${DESTDIR}${SHLIBDIR} |
|
.elif ${SHLIBINSTALLDIR} != "/usr/lib" |
|
_PROGLDOPTS+= -Wl,-rpath-link,${DESTDIR}${SHLIBINSTALLDIR}:${DESTDIR}/usr/lib \ |
|
-L${DESTDIR}${SHLIBINSTALLDIR} |
|
.endif |
.endif |
|
|
.if defined(PROG_CXX) |
.if defined(PAXCTL_FLAGS) |
_CCLINK= ${CXX} |
PAXCTL_FLAGS.${_P}?= ${PAXCTL_FLAGS} |
.if ${USE_LIBSTDCXX} == "no" |
|
_SUPCXX= -lsupc++ -lm |
|
.else |
|
_SUPCXX= -lstdc++ -lm |
|
.endif |
.endif |
.else |
|
_CCLINK= ${CC} |
##### PROG specific flags. |
|
|
|
_DPADD.${_P}= ${DPADD} ${DPADD.${_P}} |
|
_LDADD.${_P}= ${LDADD} ${LDADD.${_P}} |
|
_LDFLAGS.${_P}= ${LDFLAGS} ${LDFLAGS.${_P}} |
|
_LDSTATIC.${_P}= ${LDSTATIC} ${LDSTATIC.${_P}} |
|
|
|
##### Build and install rules |
|
.if !empty(_APPEND_SRCS:M[Yy][Ee][Ss]) |
|
SRCS+= ${SRCS.${_P}} # For bsd.dep.mk |
.endif |
.endif |
|
|
.gdbinit: |
_YPSRCS.${_P}= ${SRCS.${_P}:M*.[ly]:C/\..$/.c/} ${YHEADER:D${SRCS.${_P}:M*.y:.y=.h}} |
rm -f .gdbinit |
|
.if defined(DESTDIR) && !empty(DESTDIR) |
DPSRCS+= ${_YPSRCS.${_P}} |
echo "set solib-absolute-prefix ${DESTDIR}" > .gdbinit |
CLEANFILES+= ${_YPSRCS.${_P}} |
|
|
|
.if !empty(SRCS.${_P}:N*.h:N*.sh:N*.fth) |
|
OBJS.${_P}+= ${SRCS.${_P}:N*.h:N*.sh:N*.fth:R:S/$/.o/g} |
|
LOBJS.${_P}+= ${LSRCS:.c=.ln} ${SRCS.${_P}:M*.c:.c=.ln} |
|
.endif |
|
|
|
.if defined(OBJS.${_P}) && !empty(OBJS.${_P}) # { |
|
.NOPATH: ${OBJS.${_P}} ${_P} ${_YPSRCS.${_P}} |
|
|
|
.if (defined(USE_COMBINE) && ${USE_COMBINE} != "no" && !commands(${_P}) \ |
|
&& (${_CCLINK.${_P}} == ${_CCLINK.CDEFAULT} \ |
|
|| ${_CCLINK.${_P}} == ${_CCLINK.CXXDEFAULT}) \ |
|
&& !defined(NOCOMBINE.${_P}) && !defined(NOCOMBINE)) |
|
.for f in ${SRCS.${_P}:N*.h:N*.sh:N*.fth:C/\.[yl]$/.c/g} |
|
#_XFLAGS.$f := ${CPPFLAGS.$f:D1} ${CPUFLAGS.$f:D2} \ |
|
# ${COPTS.$f:D3} ${OBJCOPTS.$f:D4} ${CXXFLAGS.$f:D5} |
|
.if (${CPPFLAGS.$f:D1} == "1" || ${CPUFLAGS.$f:D2} == "2" \ |
|
|| ${COPTS.$f:D3} == "3" || ${OBJCOPTS.$f:D4} == "4" \ |
|
|| ${CXXFLAGS.$f:D5} == "5") \ |
|
|| ("${f:M*.[cyl]}" == "" || commands(${f:R:S/$/.o/})) |
|
XOBJS.${_P}+= ${f:R:S/$/.o/} |
.else |
.else |
touch .gdbinit |
XSRCS.${_P}+= ${f} |
|
NODPSRCS+= ${f} |
.endif |
.endif |
.for __gdbinit in ${GDBINIT} |
|
echo "source ${__gdbinit}" >> .gdbinit |
|
.endfor |
.endfor |
|
|
${OBJS} ${LOBJS}: ${DPSRCS} |
${_P}: .gdbinit ${LIBCRT0} ${XOBJS.${_P}} ${SRCS.${_P}} ${DPSRCS} ${LIBC} ${LIBCRTBEGIN} ${LIBCRTEND} ${_DPADD.${_P}} |
|
|
${PROG}: .gdbinit ${LIBCRT0} ${OBJS} ${LIBC} ${LIBCRTBEGIN} ${LIBCRTEND} ${DPADD} |
|
.if !commands(${PROG}) |
|
${_MKTARGET_LINK} |
${_MKTARGET_LINK} |
.if defined(DESTDIR) |
.if defined(DESTDIR) |
${_CCLINK} -Wl,-nostdlib \ |
${_CCLINK.${_P}} -Wl,-nostdlib \ |
${LDFLAGS} ${LDSTATIC} -o ${.TARGET} ${_PROGLDOPTS} \ |
${_LDFLAGS.${_P}} ${_LDSTATIC.${_P}} -o ${.TARGET} ${_PROGLDOPTS} \ |
-B${_GCC_CRTDIR}/ -B${DESTDIR}/usr/lib/ \ |
-B${_GCC_CRTDIR}/ -B${DESTDIR}/usr/lib/ \ |
${OBJS} ${LDADD} \ |
-MD --combine ${_CPPFLAGS.${_P}} ${_CFLAGS.${_P}} ${_COPTS.${_P}} \ |
-L${_GCC_LIBGCCDIR} -L${DESTDIR}/usr/lib |
${XSRCS.${_P}:@.SRC.@${.ALLSRC:M*.c:M*${.SRC.}}@:O:u} ${XOBJS.${_P}} \ |
|
${_LDADD.${_P}} -L${_GCC_LIBGCCDIR} -L${DESTDIR}/usr/lib |
.else |
.else |
${_CCLINK} ${LDFLAGS} ${LDSTATIC} -o ${.TARGET} ${_PROGLDOPTS} ${OBJS} ${LDADD} |
${_CCLINK.${_P}} ${_LDFLAGS.${_P}} ${_LDSTATIC.${_P}} -o ${.TARGET} ${_PROGLDOPTS} \ |
|
-MD --combine ${_CPPFLAGS.${_P}} ${_COPTS.${_P}} |
|
${XSRCS.${_P}:@.SRC.@${.ALLSRC:M*.c:M*${.SRC.}}@:O:u} ${XOBJS.${_P}} \ |
|
${_LDADD.${_P}} |
.endif # defined(DESTDIR) |
.endif # defined(DESTDIR) |
.endif # !commands(${PROG}) |
.if defined(CTFMERGE) |
|
${CTFMERGE} ${CTFMFLAGS} -o ${.TARGET} ${OBJS.${_P}} |
${PROG}.ro: ${OBJS} ${DPADD} |
.endif |
${_MKTARGET_LINK} |
.if defined(PAXCTL_FLAGS.${_P}) |
${LD} -r -dc -o ${.TARGET} ${OBJS} |
${PAXCTL} ${PAXCTL_FLAGS.${_P}} ${.TARGET} |
|
.endif |
|
.if ${MKSTRIPIDENT} != "no" |
|
${OBJCOPY} -R .ident ${.TARGET} |
|
.endif |
|
|
.endif # defined(OBJS) && !empty(OBJS) |
CLEANFILES+= ${_P}.d |
|
.if exists(${_P}.d) |
|
.include "${_P}.d" # include -MD depend for program. |
|
.endif |
|
.else # USE_COMBINE |
|
|
.if !defined(MAN) |
${OBJS.${_P}} ${LOBJS.${_P}}: ${DPSRCS} |
MAN= ${PROG}.1 |
|
.endif # !defined(MAN) |
|
.endif # defined(PROG) |
|
|
|
realall: ${PROG} ${SCRIPTS} |
${_P}: .gdbinit ${LIBCRT0} ${OBJS.${_P}} ${LIBC} ${LIBCRTBEGIN} ${LIBCRTEND} ${_DPADD.${_P}} |
|
.if !commands(${_P}) |
|
${_MKTARGET_LINK} |
|
${_CCLINK.${_P}} \ |
|
${_LDFLAGS.${_P}} ${_LDSTATIC.${_P}} -o ${.TARGET} \ |
|
${OBJS.${_P}} ${_LDADD.${_P}} \ |
|
${_PROGLDOPTS} |
|
.if defined(CTFMERGE) |
|
${CTFMERGE} ${CTFMFLAGS} -o ${.TARGET} ${OBJS.${_P}} |
|
.endif |
|
.if defined(PAXCTL_FLAGS.${_P}) |
|
${PAXCTL} ${PAXCTL_FLAGS.${_P}} ${.TARGET} |
|
.endif |
|
.if ${MKSTRIPIDENT} != "no" |
|
${OBJCOPY} -R .ident ${.TARGET} |
|
.endif |
|
.endif # !commands(${_P}) |
|
.endif # USE_COMBINE |
|
|
cleanprog: .PHONY cleanobjs cleanextra |
${_P}.ro: ${OBJS.${_P}} ${_DPADD.${_P}} |
rm -f a.out [Ee]rrs mklog core *.core .gdbinit ${PROG} |
${_MKTARGET_LINK} |
|
${CC} ${LDFLAGS} -nostdlib -r -Wl,-dc -o ${.TARGET} ${OBJS.${_P}} |
|
|
cleanobjs: .PHONY |
.if defined(_PROGDEBUG.${_P}) |
.if defined(OBJS) && !empty(OBJS) |
${_PROGDEBUG.${_P}}: ${_P} |
rm -f ${OBJS} ${LOBJS} |
${_MKTARGET_CREATE} |
|
( ${OBJCOPY} --only-keep-debug ${_P} ${_PROGDEBUG.${_P}} \ |
|
&& ${OBJCOPY} --strip-debug -p -R .gnu_debuglink \ |
|
--add-gnu-debuglink=${_PROGDEBUG.${_P}} ${_P} \ |
|
) || (rm -f ${_PROGDEBUG.${_P}}; false) |
.endif |
.endif |
|
|
cleanextra: .PHONY |
.endif # defined(OBJS.${_P}) && !empty(OBJS.${_P}) # } |
.if defined(CLEANFILES) && !empty(CLEANFILES) |
|
rm -f ${CLEANFILES} |
.if !defined(MAN.${_P}) |
|
MAN.${_P}= ${_P}.1 |
|
.endif # !defined(MAN.${_P}) |
|
.if !empty(_APPEND_MANS:M[Yy][Ee][Ss]) |
|
MAN+= ${MAN.${_P}} |
.endif |
.endif |
|
|
.if defined(PROG) && !target(proginstall) |
realall: ${_P} ${_PROGDEBUG.${_P}} |
PROGNAME?=${PROG} |
|
|
|
proginstall:: ${DESTDIR}${BINDIR}/${PROGNAME} |
CLEANFILES+= ${_P} ${_PROGDEBUG.${_P}} |
.PRECIOUS: ${DESTDIR}${BINDIR}/${PROGNAME} |
|
|
|
__proginstall: .USE |
.if defined(OBJS.${_P}) && !empty(OBJS.${_P}) |
${_MKTARGET_INSTALL} |
CLEANFILES+= ${OBJS.${_P}} ${LOBJS.${_P}} |
${INSTALL_FILE} -o ${BINOWN} -g ${BINGRP} -m ${BINMODE} \ |
.endif |
${STRIPFLAG} ${.ALLSRC} ${.TARGET} |
|
|
_PROG_INSTALL+= proginstall-${_P} |
|
|
|
.if !target(proginstall-${_P}) # { |
|
proginstall-${_P}:: ${DESTDIR}${BINDIR.${_P}}/${PROGNAME.${_P}} \ |
|
${_PROGDEBUG.${_P}:D${DESTDIR}${DEBUGDIR}${BINDIR.${_P}}/${_PROGDEBUG.${_P}}} |
|
.PRECIOUS: ${DESTDIR}${BINDIR.${_P}}/${PROGNAME.${_P}} \ |
|
${_PROGDEBUG.${_P}:D${DESTDIR}${DEBUGDIR}${BINDIR.${_P}}/${_PROGDEBUG.${_P}}} |
|
|
.if ${MKUPDATE} == "no" |
.if ${MKUPDATE} == "no" |
${DESTDIR}${BINDIR}/${PROGNAME}! ${PROG} __proginstall |
.if defined(_RUMPINSTALL.${_P}) |
.if !defined(BUILD) && !make(all) && !make(${PROG}) |
${DESTDIR}${BINDIR.${_P}}/${PROGNAME.${_P}}! ${_P} __progrumpinstall |
${DESTDIR}${BINDIR}/${PROGNAME}! .MADE |
.else |
|
${DESTDIR}${BINDIR.${_P}}/${PROGNAME.${_P}}! ${_P} __proginstall |
.endif |
.endif |
|
.if !defined(BUILD) && !make(all) && !make(${_P}) |
|
${DESTDIR}${BINDIR.${_P}}/${PROGNAME.${_P}}! .MADE |
|
.endif |
|
.if defined(_PROGDEBUG.${_P}) |
|
${DESTDIR}${DEBUGDIR}${BINDIR.${_P}}/${_PROGDEBUG.${_P}}! ${_PROGDEBUG.${_P}} __progdebuginstall |
|
.if !defined(BUILD) && !make(all) && !make(${_P}) |
|
${DESTDIR}${DEBUGDIR}${BINDIR.${_P}}/${_PROGDEBUG.${_P}}! .MADE |
|
.endif |
|
.endif # define(_PROGDEBUG.${_P}) |
|
.else # MKUPDATE != no |
|
.if defined(_RUMPINSTALL.${_P}) |
|
${DESTDIR}${BINDIR.${_P}}/${PROGNAME.${_P}}: ${_P} __progrumpinstall |
.else |
.else |
${DESTDIR}${BINDIR}/${PROGNAME}: ${PROG} __proginstall |
${DESTDIR}${BINDIR.${_P}}/${PROGNAME.${_P}}: ${_P} __proginstall |
.if !defined(BUILD) && !make(all) && !make(${PROG}) |
.endif |
${DESTDIR}${BINDIR}/${PROGNAME}: .MADE |
.if !defined(BUILD) && !make(all) && !make(${_P}) |
|
${DESTDIR}${BINDIR.${_P}}/${PROGNAME.${_P}}: .MADE |
.endif |
.endif |
|
.if defined(_PROGDEBUG.${_P}) |
|
${DESTDIR}${DEBUGDIR}${BINDIR.${_P}}/${_PROGDEBUG.${_P}}: ${_PROGDEBUG.${_P}} __progdebuginstall |
|
.if !defined(BUILD) && !make(all) && !make(${_P}) |
|
${DESTDIR}${DEBUGDIR}${BINDIR.${_P}}/${_PROGDEBUG.${_P}}: .MADE |
.endif |
.endif |
|
.endif # defined(_PROGDEBUG.${_P}) |
|
.endif # MKUPDATE != no |
|
|
|
.endif # !target(proginstall-${_P}) # } |
|
|
|
lint: lint-${_P} |
|
lint-${_P}: ${LOBJS.${_P}} |
|
.if defined(LOBJS.${_P}) && !empty(LOBJS.${_P}) |
|
${LINT} ${LINTFLAGS} ${_LDFLAGS.${_P}:C/-L[ ]*/-L/Wg:M-L*} ${LOBJS.${_P}} ${_LDADD.${_P}} |
|
.endif |
|
|
|
.endfor # _P in ${PROGS} ${PROGS_CXX} # } |
|
|
|
.if defined(OBJS) && !empty(OBJS) && \ |
|
(empty(PROGS) && empty(PROGS_CXX)) |
|
CLEANFILES+= ${OBJS} ${LOBJS} |
.endif |
.endif |
|
|
.if !target(proginstall) |
.if !target(proginstall) |
proginstall:: |
proginstall:: ${_PROG_INSTALL} |
.endif |
.endif |
.PHONY: proginstall |
.PHONY: proginstall |
|
|
.if defined(SCRIPTS) && !target(scriptsinstall) |
|
|
|
|
realall: ${SCRIPTS} |
|
.if defined(SCRIPTS) && !target(scriptsinstall) # { |
SCRIPTSDIR?=${BINDIR} |
SCRIPTSDIR?=${BINDIR} |
SCRIPTSOWN?=${BINOWN} |
SCRIPTSOWN?=${BINOWN} |
SCRIPTSGRP?=${BINGRP} |
SCRIPTSGRP?=${BINGRP} |
Line 289 ${DESTDIR}${SCRIPTSDIR_${S}:U${SCRIPTSDI |
|
Line 621 ${DESTDIR}${SCRIPTSDIR_${S}:U${SCRIPTSDI |
|
.endif |
.endif |
.endif |
.endif |
.endfor |
.endfor |
.endif |
.endif # } |
|
|
.if !target(scriptsinstall) |
.if !target(scriptsinstall) |
scriptsinstall:: |
scriptsinstall:: |
.endif |
.endif |
.PHONY: scriptsinstall |
.PHONY: scriptsinstall |
|
|
lint: ${LOBJS} |
|
.if defined(LOBJS) && !empty(LOBJS) |
|
${LINT} ${LINTFLAGS} ${LDFLAGS:C/-L[ ]*/-L/Wg:M-L*} ${LOBJS} ${LDADD} |
|
.endif |
|
|
|
##### Pull in related .mk logic |
##### Pull in related .mk logic |
|
LINKSOWN?= ${BINOWN} |
|
LINKSGRP?= ${BINGRP} |
|
LINKSMODE?= ${BINMODE} |
.include <bsd.man.mk> |
.include <bsd.man.mk> |
.include <bsd.nls.mk> |
.include <bsd.nls.mk> |
.include <bsd.files.mk> |
.include <bsd.files.mk> |
|
|
.include <bsd.links.mk> |
.include <bsd.links.mk> |
.include <bsd.sys.mk> |
.include <bsd.sys.mk> |
.include <bsd.dep.mk> |
.include <bsd.dep.mk> |
|
.include <bsd.clang-analyze.mk> |
|
.include <bsd.clean.mk> |
|
|
${TARGETS}: # ensure existence |
${TARGETS}: # ensure existence |
|
|