[BACK]Return to bsd.prog.mk CVS log [TXT][DIR] Up to [cvs.NetBSD.org] / src / share / mk

Annotation of src/share/mk/bsd.prog.mk, Revision 1.267

1.267   ! apb         1: #      $NetBSD: bsd.prog.mk,v 1.266 2011/08/27 18:35:20 joerg Exp $
1.67      mikel       2: #      @(#)bsd.prog.mk 8.2 (Berkeley) 4/2/94
1.1       cgd         3:
1.166     lukem       4: .ifndef HOSTPROG
                      5:
1.138     tv          6: .include <bsd.init.mk>
1.159     thorpej     7: .include <bsd.shlib.mk>
1.167     thorpej     8: .include <bsd.gcc.mk>
1.74      mycroft     9:
1.223     jmmv       10: #
                     11: # Definitions and targets shared among all programs built by a single
                     12: # Makefile.
                     13: #
                     14:
                     15: ##### Basic targets
                     16: realinstall:   proginstall scriptsinstall
                     17:
                     18: .gdbinit:
                     19:        rm -f .gdbinit
                     20: .if defined(DESTDIR) && !empty(DESTDIR)
                     21:        echo "set solib-absolute-prefix ${DESTDIR}" > .gdbinit
                     22: .else
                     23:        touch .gdbinit
1.185     erh        24: .endif
1.223     jmmv       25: .for __gdbinit in ${GDBINIT}
                     26:        echo "source ${__gdbinit}" >> .gdbinit
                     27: .endfor
1.185     erh        28:
1.267   ! apb        29: CLEANFILES+= a.out [Ee]rrs mklog core *.core .gdbinit
1.223     jmmv       30:
                     31: .if defined(SHAREDSTRINGS)
                     32: CLEANFILES+=strings
                     33: .c.o:
                     34:        ${CC} -E ${CPPFLAGS} ${CFLAGS} ${.IMPSRC} | xstr -c -
                     35:        @${CC} ${CPPFLAGS} ${CFLAGS} -c x.c -o ${.TARGET}
                     36:        @rm -f x.c
1.1       cgd        37:
1.223     jmmv       38: .cc.o .cpp.o .cxx.o .C.o:
                     39:        ${CXX} -E ${CPPFLAGS} ${CXXFLAGS} ${.IMPSRC} | xstr -c -
                     40:        @mv -f x.c x.cc
                     41:        @${CXX} ${CPPFLAGS} ${CXXFLAGS} -c x.cc -o ${.TARGET}
                     42:        @rm -f x.cc
                     43: .endif
1.185     erh        44:
1.237     christos   45: .if defined(MKPIE) && (${MKPIE} != "no")
1.238     christos   46: CFLAGS+=       ${PIE_CFLAGS}
1.239     christos   47: AFLAGS+=       ${PIE_AFLAGS}
1.238     christos   48: LDFLAGS+=      ${PIE_LDFLAGS}
1.237     christos   49: .endif
                     50:
1.25      mycroft    51: CFLAGS+=       ${COPTS}
1.212     mrg        52: OBJCFLAGS+=    ${OBJCOPTS}
1.193     dsl        53: MKDEP_SUFFIXES?=       .o .ln
1.1       cgd        54:
1.247     darran     55: # CTF preserve debug symbols
                     56: .if defined(MKDTRACE) && (${MKDTRACE} != "no") && (${CFLAGS:M-g} != "")
                     57: CTFFLAGS+= -g
                     58: CTFMFLAGS+= -g
                     59: .endif
                     60:
1.162     thorpej    61: # ELF platforms depend on crti.o, crtbegin.o, crtend.o, and crtn.o
1.153     pk         62: .ifndef LIBCRTBEGIN
1.167     thorpej    63: LIBCRTBEGIN=   ${DESTDIR}/usr/lib/crti.o ${_GCC_CRTBEGIN}
1.152     christos   64: .MADE: ${LIBCRTBEGIN}
1.153     pk         65: .endif
                     66: .ifndef LIBCRTEND
1.167     thorpej    67: LIBCRTEND=     ${_GCC_CRTEND} ${DESTDIR}/usr/lib/crtn.o
1.152     christos   68: .MADE: ${LIBCRTEND}
1.153     pk         69: .endif
1.144     lukem      70: _SHLINKER=     ${SHLINKDIR}/ld.elf_so
1.69      thorpej    71:
1.153     pk         72: .ifndef LIBCRT0
                     73: LIBCRT0=       ${DESTDIR}/usr/lib/crt0.o
1.152     christos   74: .MADE: ${LIBCRT0}
1.153     pk         75: .endif
1.95      ross       76:
1.202     lukem      77: ##### Installed system library definitions
                     78: #
                     79: #      E.g.
                     80: #              LIBC?=${DESTDIR}/usr/lib/libc.a
1.234     mrg        81: #              LIBX11?=${DESTDIR}/usr/X11R7/lib/libX11.a
1.202     lukem      82: #      etc..
                     83:
                     84: .for _lib in \
1.221     joerg      85:        archive asn1 bluetooth bsdmalloc bz2 c c_pic cdk com_err compat \
                     86:        crypt crypto crypto_idea crypto_mdc2 crypto_rc5 \
1.203     lukem      87:        curses dbm des edit event \
1.265     he         88:        fetch form fl g2c gcc gnumalloc gssapi hdb heimbase heimntlm hx509 \
                     89:        intl ipsec \
1.250     mbalmer    90:        kadm5clnt kadm5srv kafs krb5 kvm l lber ldap ldap_r lua \
1.203     lukem      91:        m magic menu objc ossaudio pam pcap pci pmc posix pthread pthread_dbg \
1.259     christos   92:        puffs radius resolv rmt roken rpcsvc rt rump rumpuser saslc skey sl ss \
1.230     pooka      93:        ssh ssl termcap usbhid util wrap y z bind9 dns lwres isccfg isccc isc \
                     94:        \
                     95:        rumpfs_cd9660fs rumpfs_efs rumpfs_ext2fs rumpfs_ffs rumpfs_hfs \
                     96:        rumpfs_lfs rumpfs_msdosfs rumpfs_nfs rumpfs_ntfs rumpfs_syspuffs \
1.265     he         97:        rumpfs_tmpfs rumpfs_udf rumpfs_ufs \
                     98:        wind
1.202     lukem      99: .ifndef LIB${_lib:tu}
                    100: LIB${_lib:tu}= ${DESTDIR}/usr/lib/lib${_lib}.a
                    101: .MADE:         ${LIB${_lib:tu}}        # Note: ${DESTDIR} will be expanded
                    102: .endif
                    103: .endfor
1.260     jmmv      104: # atf-c and atf-c++ are special cases because we cannot use [-+] as part of
                    105: # make(1) variable names.  Just define them here.
                    106: LIBATF_C=      ${DESTDIR}/usr/lib/libatf-c.a
                    107: LIBATF_CXX=    ${DESTDIR}/usr/lib/libatf-c++.a
                    108: .MADE:         ${LIBATF_C} ${LIBATF_CXX}
1.202     lukem     109:
1.206     he        110: # PAM applications, if linked statically, need more libraries
                    111: .if (${MKPIC} == "no")
1.208     christos  112: .if (${MKCRYPTO} != "no")
                    113: PAM_STATIC_LDADD+= -lssh
                    114: PAM_STATIC_DPADD+= ${LIBSSH}
                    115: .endif
                    116: .if (${MKKERBEROS} != "no")
1.265     he        117: PAM_STATIC_LDADD+= -lkafs -lkrb5 -lhx509 -lwind -lasn1 \
                    118:        -lroken -lcom_err -lheimbase -lcrypto
                    119: PAM_STATIC_DPADD+= ${LIBKAFS} ${LIBKRB5} ${LIBHX509} ${LIBWIND} ${LIBASN1} \
                    120:        ${LIBROKEN} ${LIBCOM_ERR} ${LIBHEIMBASE} ${LIBCRYPTO}
1.208     christos  121: .endif
                    122: .if (${MKSKEY} != "no")
                    123: PAM_STATIC_LDADD+= -lskey
                    124: PAM_STATIC_DPADD+= ${LIBSKEY}
                    125: .endif
                    126: PAM_STATIC_LDADD+= -lradius -lcrypt -lrpcsvc -lutil
                    127: PAM_STATIC_DPADD+= ${LIBRADIUS} ${LIBCRYPT} ${LIBRPCSVC} ${LIBUTIL}
1.206     he        128: .else
                    129: PAM_STATIC_LDADD=
                    130: PAM_STATIC_DPADD=
                    131: .endif
                    132:
1.216     mrg       133: # These need + -> X transformations
1.202     lukem     134: .ifndef LIBSTDCXX
                    135: LIBSTDCXX=     ${DESTDIR}/usr/lib/libstdc++.a
                    136: .MADE:         ${LIBSTDCXX}
                    137: .endif
                    138:
1.216     mrg       139: .ifndef LIBSUPCXX
                    140: LIBSUPCXX=     ${DESTDIR}/usr/lib/libsupc++.a
                    141: .MADE:         ${LIBSUPCXX}
                    142: .endif
                    143:
1.202     lukem     144: .for _lib in \
                    145:        dps expat fntstubs fontcache fontconfig fontenc freetype FS \
                    146:        GL GLU ICE lbxutil SM X11 Xau Xaw Xdmcp Xext Xfont Xft \
                    147:        Xi Xinerama xkbfile Xmu Xmuu Xpm Xrandr Xrender Xss Xt \
                    148:        XTrap Xtst Xv Xxf86dga Xxf86misc Xxf86vm
                    149: .ifndef LIB${_lib:tu}
1.233     rtr       150: LIB${_lib:tu}= ${DESTDIR}${X11USRLIBDIR}/lib${_lib}.a
1.202     lukem     151: .MADE:         ${LIB${_lib:tu}}        # Note: ${DESTDIR} will be expanded
                    152: .endif
                    153: .endfor
                    154:
1.204     lukem     155: .if defined(RESCUEDIR)
                    156: CPPFLAGS+=     -DRESCUEDIR=\"${RESCUEDIR}\"
                    157: .endif
                    158:
1.144     lukem     159: _PROGLDOPTS=
                    160: .if ${SHLINKDIR} != "/usr/libexec"     # XXX: change or remove if ld.so moves
                    161: _PROGLDOPTS+=  -Wl,-dynamic-linker=${_SHLINKER}
1.161     itohy     162: .endif
1.187     lukem     163: .if ${SHLIBDIR} != "/usr/lib"
1.264     joerg     164: _PROGLDOPTS+=  -Wl,-rpath,${SHLIBDIR} \
1.263     joerg     165:                -L=${SHLIBDIR}
1.187     lukem     166: .elif ${SHLIBINSTALLDIR} != "/usr/lib"
1.264     joerg     167: _PROGLDOPTS+=  -Wl,-rpath-link,${DESTDIR}${SHLIBINSTALLDIR} \
1.263     joerg     168:                -L=${SHLIBINSTALLDIR}
1.144     lukem     169: .endif
                    170:
1.223     jmmv      171: __proginstall: .USE
                    172:        ${_MKTARGET_INSTALL}
                    173:        ${INSTALL_FILE} -o ${BINOWN} -g ${BINGRP} -m ${BINMODE} \
                    174:                ${STRIPFLAG} ${.ALLSRC} ${.TARGET}
                    175:
1.255     pooka     176: __progrumpinstall: .USE
                    177:        ${_MKTARGET_INSTALL}
                    178:        ${INSTALL_FILE} -o ${RUMPBINOWN} -g ${RUMPBINGRP} -m ${RUMPBINMODE} \
                    179:                ${STRIPFLAG} ${.ALLSRC} ${.TARGET}
                    180:
1.223     jmmv      181: __progdebuginstall: .USE
                    182:        ${_MKTARGET_INSTALL}
                    183:        ${INSTALL_FILE} -o ${DEBUGOWN} -g ${DEBUGGRP} -m ${DEBUGMODE} \
                    184:                ${.ALLSRC} ${.TARGET}
                    185:
                    186:
                    187:
                    188: #
                    189: # Backwards compatibility with Makefiles that assume that bsd.prog.mk
                    190: # can only build a single binary.
                    191: #
                    192:
                    193: _APPEND_MANS=yes
                    194: _APPEND_SRCS=yes
                    195:
1.231     lukem     196: _CCLINKFLAGS=
                    197:
1.145     thorpej   198: .if defined(PROG_CXX)
1.223     jmmv      199: PROG=          ${PROG_CXX}
1.231     lukem     200: _CCLINK=       ${CXX} ${_CCLINKFLAGS}
1.223     jmmv      201: .endif
                    202:
1.255     pooka     203: .if defined(RUMPPRG)
                    204: PROG=                  ${RUMPPRG}
1.256     pooka     205: .ifndef CRUNCHEDPROG
1.255     pooka     206: PROGS=                 ${RUMPPRG} rump.${RUMPPRG}
                    207: . if defined(SRCS)
                    208: SRCS.rump.${PROG}:=    ${SRCS} ${PROG}_rumpops.c ${RUMPSRCS}
                    209: SRCS+=                 ${PROG}_hostops.c
                    210: . else
                    211: SRCS=                  ${PROG}.c ${PROG}_hostops.c
                    212: SRCS.rump.${PROG}=     ${PROG}.c ${PROG}_rumpops.c ${RUMPSRCS}
                    213: . endif
1.257     pooka     214: DPSRCS+=               ${PROG}_rumpops.c ${RUMPSRCS}
1.255     pooka     215: LDADD.rump.${PROG}+=   -lrumpclient
                    216: DPADD.rump.${PROG}+=   ${LIBRUMPCLIENT}
                    217: MAN.rump.${PROG}=      # defined but feeling empty
                    218: _RUMPINSTALL.rump.${PROG}=# defined
1.256     pooka     219: .else # CRUNCHEDPROG
                    220: PROGS=                 ${PROG}
                    221: CPPFLAGS+=             -DCRUNCHOPS
                    222: .endif
1.255     pooka     223: .endif
                    224:
1.223     jmmv      225: .if defined(PROG)
1.231     lukem     226: _CCLINK?=      ${CC} ${_CCLINKFLAGS}
1.223     jmmv      227: .  if defined(MAN)
                    228: MAN.${PROG}=   ${MAN}
                    229: _APPEND_MANS=  no
                    230: .  endif
                    231: .  if !defined(OBJS)
                    232: OBJS=          ${OBJS.${PROG}}
                    233: .  endif
                    234: .  if defined(PROGNAME)
                    235: PROGNAME.${PROG}=      ${PROGNAME}
                    236: .  endif
                    237: .  if defined(SRCS)
                    238: SRCS.${PROG}=  ${SRCS}
                    239: _APPEND_SRCS=  no
                    240: .  endif
                    241: .endif
                    242:
                    243: # Turn the single-program PROG and PROG_CXX variables into their multi-word
                    244: # counterparts, PROGS and PROGS_CXX.
1.255     pooka     245: .if !defined(RUMPPRG)
                    246: .  if defined(PROG_CXX) && !defined(PROGS_CXX)
1.223     jmmv      247: PROGS_CXX=     ${PROG_CXX}
1.262     jmmv      248: .  elif defined(PROG) && !defined(PROGS)
1.223     jmmv      249: PROGS=         ${PROG}
1.255     pooka     250: .  endif
1.223     jmmv      251: .endif
                    252:
                    253: #
                    254: # Per-program definitions and targets.
                    255: #
                    256:
                    257: # Definitions specific to C programs.
                    258: .for _P in ${PROGS}
                    259: SRCS.${_P}?=   ${_P}.c
1.231     lukem     260: _CCLINK.${_P}= ${CC} ${_CCLINKFLAGS}
1.223     jmmv      261: .endfor
                    262:
                    263: # Definitions specific to C++ programs.
                    264: .for _P in ${PROGS_CXX}
                    265: SRCS.${_P}?=   ${_P}.cc
1.231     lukem     266: _CCLINK.${_P}= ${CXX} ${_CCLINKFLAGS}
1.223     jmmv      267: .endfor
                    268:
                    269: # Language-independent definitions.
                    270: .for _P in ${PROGS} ${PROGS_CXX}                                       # {
                    271:
                    272: BINDIR.${_P}?=         ${BINDIR}
                    273: PROGNAME.${_P}?=       ${_P}
                    274:
1.249     mrg       275: .if ${MKDEBUG} != "no" && !commands(${_P})
1.223     jmmv      276: _PROGDEBUG.${_P}:=     ${PROGNAME.${_P}}.debug
1.145     thorpej   277: .endif
                    278:
1.223     jmmv      279: .if defined(PAXCTL_FLAGS)
                    280: PAXCTL_FLAGS.${_P}?= ${PAXCTL_FLAGS}
1.215     lukem     281: .endif
                    282:
1.223     jmmv      283: ##### PROG specific flags.
1.244     uebayasi  284:
1.223     jmmv      285: _LDADD.${_P}=          ${LDADD}    ${LDADD.${_P}}
                    286: _LDFLAGS.${_P}=                ${LDFLAGS}  ${LDFLAGS.${_P}}
                    287: _LDSTATIC.${_P}=       ${LDSTATIC} ${LDSTATIC.${_P}}
                    288:
                    289: ##### Build and install rules
                    290: .if !empty(_APPEND_SRCS:M[Yy][Ee][Ss])
                    291: SRCS+=         ${SRCS.${_P}} # For bsd.dep.mk
                    292: .endif
                    293:
                    294: _YPSRCS.${_P}= ${SRCS.${_P}:M*.[ly]:C/\..$/.c/} ${YHEADER:D${SRCS.${_P}:M*.y:.y=.h}}
                    295:
                    296: DPSRCS+=               ${_YPSRCS.${_P}}
                    297: CLEANFILES+=           ${_YPSRCS.${_P}}
                    298:
                    299: .if !empty(SRCS.${_P}:N*.h:N*.sh:N*.fth)
                    300: OBJS.${_P}+=   ${SRCS.${_P}:N*.h:N*.sh:N*.fth:R:S/$/.o/g}
                    301: LOBJS.${_P}+=  ${LSRCS:.c=.ln} ${SRCS.${_P}:M*.c:.c=.ln}
1.157     thorpej   302: .endif
                    303:
1.223     jmmv      304: .if defined(OBJS.${_P}) && !empty(OBJS.${_P})                  # {
                    305: .NOPATH: ${OBJS.${_P}} ${_P} ${_YPSRCS.${_P}}
                    306:
                    307: ${OBJS.${_P}} ${LOBJS.${_P}}: ${DPSRCS}
1.182     lukem     308:
1.223     jmmv      309: ${_P}: .gdbinit ${LIBCRT0} ${OBJS.${_P}} ${LIBC} ${LIBCRTBEGIN} ${LIBCRTEND} ${DPADD}
                    310: .if !commands(${_P})
1.194     lukem     311:        ${_MKTARGET_LINK}
1.231     lukem     312:        ${_CCLINK.${_P}} \
1.232     lukem     313:            ${_LDFLAGS.${_P}} ${_LDSTATIC.${_P}} -o ${.TARGET} \
                    314:            ${OBJS.${_P}} ${_LDADD.${_P}} \
                    315:            ${_PROGLDOPTS}
1.247     darran    316: .if defined(CTFMERGE)
                    317:        ${CTFMERGE} ${CTFMFLAGS} -o ${.TARGET} ${OBJS.${_P}}
                    318: .endif
1.223     jmmv      319: .if defined(PAXCTL_FLAGS.${_P})
                    320:        ${PAXCTL} ${PAXCTL_FLAGS.${_P}} ${.TARGET}
1.218     christos  321: .endif
1.235     joerg     322: .if ${MKSTRIPIDENT} != "no"
                    323:        ${OBJCOPY} -R .ident ${.TARGET}
                    324: .endif
1.223     jmmv      325: .endif # !commands(${_P})
1.183     dsl       326:
1.223     jmmv      327: ${_P}.ro: ${OBJS.${_P}} ${DPADD}
1.207     dsl       328:        ${_MKTARGET_LINK}
1.254     joerg     329:        ${CC} ${LDFLAGS} -nostdlib -r -Wl,-dc -o ${.TARGET} ${OBJS.${_P}}
1.1       cgd       330:
1.223     jmmv      331: .if defined(_PROGDEBUG.${_P})
1.224     jmmv      332: ${_PROGDEBUG.${_P}}: ${_P}
1.215     lukem     333:        ${_MKTARGET_CREATE}
1.251     lukem     334:        (  ${OBJCOPY} --only-keep-debug ${_P} ${_PROGDEBUG.${_P}} \
                    335:        && ${OBJCOPY} --strip-debug -p -R .gnu_debuglink \
                    336:                --add-gnu-debuglink=${_PROGDEBUG.${_P}} ${_P} \
                    337:        ) || (rm -f ${_PROGDEBUG.${_P}}; false)
1.215     lukem     338: .endif
                    339:
1.223     jmmv      340: .endif # defined(OBJS.${_P}) && !empty(OBJS.${_P})                     # }
1.1       cgd       341:
1.223     jmmv      342: .if !defined(MAN.${_P})
                    343: MAN.${_P}=     ${_P}.1
                    344: .endif # !defined(MAN.${_P})
                    345: .if !empty(_APPEND_MANS:M[Yy][Ee][Ss])
                    346: MAN+=          ${MAN.${_P}}
                    347: .endif
1.11      mycroft   348:
1.223     jmmv      349: realall: ${_P} ${_PROGDEBUG.${_P}}
1.1       cgd       350:
1.267   ! apb       351: CLEANFILES+= ${_P} ${_PROGDEBUG.${_P}}
1.134     tls       352:
1.223     jmmv      353: .if defined(OBJS.${_P}) && !empty(OBJS.${_P})
1.267   ! apb       354: CLEANFILES+= ${OBJS.${_P}} ${LOBJS.${_P}}
1.59      cgd       355: .endif
1.27      mycroft   356:
1.223     jmmv      357: _PROG_INSTALL+=        proginstall-${_P}
1.114     mycroft   358:
1.223     jmmv      359: .if !target(proginstall-${_P})                                         # {
                    360: proginstall-${_P}::    ${DESTDIR}${BINDIR.${_P}}/${PROGNAME.${_P}} \
                    361:                ${_PROGDEBUG.${_P}:D${DESTDIR}${DEBUGDIR}${BINDIR.${_P}}/${_PROGDEBUG.${_P}}}
                    362: .PRECIOUS:     ${DESTDIR}${BINDIR.${_P}}/${PROGNAME.${_P}} \
                    363:                ${_PROGDEBUG.${_P}:D${DESTDIR}${DEBUGDIR}${BINDIR.${_P}}/${_PROGDEBUG.${_P}}}
1.215     lukem     364:
1.172     lukem     365: .if ${MKUPDATE} == "no"
1.255     pooka     366: .if defined(_RUMPINSTALL.${_P})
                    367: ${DESTDIR}${BINDIR.${_P}}/${PROGNAME.${_P}}! ${_P} __progrumpinstall
                    368: .else
1.223     jmmv      369: ${DESTDIR}${BINDIR.${_P}}/${PROGNAME.${_P}}! ${_P} __proginstall
1.255     pooka     370: .endif
1.223     jmmv      371: .if !defined(BUILD) && !make(all) && !make(${_P})
                    372: ${DESTDIR}${BINDIR.${_P}}/${PROGNAME.${_P}}! .MADE
                    373: .endif
                    374: .if defined(_PROGDEBUG.${_P})
                    375: ${DESTDIR}${DEBUGDIR}${BINDIR.${_P}}/${_PROGDEBUG.${_P}}! ${_PROGDEBUG.${_P}} __progdebuginstall
                    376: .if !defined(BUILD) && !make(all) && !make(${_P})
                    377: ${DESTDIR}${DEBUGDIR}${BINDIR.${_P}}/${_PROGDEBUG.${_P}}! .MADE
1.215     lukem     378: .endif
1.223     jmmv      379: .endif #  define(_PROGDEBUG.${_P})
1.215     lukem     380: .else  # MKUPDATE != no
1.255     pooka     381: .if defined(_RUMPINSTALL.${_P})
                    382: ${DESTDIR}${BINDIR.${_P}}/${PROGNAME.${_P}}: ${_P} __progrumpinstall
                    383: .else
1.223     jmmv      384: ${DESTDIR}${BINDIR.${_P}}/${PROGNAME.${_P}}: ${_P} __proginstall
1.255     pooka     385: .endif
1.223     jmmv      386: .if !defined(BUILD) && !make(all) && !make(${_P})
                    387: ${DESTDIR}${BINDIR.${_P}}/${PROGNAME.${_P}}: .MADE
                    388: .endif
                    389: .if defined(_PROGDEBUG.${_P})
                    390: ${DESTDIR}${DEBUGDIR}${BINDIR.${_P}}/${_PROGDEBUG.${_P}}: ${_PROGDEBUG.${_P}} __progdebuginstall
                    391: .if !defined(BUILD) && !make(all) && !make(${_P})
                    392: ${DESTDIR}${DEBUGDIR}${BINDIR.${_P}}/${_PROGDEBUG.${_P}}: .MADE
1.154     mycroft   393: .endif
1.223     jmmv      394: .endif #  defined(_PROGDEBUG.${_P})
1.215     lukem     395: .endif # MKUPDATE != no
                    396:
1.223     jmmv      397: .endif # !target(proginstall-${_P})                                    # }
                    398:
                    399: lint: lint-${_P}
                    400: lint-${_P}: ${LOBJS.${_P}}
                    401: .if defined(LOBJS.${_P}) && !empty(LOBJS.${_P})
                    402:        ${LINT} ${LINTFLAGS} ${_LDFLAGS.${_P}:C/-L[  ]*/-L/Wg:M-L*} ${LOBJS.${_P}} ${_LDADD.${_P}}
                    403: .endif
                    404:
                    405: .endfor # _P in ${PROGS} ${PROGS_CXX}                                  # }
1.23      mycroft   406:
1.225     jmmv      407: .if defined(OBJS) && !empty(OBJS) && \
                    408:     (empty(PROGS) && empty(PROGS_CXX))
1.267   ! apb       409: CLEANFILES+= ${OBJS} ${LOBJS}
1.225     jmmv      410: .endif
                    411:
1.74      mycroft   412: .if !target(proginstall)
1.223     jmmv      413: proginstall:: ${_PROG_INSTALL}
1.74      mycroft   414: .endif
1.197     lukem     415: .PHONY:                proginstall
1.74      mycroft   416:
1.223     jmmv      417:
                    418:
                    419: realall: ${SCRIPTS}
1.215     lukem     420: .if defined(SCRIPTS) && !target(scriptsinstall)                                # {
1.65      mycroft   421: SCRIPTSDIR?=${BINDIR}
                    422: SCRIPTSOWN?=${BINOWN}
                    423: SCRIPTSGRP?=${BINGRP}
                    424: SCRIPTSMODE?=${BINMODE}
1.113     mycroft   425:
                    426: scriptsinstall:: ${SCRIPTS:@S@${DESTDIR}${SCRIPTSDIR_${S}:U${SCRIPTSDIR}}/${SCRIPTSNAME_${S}:U${SCRIPTSNAME:U${S:T:R}}}@}
1.114     mycroft   427: .PRECIOUS: ${SCRIPTS:@S@${DESTDIR}${SCRIPTSDIR_${S}:U${SCRIPTSDIR}}/${SCRIPTSNAME_${S}:U${SCRIPTSNAME:U${S:T:R}}}@}
1.113     mycroft   428:
1.115     mycroft   429: __scriptinstall: .USE
1.192     lukem     430:        ${_MKTARGET_INSTALL}
1.139     tv        431:        ${INSTALL_FILE} \
1.116     mycroft   432:            -o ${SCRIPTSOWN_${.ALLSRC:T}:U${SCRIPTSOWN}} \
                    433:            -g ${SCRIPTSGRP_${.ALLSRC:T}:U${SCRIPTSGRP}} \
                    434:            -m ${SCRIPTSMODE_${.ALLSRC:T}:U${SCRIPTSMODE}} \
1.209     jwise     435:            ${.ALLSRC} ${.TARGET}
1.115     mycroft   436:
1.130     sommerfe  437: .for S in ${SCRIPTS:O:u}
1.172     lukem     438: .if ${MKUPDATE} == "no"
1.154     mycroft   439: ${DESTDIR}${SCRIPTSDIR_${S}:U${SCRIPTSDIR}}/${SCRIPTSNAME_${S}:U${SCRIPTSNAME:U${S:T:R}}}! ${S} __scriptinstall
                    440: .if !defined(BUILD) && !make(all) && !make(${S})
                    441: ${DESTDIR}${SCRIPTSDIR_${S}:U${SCRIPTSDIR}}/${SCRIPTSNAME_${S}:U${SCRIPTSNAME:U${S:T:R}}}! .MADE
                    442: .endif
                    443: .else
                    444: ${DESTDIR}${SCRIPTSDIR_${S}:U${SCRIPTSDIR}}/${SCRIPTSNAME_${S}:U${SCRIPTSNAME:U${S:T:R}}}: ${S} __scriptinstall
1.103     fredb     445: .if !defined(BUILD) && !make(all) && !make(${S})
1.113     mycroft   446: ${DESTDIR}${SCRIPTSDIR_${S}:U${SCRIPTSDIR}}/${SCRIPTSNAME_${S}:U${SCRIPTSNAME:U${S:T:R}}}: .MADE
1.63      christos  447: .endif
1.154     mycroft   448: .endif
1.63      christos  449: .endfor
1.215     lukem     450: .endif                                                                 # }
1.1       cgd       451:
1.74      mycroft   452: .if !target(scriptsinstall)
                    453: scriptsinstall::
1.1       cgd       454: .endif
1.197     lukem     455: .PHONY:                scriptsinstall
1.1       cgd       456:
1.138     tv        457: ##### Pull in related .mk logic
1.241     apb       458: LINKSOWN?= ${BINOWN}
                    459: LINKSGRP?= ${BINGRP}
                    460: LINKSMODE?= ${BINMODE}
1.1       cgd       461: .include <bsd.man.mk>
1.50      jtc       462: .include <bsd.nls.mk>
1.66      christos  463: .include <bsd.files.mk>
1.63      christos  464: .include <bsd.inc.mk>
1.83      mycroft   465: .include <bsd.links.mk>
1.180     lukem     466: .include <bsd.sys.mk>
1.26      mycroft   467: .include <bsd.dep.mk>
1.266     joerg     468: .include <bsd.clang-analyze.mk>
1.267   ! apb       469: .include <bsd.clean.mk>
1.240     cube      470:
1.138     tv        471: ${TARGETS}:    # ensure existence
1.166     lukem     472:
                    473: .endif # HOSTPROG

CVSweb <webmaster@jp.NetBSD.org>