Annotation of src/share/mk/bsd.port.mk, revision 1.31

1.1       dillon      1: # $FreeBSD: src/share/mk/bsd.port.mk,v 1.303.2.2 2002/07/17 19:08:23 ru Exp $
1.27      joerg       2: # $DragonFly$
1.1       dillon      3: 
                      4: PORTSDIR?=     /usr/ports
1.4       dillon      5: DFPORTSDIR?=   /usr/dfports
1.3       dillon      6: PORTPATH!=     /usr/bin/relpath ${PORTSDIR} ${.CURDIR}
1.1       dillon      7: 
1.17      joerg       8: .if !defined(DFOSVERSION)
                      9: DFOSVERSION!=  /sbin/sysctl -n kern.osreldate
                     10: .endif
                     11: 
1.7       dillon     12: # Temporary Hack
                     13: #
                     14: OSVERSION ?= 480102
                     15: UNAME_s?= FreeBSD
                     16: UNAME_v?=FreeBSD 4.8-CURRENT
                     17: UNAME_r?=4.8-CURRENT
                     18: 
1.27      joerg      19: # override for bsd.port.mk
1.28      joerg      20: PERL_VERSION?= 5.8.6
                     21: PERL_VER?=     5.8.6
1.27      joerg      22: 
1.7       dillon     23: .makeenv UNAME_s
                     24: .makeenv UNAME_v
                     25: .makeenv UNAME_r
                     26: .makeenv OSVERSION
                     27: 
1.29      joerg      28: # handle both native and override ports
                     29: .undef USE_GETOPT_LONG
1.9       joerg      30: 
1.30      joerg      31: .if defined(USE_RCORDER)
                     32: _DF_USE_RCORDER:=      ${USE_RCORDER}
                     33: .endif
1.13      joerg      34: .if defined(USE_RC_SUBR)
1.30      joerg      35: _DF_USE_RC_SUBR:=      ${USE_RC_SUBR}
                     36: .endif
                     37: 
                     38: .if !target(install-rc-script)
                     39: install-rc-script:
                     40: .if defined(USE_RCORDER) || defined(USE_RC_SUBR) && ${USE_RC_SUBR:U} != "YES"
                     41: .if defined(USE_RCORDER)
                     42:        @${ECHO_CMD} "===> Installing early rcNG startup script(s)"
                     43:        @${ECHO_CMD} "@cwd /" >> ${TMPPLIST}
                     44:        @for i in ${_DF_USE_RCORDER}; do \
                     45:                ${INSTALL_SCRIPT} ${WRKDIR}/$${i} /etc/rc.d/$${i%.sh}; \
                     46:                ${ECHO_CMD} "etc/rc.d/$${i%.sh}" >> ${TMPPLIST}; \
                     47:        done
                     48:        @${ECHO_CMD} "@cwd ${PREFIX}" >> ${TMPPLIST}
                     49: .endif
                     50: .if defined(USE_RC_SUBR) && ${USE_RC_SUBR:U} != "YES"
                     51:        @${ECHO_CMD} "===> Installing rcNG startup script(s)"
                     52:        @${ECHO_CMD} "@cwd ${PREFIX}" >> ${TMPPLIST}
                     53:        @for i in ${_DF_USE_RC_SUBR}; do \
                     54:                ${INSTALL_SCRIPT} ${WRKDIR}/$${i} ${PREFIX}/etc/rc.d/$${i%.sh}.sh; \
                     55:                ${ECHO_CMD} "etc/rc.d/$${i%.sh}.sh" >> ${TMPPLIST}; \
                     56:        done
                     57: .endif
                     58: .else
                     59:        @${DO_NADA}
                     60: .endif
                     61: .endif
                     62: 
                     63: .if defined(USE_RC_SUBR) || defined(USE_RCORDER)
1.13      joerg      64: RC_SUBR=       /etc/rc.subr
1.30      joerg      65: SUB_LIST+=     RC_SUBR=${RC_SUBR}
                     66: .if defined(USE_RC_SUBR) && ${USE_RC_SUBR:U} != "YES"
                     67: SUB_FILES+=    ${_DF_USE_RC_SUBR}
                     68: .endif
                     69: .if defined(USE_RCORDER)
                     70: SUB_FILES+=    ${_DF_USE_RCORDER}
1.13      joerg      71: .endif
1.30      joerg      72: .endif
                     73: 
                     74: .undef USE_RC_SUBR
                     75: .undef USE_RCORDER
1.13      joerg      76: 
1.29      joerg      77: .if !exists(${DFPORTSDIR}/${PORTPATH}/Makefile)
                     78: 
1.20      joerg      79: .if defined(USE_GCC)
                     80: .  if ${USE_GCC} == 3.4
                     81: .undef USE_GCC
                     82: CCVER= gcc34
                     83: .makeenv CCVER
                     84: .  endif
                     85: .endif
                     86: 
1.5       dillon     87: # If the port does not exist in /usr/dfports/<portpath> use the original
                     88: # FreeBSD port.  Also process as per normal if BEFOREPORTMK is set so
                     89: # any expected variables are set.
1.3       dillon     90: #
1.1       dillon     91: .include <bsd.own.mk>
                     92: .include "${PORTSDIR}/Mk/bsd.port.mk"
1.3       dillon     93: 
                     94: .else
                     95: 
