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

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