1.23      joerg      96: .if !defined(BEFOREPORTMK)
                     97: .undef PORTSDIR
                     98: .endif
                     99: 
1.5       dillon    100: .undef BEFOREPORTMK
                    101: .undef AFTERPORTMK
                    102: 
1.3       dillon    103: # Otherwise retarget to the DragonFly override port.
                    104: #
                    105: 
                    106: TARGETS+=      all
                    107: TARGETS+=      build
                    108: TARGETS+=      checksum
                    109: TARGETS+=      clean
                    110: TARGETS+=      clean-for-cdrom
                    111: TARGETS+=      clean-for-cdrom-list
                    112: TARGETS+=      clean-restricted
                    113: TARGETS+=      clean-restricted-list
                    114: TARGETS+=      configure
                    115: TARGETS+=      deinstall
                    116: TARGETS+=      depend
                    117: TARGETS+=      depends
                    118: TARGETS+=      describe
                    119: TARGETS+=      distclean
                    120: TARGETS+=      extract
                    121: TARGETS+=      fetch
                    122: TARGETS+=      fetch-list
                    123: TARGETS+=      ignorelist
                    124: TARGETS+=      makesum
                    125: TARGETS+=      maintainer
                    126: TARGETS+=      package
                    127: TARGETS+=      realinstall
                    128: TARGETS+=      reinstall
                    129: TARGETS+=      install
                    130: TARGETS+=      tags
                    131: 
1.24      dillon    132: # WARNING!  Do not use the -B option.  This appears to propogate to the
                    133: # gmake (probably because both use the same environment variable, MAKEFLAGS,
                    134: # to pass make options) where as of version 3.80 -B means 'always-make',
                    135: # which forces all targets, which blows up gnu builds in the ports system
                    136: # because it appears to cause the configure.status target to loop.
                    137: #
1.23      joerg     138: .if !defined(_DFPORTS_REDIRECT)
                    139: _DFPORTS_REDIRECT=
1.14      cpressey  140: .if !make(package-depends-list) && !make(all-depends-list) && \
1.19      joerg     141:     !make(run-depends-list) && !make(build-depends-list) && \
1.25      joerg     142:     !make(describe) && !make(package-name)
1.5       dillon    143: .BEGIN:
1.4       dillon    144:        @echo "WARNING, USING DRAGONFLY OVERRIDE ${DFPORTSDIR}/${PORTPATH}"
1.24      dillon    145:        cd ${DFPORTSDIR}/${PORTPATH} && ${MAKE} ${.TARGETS}
1.23      joerg     146: .else
                    147: .BEGIN:
1.24      dillon    148:        @cd ${DFPORTSDIR}/${PORTPATH} && ${MAKE} ${.TARGETS} 
1.23      joerg     149: .endif
1.9       joerg     150: .endif
1.3       dillon    151: 
1.12      joerg     152: .if !empty(.TARGETS)
1.8       joerg     153: ${.TARGETS}:
1.12      joerg     154: .else
                    155: all:
                    156: .MAIN: all
                    157: .endif
1.8       joerg     158: 
1.11      joerg     159: # Hack to get Makefiles with conditional statements working
                    160: XFREE86_VERSION?=      4
                    161: ARCH?=                 i386
                    162: MACHINE_ARCH?=         i386
                    163: HAVE_GNOME?=
1.16      joerg     164: FILESDIR?=             ${.CURDIR}/files
1.18      dillon    165: X_WINDOW_SYSTEM?=      xfree86-4
1.19      joerg     166: CAT?=                  cat
                    167: PREFIX?=               /usr
                    168: PERL_LEVEL?=           5
1.23      joerg     169: LOCALBASE?=            /usr/local
                    170: SED?=                  /usr/bin/sed
                    171: ECHO_CMD?=             echo
                    172: GREP?=                 /usr/bin/grep
                    173: AWK?=                  /usr/bin/awk
                    174: UNAME?=                        /usr/bin/uname
                    175: EXPR?=                 /bin/expr
                    176: HAVE_SDL?=
1.11      joerg     177: 
1.25      joerg     178: PKG_SUFX?=             .tgz
                    179: PKGNAME!=              cd ${DFPORTSDIR}/${PORTPATH}; ${MAKE} -V PKGNAME
1.26      joerg     180: .for _CATEGORY in ${CATEGORIES}
                    181: PKGCATEGORY?=   ${_CATEGORY}
                    182: .endfor
                    183: _PORTDIRNAME=   ${.CURDIR:T}
                    184: PORTDIRNAME?=   ${_PORTDIRNAME}
                    185: PKGORIGIN?=             ${PKGCATEGORY}/${PORTDIRNAME}
1.31    ! joerg     186: PLIST_SUB!=            cd ${DFPORTSDIR}/${PORTPATH}; ${MAKE} -V PLIST_SUB
1.26      joerg     187: 
1.25      joerg     188: PKGREPOSITORYSUBDIR?=   All
                    189: PKGREPOSITORY?=         ${PACKAGES}/${PKGREPOSITORYSUBDIR}
                    190: .if exists(${PACKAGES})
                    191: PKGFILE?=               ${PKGREPOSITORY}/${PKGNAME}${PKG_SUFX}
                    192: .else
                    193: PKGFILE?=               ${.CURDIR}/${PKGNAME}${PKG_SUFX}
1.15      hmp       194: .endif
                    195:  
1.3       dillon    196: .endif
                    197: