[BACK]Return to bsd.port.mk CVS log [TXT][DIR] Up to [local] / src / share / mk

Annotation of src/share/mk/bsd.port.mk, Revision 1.92

1.9       imp         1: #-*- mode: Fundamental; tab-width: 4; -*-
                      2: # ex:ts=4
1.92    ! brad        3: #  $OpenBSD: bsd.port.mk,v 1.91 1999/05/14 04:38:36 brad Exp $
1.90      brad        4: #  $FreeBSD: bsd.port.mk,v 1.264 1996/12/25 02:27:44 imp Exp $
                      5: #  $NetBSD: bsd.port.mk,v 1.62 1998/04/09 12:47:02 hubertf Exp $
1.1       niklas      6: #
                      7: #  bsd.port.mk - 940820 Jordan K. Hubbard.
                      8: #  This file is in the public domain.
                      9: #
                     10: # Please view me with 4 column tabs!
                     11:
1.13      imp        12: # There are two different types of "maintainers" in the whole ports
                     13: # framework concept.  Maintainers of the bsd.port*.mk files
1.32      marc       14: # are listed below in the ${OPSYS}_MAINTAINER entries (this file
1.13      imp        15: # is used by multiple *BSD flavors).  You should consult them directly
                     16: # if you have any questions/suggestions regarding this file since only
                     17: # they are allowed to modify the master copies in the CVS repository!
                     18:
                     19: # For each port, the MAINTAINER variable is what you should consult for
                     20: # contact information on the person(s) to contact if you have questions/
                     21: # suggestions about that specific port.  By default (if no MAINTAINER
1.58      pattonme   22: # is listed), a port is maintained by the subscribers of the ports@openbsd.org
                     23: # mailing list, and any correspondence should be directed there.
1.9       imp        24: #
1.90      brad       25: OpenBSD_MAINTAINER= ports-admin@openbsd.org
1.55      espie      26:
                     27: # NEED_VERSION: we need at least this version of bsd.port.mk for this
                     28: # port  to build
                     29:
1.92    ! brad       30: FULL_REVISION=$$OpenBSD: bsd.port.mk,v 1.91 1999/05/14 04:38:36 brad Exp $$
1.55      espie      31: .if defined(NEED_VERSION)
1.67      espie      32: _VERSION_REVISION=${FULL_REVISION:M[0-9]*.*}
1.55      espie      33:
1.67      espie      34: _VERSION=${_VERSION_REVISION:C/\..*//}
                     35: _REVISION=${_VERSION_REVISION:C/.*\.//}
1.55      espie      36:
1.67      espie      37: _VERSION_NEEDED=${NEED_VERSION:C/\..*//}
                     38: _REVISION_NEEDED=${NEED_VERSION:C/.*\.//}
1.55      espie      39:
                     40: .BEGIN:
1.67      espie      41:    @if [ ${_VERSION_NEEDED} -gt ${_VERSION} -o \
                     42:            ${_VERSION_NEEDED} -eq ${_VERSION} -a \
                     43:                ${_REVISION_NEEDED} -gt ${_REVISION} ]; \
1.55      espie      44:    then \
                     45:        ${ECHO} "Need version ${NEED_VERSION} of bsd.port.mk"; \
                     46:        ${FALSE}; \
                     47:     fi;
                     48:
                     49: .endif
1.1       niklas     50:
                     51: # Supported Variables and their behaviors:
                     52: #
                     53: # Variables that typically apply to all ports:
                     54: #
1.44      marc       55: # ONLY_FOR_ARCHS - If a port only makes sense to certain architectures, this
1.10      niklas     56: #                is a list containing the names for them.  It is checked
1.44      marc       57: #                against the predefined ${MACHINE_ARCH} value
1.58      pattonme   58: # ARCH         - The architecture (default: "uname -m").
                     59: # OPSYS            - The operating system (default: "uname -s").
                     60: # OPSYS_VER        - The current version of the operating system
                     61: #                (default: "uname -r").
                     62: # PORTSDIR     - The root of the ports tree.  Defaults: /usr/ports
                     63: # DISTDIR      - Where to get gzip'd, tarballed copies of original sources.
1.9       imp        64: #                (default: ${PORTSDIR}/distfiles).
1.1       niklas     65: # PREFIX       - Where to install things in general (default: /usr/local).
                     66: # MASTER_SITES - Primary location(s) for distribution files if not found
1.9       imp        67: #                locally.
1.44      marc       68: # MASTER_SITE_SUBDIR - Directory that "%SUBDIR%" in MASTER_SITES is
                     69: #                replaced by.
1.1       niklas     70: # PATCH_SITES  - Primary location(s) for distribution patch files
1.9       imp        71: #                (see PATCHFILES below) if not found locally.
1.44      marc       72: # PATCH_SITE_SUBDIR - Directory that "%SUBDIR%" in PATCH_SITES is
                     73: #                replaced by.
1.1       niklas     74: #
1.9       imp        75: # MASTER_SITE_BACKUP - Backup location(s) for distribution files and patch
                     76: #                files if not found locally and ${MASTER_SITES}/${PATCH_SITES}
                     77: #                (default:
1.27      marc       78: #                ftp://ftp.openbsd.org/pub/OpenBSD/distfiles/${DIST_SUBDIR}/
1.34      marc       79: #                ftp://ftp.openbsd.org/pub/OpenBSD/licensed/${DIST_SUBDIR}/
1.9       imp        80: #                ftp://ftp.freebsd.org/pub/FreeBSD/distfiles/${DIST_SUBDIR}/)
1.1       niklas     81: # MASTER_SITE_OVERRIDE - If set, override the MASTER_SITES setting with this
                     82: #                value.
1.27      marc       83: # MASTER_SITE_OPENBSD - If set, only use ftp.openbsd.org as the
                     84: #                MASTER_SITE_OVERRIDE.
1.1       niklas     85: # PACKAGES     - A top level directory where all packages go (rather than
                     86: #                going locally to each port). (default: ${PORTSDIR}/packages).
1.52      espie      87: # GMAKE            - Set to path of GNU make if not in $PORTPATH (default: gmake).
                     88: # XMKMF            - Set to path of `xmkmf' if not in $PORTPATH
                     89: #                 (default: xmkmf -a ).
1.1       niklas     90: # MAINTAINER   - The e-mail address of the contact person for this port
1.58      pattonme   91: #                Defaults: ports@OpenBSD.ORG
1.9       imp        92: # CATEGORIES   - A list of descriptive categories into which this port falls.
1.14      niklas     93: # WRKOBJDIR        - A top level directory where, if defined, the separate working
                     94: #                directories will get created, and symbolically linked to from
                     95: #                ${WRKDIR} (see below).  This is useful for building ports on
                     96: #                several architectures, then ${PORTSDIR} can be NFS-mounted
1.62      marc       97: #                while ${WRKOBJDIR} is local to every arch
1.75      espie      98: # PREFERRED_CIPHERS
                     99: #              - a list of the form cipher.sig of programs to use to check
                    100: #                recorded checksums, in order of decreasing trust.
                    101: #                (default to using sha1, then rmd160, then md5).
1.1       niklas    102: #
                    103: # Variables that typically apply to an individual port.  Non-Boolean
                    104: # variables without defaults are *mandatory*.
                    105: #
                    106: # WRKDIR       - A temporary working directory that gets *clobbered* on clean
                    107: #                (default: ${.CURDIR}/work).
                    108: # WRKSRC       - A subdirectory of ${WRKDIR} where the distribution actually
                    109: #                unpacks to.  (Default: ${WRKDIR}/${DISTNAME} unless
                    110: #                NO_WRKSUBDIR is set, in which case simply ${WRKDIR}).
1.60      rohee     111: # WRKBUILD     - The directory where the port is actually built, useful for
                    112: #                 ports that need a separate directory (default: ${WRKSRC}).
                    113: #                This is intended for GNU configure.
1.71      espie     114: # SEPARATE_BUILD
                    115: #               - define if the port can build in directory separate from
                    116: #                 WRKSRC. This redefines WRKBUILD to be arch-dependent,
                    117: #                 along with the configure, build and install cookies
1.1       niklas    118: # DISTNAME     - Name of port or distribution.
                    119: # DISTFILES        - Name(s) of archive file(s) containing distribution
                    120: #                (default: ${DISTNAME}${EXTRACT_SUFX}).
1.85      espie     121: # SUPDISTFILES  - Names of supplementary archive files that don't get
                    122: #                used all the time (default: empty).
1.1       niklas    123: # PATCHFILES   - Name(s) of additional files that contain distribution
                    124: #                patches (default: none).  make will look for them at
                    125: #                PATCH_SITES (see above).  They will automatically be
                    126: #                uncompressed before patching if the names end with
                    127: #                ".gz" or ".Z".
1.85      espie     128: # SUPPATCHFILES  - Names of supplementary patch files that don't get
                    129: #                used all the time (default: empty).
1.9       imp       130: # DIST_SUBDIR  - Suffix to ${DISTDIR}.  If set, all ${DISTFILES}
1.1       niklas    131: #                and ${PATCHFILES} will be put in this subdirectory of
                    132: #                ${DISTDIR}.  Also they will be fetched in this subdirectory
                    133: #                from FreeBSD mirror sites.
1.9       imp       134: # ALLFILES     - All of ${DISTFILES} and ${PATCHFILES}.
1.58      pattonme  135: # MIRROR_DISTFILE - Whether the distfile is redistributable without restrictions.
                    136: #                Defaults to "yes", set this to "no" if restrictions exist.
1.9       imp       137: # IGNOREFILES  - If some of the ${ALLFILES} are not checksum-able, set
                    138: #                this variable to their names.
1.1       niklas    139: # PKGNAME      - Name of the package file to create if the DISTNAME
                    140: #                isn't really relevant for the port/package
                    141: #                (default: ${DISTNAME}).
                    142: # EXTRACT_ONLY - If defined, a subset of ${DISTFILES} you want to
                    143: #                actually extract.
                    144: # PATCHDIR         - A directory containing any additional patches you made
1.50      espie     145: #                to port this software to OpenBSD (default:
1.1       niklas    146: #                ${.CURDIR}/patches)
1.50      espie     147: # PATCH_LIST   - list of patches to apply, can include wildcards (default:
                    148: #                 patch-*)
1.1       niklas    149: # SCRIPTDIR    - A directory containing any auxiliary scripts
                    150: #                (default: ${.CURDIR}/scripts)
                    151: # FILESDIR         - A directory containing any miscellaneous additional files.
                    152: #                (default: ${.CURDIR}/files)
                    153: # PKGDIR       - A direction containing any package creation files.
                    154: #                (default: ${.CURDIR}/pkg)
                    155: # PKG_DBDIR        - Where package installation is recorded (default: /var/db/pkg)
                    156: # FORCE_PKG_REGISTER - If set, it will overwrite any existing package
                    157: #                registration information in ${PKG_DBDIR}/${PKGNAME}.
                    158: # NO_MTREE     - If set, will not invoke mtree from bsd.port.mk from
1.13      imp       159: #                the "install" target.
                    160: # MTREE_FILE   - The name of the mtree file (default: /etc/mtree/BSD.x11.dist
                    161: #                if USE_IMAKE or USE_X11 is set, /etc/mtree/BSD.local.dist
                    162: #                otherwise.)
1.26      marc      163: # COMES_WITH   - The first version that a port was made part of the
                    164: #                standard OpenBSD distribution.  If the current OpenBSD
                    165: #                version is >= this version then a notice will be
                    166: #                displayed instead the port being generated.
1.1       niklas    167: #
1.6       niklas    168: # NO_BUILD     - Use a dummy (do-nothing) build target.
                    169: # NO_CONFIGURE - Use a dummy (do-nothing) configure target.
1.9       imp       170: # NO_CDROM     - Port may not go on CDROM.  Set this string to reason.
1.6       niklas    171: # NO_DESCRIBE  - Use a dummy (do-nothing) describe target.
1.1       niklas    172: # NO_EXTRACT   - Use a dummy (do-nothing) extract target.
1.6       niklas    173: # NO_INSTALL   - Use a dummy (do-nothing) install target.
1.1       niklas    174: # NO_PACKAGE   - Use a dummy (do-nothing) package target.
1.6       niklas    175: # NO_PKG_REGISTER - Don't register a port install as a package.
1.1       niklas    176: # NO_WRKSUBDIR - Assume port unpacks directly into ${WRKDIR}.
                    177: # NO_WRKDIR        - There's no work directory at all; port does this someplace
                    178: #                else.
                    179: # NO_DEPENDS   - Don't verify build of dependencies.
1.44      marc      180: # NOCLEANDEPENDS - Don't nuke dependent dirs on make clean (Default: yes)
1.9       imp       181: # BROKEN       - Port is broken.  Set this string to the reason why.
1.1       niklas    182: # RESTRICTED   - Port is restricted.  Set this string to the reason why.
1.91      brad      183: # USE_BZIP2        - Port distfiles use bzip2 instead of gzip for compression.
                    184: # USE_ZIP      - Port distfiles use zip instead of tar for packaging.
                    185: # USE_GMAKE        - Port uses gmake.
                    186: # USE_LIBTOOL  - Port uses libtool.
1.52      espie     187: #
                    188: # XXX: cygnus products do NOT use autoconf for making its main
                    189: #      configure from configure.in
1.91      brad      190: # USE_AUTOCONF - Port uses autoconf (implies GNU_CONFIGURE).
1.52      espie     191: # AUTOCONF_DIR  - Where to apply autoconf (default: ${WRKSRC}).
1.91      brad      192: # USE_PERL5        - Port uses perl5 for building and running.
                    193: # USE_IMAKE        - Port uses imake.
                    194: # USE_X11      - Port uses X11 and installs in ${X11BASE}
                    195: # USE_EGCC     - Port needs the egcs C compiler
                    196: # USE_EGXX     - Port needs the egcs C++ compiler
1.1       niklas    197: # NO_INSTALL_MANPAGES - For imake ports that don't like the install.man
                    198: #                      target.
                    199: # HAS_CONFIGURE    - Says that the port has its own configure script.
                    200: # GNU_CONFIGURE    - Set if you are using GNU configure (optional).
                    201: # CONFIGURE_SCRIPT - Name of configure script, defaults to 'configure'.
                    202: # CONFIGURE_ARGS - Pass these args to configure if ${HAS_CONFIGURE} is set.
1.73      marc      203: # CONFIGURE_SHARED - An argument to GNU configure that expands to
                    204: #                --enable-shared for those architectures that support
                    205: #                shared libraries and --disable-shared for architectures
                    206: #                that do not support shared libraries.
1.89      rohee     207: # LIBTOOL_FLAGS    - Pass these flags in ${CONFIGURE} and ${MAKE} environment so
                    208: #                to be used as args by libtool.
1.13      imp       209: # CONFIGURE_ENV - Pass these env (shell-like) to configure if
1.1       niklas    210: #                ${HAS_CONFIGURE} is set.
1.13      imp       211: # SCRIPTS_ENV  - Additional environment vars passed to scripts in
                    212: #                 ${SCRIPTDIR} executed by bsd.port.mk.
                    213: # MAKE_ENV     - Additional environment vars passed to sub-make in build
                    214: #                stage.
1.1       niklas    215: # IS_INTERACTIVE - Set this if your port needs to interact with the user
                    216: #                during a build.  User can then decide to skip this port by
                    217: #                setting ${BATCH}, or compiling only the interactive ports
                    218: #                by setting ${INTERACTIVE}.
1.7       niklas    219: # FETCH_DEPENDS - A list of "path:dir" pairs of other ports this
                    220: #                package depends in the "fetch" stage.  "path" is the
                    221: #                name of a file if it starts with a slash (/), an
                    222: #                executable otherwise.  make will test for the
                    223: #                existence (if it is a full pathname) or search for
1.52      espie     224: #                it in $PORTPATH (if it is an executable) and go
1.7       niklas    225: #                into "dir" to do a "make all install" if it's not
                    226: #                found.
                    227: # BUILD_DEPENDS - A list of "path:dir" pairs of other ports this
                    228: #                package depends to build (between the "extract" and
                    229: #                "build" stages, inclusive).  The test done to
                    230: #                determine the existence of the dependency is the
                    231: #                same as FETCH_DEPENDS.
                    232: # RUN_DEPENDS  - A list of "path:dir" pairs of other ports this
                    233: #                package depends to run.  The test done to determine
                    234: #                the existence of the dependency is the same as
                    235: #                FETCH_DEPENDS.  This will be checked during the
                    236: #                "install" stage and the name of the dependency will
                    237: #                be put into the package as well.
1.1       niklas    238: # LIB_DEPENDS  - A list of "lib:dir" pairs of other ports this package
                    239: #                depends on.  "lib" is the name of a shared library.
                    240: #                make will use "ldconfig -r" to search for the
1.44      marc      241: #                library.  Note that lib can be any regular expression.
                    242: #                In older versions of this file, you need two backslashes
                    243: #                in front of dots (.) to supress its special meaning (e.g.,
                    244: #                use "foo\\.2\\.:${PORTSDIR}/utils/foo" to match "libfoo.2.*").
                    245: #                No special backslashes are needed to escape regular
                    246: #                expression metacharacters in OpenBSD, and the old backslash
                    247: #                escapes are recognised for backwards compatibility.
1.1       niklas    248: # DEPENDS      - A list of other ports this package depends on being
                    249: #                made first.  Use this for things that don't fall into
                    250: #                the above two categories.
1.91      brad      251: #
                    252: # EXTRACT_CMD  - Command for extracting archives (default: "gzip",
                    253: #                "bzip2" if USE_BZIP2, "unzip" if USE_ZIP).
                    254: # EXTRACT_SUFX - Suffix for archive files (default: ".tar.gz",
                    255: #                ".tar.bz2" if USE_BZIP2, ".zip" if USE_ZIP).
                    256: # EXTRACT_BEFORE_ARGS
                    257: #              - Arguments to ${EXTRACT_CMD} before filename
                    258: #                (default: "-dc" for gzip or bzip2, "-q" for unzip)
                    259: # EXTRACT_AFTER_ARGS
                    260: #              - Arguments to ${EXTRACT_CMD} following filename
                    261: #                (default: "| ${TAR} -xf -", or "-d ${WKRDIR}" if USE_ZIP).
1.1       niklas    262: #
1.52      espie     263: # FETCH_CMD          - Full path to ftp/http fetch command if not in $PORTPATH
1.44      marc      264: #                (default: /usr/bin/ftp).
1.6       niklas    265: # FETCH_BEFORE_ARGS -
                    266: #                Arguments to ${FETCH_CMD} before filename (default: none).
                    267: # FETCH_AFTER_ARGS -
                    268: #                Arguments to ${FETCH_CMD} following filename (default: none).
1.44      marc      269: # NO_IGNORE     - Set this to YES (most probably in a "make fetch" in
                    270: #                 ${PORTSDIR}) if you want to fetch all distfiles,
                    271: #                 even for packages not built due to limitation by
                    272: #                 absent X or Motif or ONLY_FOR_ARCHS...
1.54      marc      273: # NO_WARNINGS  - Set this to YES to disable warnings regarding variables
                    274: #                to define to control the build.  Automatically set
                    275: #                from the "mirror-distfiles" target.
1.44      marc      276: # ALL_TARGET   - The target to pass to make in the package when building.
                    277: #                (default: "all")
                    278: # INSTALL_TARGET- The target to pass to make in the package when installing.
                    279: #                (default: "install")
1.1       niklas    280: #
                    281: # Motif support:
                    282: #
1.56      form      283: # USE_MOTIF        - Set this in your port if it requires Motif or Lesstif.
                    284: #                It will be built using Lesstif port unless Motif libraries
                    285: #                found or HAVE_MOTIF is defined. See also REQUIRES_MOTIF.
1.49      form      286: #
1.56      form      287: # REQUIRES_MOTIF- Set this in your port if it requires Motif.  It will  be
1.1       niklas    288: #                built only if HAVE_MOTIF is set.
1.58      pattonme  289: # HAVE_MOTIF   - If set, means system has Motif.  Typically set in /etc/mk.conf.
1.1       niklas    290: # MOTIF_STATIC - If set, link libXm statically; otherwise, link it
1.58      pattonme  291: #                dynamically.  Typically set in /etc/mk.conf.
1.6       niklas    292: # MOTIFLIB     - Set automatically to appropriate value depending on
                    293: #                ${MOTIF_STATIC}.  Substitute references to -lXm with
                    294: #                patches to make your port conform to our standards.
1.13      imp       295: # MOTIF_ONLY   - If set, build Motif ports only.  (Not much use except for
                    296: #                building packages.)
1.1       niklas    297: #
                    298: # Variables to change if you want a special behavior:
                    299: #
                    300: # ECHO_MSG     - Used to print all the '===>' style prompts - override this
                    301: #                to turn them off (default: /bin/echo).
1.13      imp       302: # DEPENDS_TARGET - The target to execute when a port is calling a
                    303: #                dependency (default: "install").
1.6       niklas    304: # PATCH_DEBUG  - If set, print out more information about the patches as
                    305: #                it attempts to apply them.
                    306: #
1.9       imp       307: # Variables that serve as convenient "aliases" for your *-install targets.
                    308: # Use these like: "${INSTALL_PROGRAM} ${WRKSRC}/prog ${PREFIX}/bin".
1.6       niklas    309: #
1.44      marc      310: # INSTALL_PROGRAM      - A command to install binary executables.
                    311: # INSTALL_SCRIPT       - A command to install executable scripts.
                    312: # INSTALL_DATA         - A command to install sharable data.
                    313: # INSTALL_MAN          - A command to install manpages (doesn't compress).
                    314: # INSTALL_PROGRAM_DIR  - Create a directory for storing programs
                    315: # INSTALL_SCRIPT_DIR   - Create a directory for storing scripts (alias for
                    316: #                        (INSTALL_PROGRAM_DIR)
                    317: # INSTALL_DATA_DIR     - Create a directory for storing arbitrary data
                    318: # INSTALL_MAN_DIR      - Create a directory for storing man pages
                    319: #
                    320: # It is assumed that the port installs manpages uncompressed. If this is
                    321: # not the case, set MANCOMPRESSED in the port and define MAN<sect> and
                    322: # CAT<sect> for the compressed pages.  The pages will then be automagically
                    323: # uncompressed.
1.9       imp       324: #
1.44      marc      325: # MANCOMPRESSED - Indicates that the port installs manpages in a compressed
                    326: #                 form (default: port installs manpages uncompressed).
1.9       imp       327: # MAN<sect>        - A list of manpages, categorized by section.  For
                    328: #                example, if your port has "man/man1/foo.1" and
                    329: #                "man/mann/bar.n", set "MAN1=foo.1" and "MANN=bar.n".
                    330: #                The available sections chars are "123456789LN".
1.44      marc      331: # CAT<sect>     - The same as MAN<sect>, only for formatted manpages.
                    332: # MANPREFIX         -The directory prefix for ${MAN<sect>} (default: ${PREFIX}).
                    333: # CATPREFIX     - The directory prefix for ${CAT<sect>} (default: ${PREFIX}).
1.9       imp       334: #
1.73      marc      335: # Other variables:
                    336: #
                    337: # NO_SHARED_LIBS - defined as "yes" for those machine architectures that do
                    338: #                not support shared libraries.  WARNING: This value is
                    339: #                NOT defined until AFTER ".include bsd.port.mk".  Thus
                    340: #                you can NOT use something like ".if defined(NO_SHARED_LIBS)"
                    341: #                before this file is included.
                    342: #
1.1       niklas    343: # Default targets and their behaviors:
                    344: #
                    345: # fetch            - Retrieves ${DISTFILES} (and ${PATCHFILES} if defined)
                    346: #                into ${DISTDIR} as necessary.
                    347: # fetch-list   - Show list of files that would be retrieved by fetch
                    348: # extract      - Unpacks ${DISTFILES} into ${WRKDIR}.
                    349: # patch            - Apply any provided patches to the source.
                    350: # configure        - Runs either GNU configure, one or more local configure
                    351: #                scripts or nothing, depending on what's available.
                    352: # build            - Actually compile the sources.
                    353: # install      - Install the results of a build.
                    354: # reinstall        - Install the results of a build, ignoring "already installed"
                    355: #                flag.
1.44      marc      356: # deinstall        - Remove the installation.  Alias: uninstall
1.32      marc      357: # plist            - create a file suitable for use as a packing list.  This
                    358: #                is for port maintainers.
1.1       niklas    359: # package      - Create a package from an _installed_ port.
                    360: # describe     - Try to generate a one-line description for each port for
                    361: #                use in INDEX files and the like.
                    362: # checkpatch   - Do a "patch -C" instead of a "patch".  Note that it may
                    363: #                give incorrect results if multiple patches deal with
1.52      espie     364: #                the same file.
1.75      espie     365: # checksum     - Use ${CHECKSUM_FILE} to ensure that your distfiles are valid.
                    366: # makesum      - Generate ${CHECKSUM_FILE} (only do this for your own ports!).
                    367: # addsum       - update ${CHECKSUM_FILE} in a non-destructive way
                    368: #                (your own ports only!)
1.44      marc      369: # readme       - Create a README.html file describing the category or package
                    370: # mirror-distfiles - Mirror the distfile(s) if they are freely redistributable
                    371: #                Setting MIRROR_DISTFILE to "no" in the package Makefile
                    372: #                will override the default "yes", and the distfile will
                    373: #                not be fetched.
1.82      marc      374: # list-distfiles- list the distribution and patch files used by a port.
                    375: #                Typical use is (from the top level of the ports tree)
                    376: #                make ECHO_MSG=: list-distfiles | tee some-file
                    377: # obj          - pre-build ${WRKDIR} -> ${WRKOBJDIR}/${PORTSUBDIR} links
1.88      espie     378: # print-depends - print all dependencies for the given package
1.1       niklas    379: #
                    380: # Default sequence for "all" is:  fetch checksum extract patch configure build
                    381: #
                    382: # Please read the comments in the targets section below, you
                    383: # should be able to use the pre-* or post-* targets/scripts
                    384: # (which are available for every stage except checksum) or
                    385: # override the do-* targets to do pretty much anything you want.
                    386: #
                    387: # NEVER override the "regular" targets unless you want to open
                    388: # a major can of worms.
                    389:
1.44      marc      390: # Get the architecture
                    391: ARCH!= uname -m
                    392:
1.32      marc      393: # Get the operating system type and version
1.27      marc      394: OPSYS!=    uname -s
1.32      marc      395: OPSYS_VER!=    uname -r
1.27      marc      396:
1.1       niklas    397: .if exists(${.CURDIR}/../Makefile.inc)
                    398: .include "${.CURDIR}/../Makefile.inc"
                    399: .endif
                    400:
1.62      marc      401: # Define SUPPORT_SHARES for those machines that support shared libraries.
                    402: #
                    403: .if (${MACHINE_ARCH} == "alpha") || (${MACHINE_ARCH} == "powerpc") || \
                    404:     (${MACHINE_ARCH} == "vax") || (${MACHINE_ARCH} == "hppa")
                    405: NO_SHARED_LIBS=    yes
                    406: .endif
                    407:
1.44      marc      408: NOCLEANDEPENDS=    yes
1.10      niklas    409: NOMANCOMPRESS?=    yes
1.14      niklas    410: DEF_UMASK?=        022
1.6       niklas    411:
1.13      imp       412: .if exists(${.CURDIR}/Makefile.${ARCH}-${OPSYS})
                    413: .include "${.CURDIR}/Makefile.${ARCH}-${OPSYS}"
                    414: .elif exists(${.CURDIR}/Makefile.${OPSYS})
                    415: .include "${.CURDIR}/Makefile.${OPSYS}"
                    416: .elif exists(${.CURDIR}/Makefile.${ARCH})
                    417: .include "${.CURDIR}/Makefile.${ARCH}"
                    418: .endif
                    419:
1.1       niklas    420: # These need to be absolute since we don't know how deep in the ports
                    421: # tree we are and thus can't go relative.  They can, of course, be overridden
1.9       imp       422: # by individual Makefiles or local system make configuration.
1.13      imp       423: PORTSDIR?=     /usr/ports
1.44      marc      424: LOCALBASE?=        ${DESTDIR}/usr/local
1.13      imp       425: X11BASE?=      ${DESTDIR}/usr/X11R6
1.9       imp       426: DISTDIR?=      ${PORTSDIR}/distfiles
                    427: _DISTDIR?=     ${DISTDIR}/${DIST_SUBDIR}
1.1       niklas    428: PACKAGES?=     ${PORTSDIR}/packages
                    429: TEMPLATES?=        ${PORTSDIR}/templates
1.14      niklas    430:
1.13      imp       431: .if exists(${.CURDIR}/patches.${ARCH}-${OPSYS})
                    432: PATCHDIR?=     ${.CURDIR}/patches.${ARCH}-${OPSYS}
                    433: .elif exists(${.CURDIR}/patches.${OPSYS})
                    434: PATCHDIR?=     ${.CURDIR}/patches.${OPSYS}
                    435: .elif exists(${.CURDIR}/patches.${ARCH})
                    436: PATCHDIR?=     ${.CURDIR}/patches.${ARCH}
                    437: .else
1.1       niklas    438: PATCHDIR?=     ${.CURDIR}/patches
1.13      imp       439: .endif
                    440:
1.50      espie     441: PATCH_LIST?=    patch-*
                    442:
1.13      imp       443: .if exists(${.CURDIR}/scripts.${ARCH}-${OPSYS})
                    444: SCRIPTDIR?=        ${.CURDIR}/scripts.${ARCH}-${OPSYS}
                    445: .elif exists(${.CURDIR}/scripts.${OPSYS})
                    446: SCRIPTDIR?=        ${.CURDIR}/scripts.${OPSYS}
                    447: .elif exists(${.CURDIR}/scripts.${ARCH})
                    448: SCRIPTDIR?=        ${.CURDIR}/scripts.${ARCH}
                    449: .else
1.1       niklas    450: SCRIPTDIR?=        ${.CURDIR}/scripts
1.13      imp       451: .endif
                    452:
                    453: .if exists(${.CURDIR}/files.${ARCH}-${OPSYS})
                    454: FILESDIR?=     ${.CURDIR}/files.${ARCH}-${OPSYS}
                    455: .elif exists(${.CURDIR}/files.${OPSYS})
                    456: FILESDIR?=     ${.CURDIR}/files.${OPSYS}
                    457: .elif exists(${.CURDIR}/files.${ARCH})
                    458: FILESDIR?=     ${.CURDIR}/files.${ARCH}
                    459: .else
1.1       niklas    460: FILESDIR?=     ${.CURDIR}/files
1.13      imp       461: .endif
                    462:
                    463: .if exists(${.CURDIR}/pkg.${ARCH}-${OPSYS})
                    464: PKGDIR?=       ${.CURDIR}/pkg.${ARCH}-${OPSYS}
                    465: .elif exists(${.CURDIR}/pkg.${OPSYS})
                    466: PKGDIR?=       ${.CURDIR}/pkg.${OPSYS}
                    467: .elif exists(${.CURDIR}/pkg.${ARCH})
                    468: PKGDIR?=       ${.CURDIR}/pkg.${ARCH}
                    469: .else
1.1       niklas    470: PKGDIR?=       ${.CURDIR}/pkg
1.13      imp       471: .endif
                    472:
1.1       niklas    473: .if defined(USE_IMAKE) || defined(USE_X11)
                    474: PREFIX?=       ${X11BASE}
                    475: .else
                    476: PREFIX?=       ${LOCALBASE}
                    477: .endif
1.79      espie     478:
                    479: # where configuration files should go
                    480: SYSCONFDIR?=   /etc
1.1       niklas    481: # The following 4 lines should go away as soon as the ports are all updated
                    482: .if defined(EXEC_DEPENDS)
                    483: BUILD_DEPENDS+=    ${EXEC_DEPENDS}
                    484: RUN_DEPENDS+=  ${EXEC_DEPENDS}
                    485: .endif
                    486: .if defined(USE_GMAKE)
1.44      marc      487: BUILD_DEPENDS+=        ${GMAKE}:${PORTSDIR}/devel/gmake
                    488: MAKE_PROGRAM=      ${GMAKE}
                    489: .else
                    490: MAKE_PROGRAM=      ${MAKE}
1.13      imp       491: .endif
1.52      espie     492: .if defined(USE_AUTOCONF)
                    493: GNU_CONFIGURE= yes
                    494: BUILD_DEPENDS+=        ${AUTOCONF}:${PORTSDIR}/devel/autoconf
                    495: AUTOCONF_DIR?=${WRKSRC}
                    496: # missing ?= not an oversight
                    497: AUTOCONF_ENV=PATH=${PORTPATH}
1.89      rohee     498: .endif
                    499: .if defined(USE_LIBTOOL)
                    500: LIBTOOL?=          ${LOCALBASE}/bin/libtool
                    501: BUILD_DEPENDS+=        ${LIBTOOL}:${PORTSDIR}/devel/libtool
                    502: CONFIGURE_ENV+=        LIBTOOL="${LIBTOOL} ${LIBTOOL_FLAGS}"
                    503: MAKE_ENV+=         LIBTOOL="${LIBTOOL} ${LIBTOOL_FLAGS}"
1.52      espie     504: .endif
1.47      espie     505: .if defined(USE_EGCC)
1.84      marc      506: BUILD_DEPENDS+=    ${EGCC}:${PORTSDIR}/lang/egcs-stable
1.47      espie     507: CC=${EGCC}
                    508: .endif
                    509: .if defined(USE_EGXX)
1.84      marc      510: BUILD_DEPENDS+=    ${EGXX}:${PORTSDIR}/lang/egcs-stable
1.47      espie     511: CXX=${EGXX}
                    512: .endif
1.49      form      513: .if defined(USE_MOTIF) && !defined(HAVE_MOTIF) && !defined(REQUIRES_MOTIF)
                    514: LIB_DEPENDS+=      Xm.:${PORTSDIR}/x11/lesstif
                    515: .endif
1.44      marc      516:
1.1       niklas    517: .if exists(${PORTSDIR}/../Makefile.inc)
                    518: .include "${PORTSDIR}/../Makefile.inc"
                    519: .endif
                    520:
                    521: EXTRACT_COOKIE?=   ${WRKDIR}/.extract_done
1.71      espie     522: PATCH_COOKIE?=     ${WRKDIR}/.patch_done
                    523: .if defined(SEPARATE_BUILD)
                    524: CONFIGURE_COOKIE?= ${WRKBUILD}/.configure_done
                    525: INSTALL_PRE_COOKIE?=${WRKBUILD}/.install_started
                    526: INSTALL_COOKIE?=   ${WRKBUILD}/.install_done
                    527: BUILD_COOKIE?=     ${WRKBUILD}/.build_done
                    528: PACKAGE_COOKIE?=   ${WRKBUILD}/.package_done
                    529: .else
1.1       niklas    530: CONFIGURE_COOKIE?= ${WRKDIR}/.configure_done
1.32      marc      531: INSTALL_PRE_COOKIE?=${WRKDIR}/.install_started
1.1       niklas    532: INSTALL_COOKIE?=   ${WRKDIR}/.install_done
                    533: BUILD_COOKIE?=     ${WRKDIR}/.build_done
                    534: PACKAGE_COOKIE?=   ${WRKDIR}/.package_done
1.71      espie     535: .endif
1.1       niklas    536:
                    537: # Miscellaneous overridable commands:
                    538: GMAKE?=            gmake
1.52      espie     539: AUTOCONF?=     autoconf
1.47      espie     540: EGCC?=         egcc
                    541: EGXX?=         eg++
1.1       niklas    542: XMKMF?=            xmkmf -a
1.52      espie     543:
1.75      espie     544: # be paranoid about which ciphers we trust
1.13      imp       545: .if exists(/sbin/md5)
                    546: MD5?=          /sbin/md5
1.9       imp       547: .elif exists(/bin/md5)
1.4       deraadt   548: MD5?=          /bin/md5
1.13      imp       549: .elif exists(/usr/bin/md5)
                    550: MD5?=          /usr/bin/md5
1.9       imp       551: .else
1.13      imp       552: MD5?=          md5
1.9       imp       553: .endif
1.75      espie     554:
                    555: .if exists(/sbin/sha1)
                    556: SHA1?=         /sbin/sha1
                    557: .elif exists(/bin/sha1)
                    558: SHA1?=         /bin/sha1
                    559: .elif exists(/usr/bin/sha1)
                    560: SHA1?=         /usr/bin/sha1
                    561: .else
                    562: SHA1?=         sha1
                    563: .endif
                    564:
                    565: .if exists(/sbin/rmd160)
                    566: RMD160?=       /sbin/rmd160
                    567: .elif exists(/bin/rmd160)
                    568: RMD160?=       /bin/rmd160
                    569: .elif exists(/usr/bin/rmd160)
                    570: RMD160?=       /usr/bin/rmd160
                    571: .else
                    572: RMD160?=       rmd160
                    573: .endif
                    574:
                    575: # Compatibility game
1.1       niklas    576: MD5_FILE?=     ${FILESDIR}/md5
1.75      espie     577: CHECKSUM_FILE?=    ${MD5_FILE}
                    578:
                    579: # Don't touch !!! Used for generating checksums.
                    580: CIPHERS=       ${SHA1}.SHA1 ${RMD160}.RMD160 ${MD5}.MD5
                    581:
                    582: # This is the one you can override
                    583: PREFERRED_CIPHERS?= ${CIPHERS}
1.1       niklas    584:
1.52      espie     585: PORTPATH?= /usr/bin:/bin:/usr/sbin:/sbin:${LOCALBASE}/bin:${X11BASE}/bin
1.77      marc      586:
                    587: # Add any COPTS to CFLAGS.  Note: programs that use imake do not
                    588: # use CFLAGS!  Also, many (most?) ports hard code CFLAGS, ignoring
                    589: # what we pass in.
                    590: CFLAGS+=       ${COPTS}
1.52      espie     591:
1.1       niklas    592: MAKE_FLAGS?=   -f
                    593: MAKEFILE?=     Makefile
1.52      espie     594: MAKE_ENV+=     PATH=${PORTPATH} PREFIX=${PREFIX} LOCALBASE=${LOCALBASE} X11BASE=${X11BASE} MOTIFLIB="${MOTIFLIB}" CFLAGS="${CFLAGS}"
1.1       niklas    595:
1.13      imp       596: .if exists(/usr/bin/fetch)
                    597: FETCH_CMD?=        /usr/bin/fetch
                    598: .else
1.6       niklas    599: FETCH_CMD?=        /usr/bin/ftp
1.9       imp       600: .endif
1.1       niklas    601:
1.44      marc      602: # By default, distfiles have no restrictions placed on them
                    603: MIRROR_DISTFILE?=  yes
                    604:
1.1       niklas    605: TOUCH?=            /usr/bin/touch
                    606: TOUCH_FLAGS?=  -f
                    607:
                    608: PATCH?=            /usr/bin/patch
                    609: PATCH_STRIP?=  -p0
                    610: PATCH_DIST_STRIP?= -p0
                    611: .if defined(PATCH_DEBUG)
1.6       niklas    612: PATCH_DEBUG_TMP=   yes
1.1       niklas    613: PATCH_ARGS?=   -d ${WRKSRC} -E ${PATCH_STRIP}
                    614: PATCH_DIST_ARGS?=  -d ${WRKSRC} -E ${PATCH_DIST_STRIP}
                    615: .else
1.6       niklas    616: PATCH_DEBUG_TMP=   no
1.3       niklas    617: PATCH_ARGS?=   -d ${WRKSRC} --forward --quiet -E ${PATCH_STRIP}
                    618: PATCH_DIST_ARGS?=  -d ${WRKSRC} --forward --quiet -E ${PATCH_DIST_STRIP}
1.1       niklas    619: .endif
                    620: .if defined(BATCH)
                    621: PATCH_ARGS+=       --batch
                    622: PATCH_DIST_ARGS+=  --batch
                    623: .endif
                    624:
                    625: .if defined(PATCH_CHECK_ONLY)
                    626: PATCH_ARGS+=   -C
                    627: PATCH_DIST_ARGS+=  -C
                    628: .endif
                    629:
1.9       imp       630: .if exists(/bin/tar)
1.91      brad      631: TAR?=  /bin/tar
1.9       imp       632: .else
1.91      brad      633: TAR?=  /usr/bin/tar
1.9       imp       634: .endif
1.91      brad      635: UNZIP?=    unzip
                    636: BZIP2?=    bzip2
                    637:
                    638: .if defined(USE_ZIP)
                    639: BUILD_DEPENDS+=        ${UNZIP}:${PORTSDIR}/archivers/unzip
                    640: EXTRACT_CMD?=      ${UNZIP}
                    641: EXTRACT_SUFX?=     .zip
                    642: EXTRACT_BEFORE_ARGS?=  -q
                    643: EXTRACT_AFTER_ARGS?=   -d ${WRKDIR}
                    644: .else
                    645: # common tar case
                    646:
                    647: # Backwards compatibility.
1.1       niklas    648: .if defined(EXTRACT_ARGS)
1.91      brad      649: EXTRACT_AFTER_ARGS?=   | ${TAR} ${EXTRACT_ARGS} -
1.1       niklas    650: .else
1.91      brad      651: EXTRACT_AFTER_ARGS?=   | ${TAR} -xf -
                    652: .endif
                    653: EXTRACT_BEFORE_ARGS?=  -dc
                    654:
                    655: .if defined(USE_BZIP2)
                    656: BUILD_DEPENDS+=        ${BZIP2}:${PORTSDIR}/archivers/bzip2
                    657: EXTRACT_CMD?=      ${BZIP2}
                    658: EXTRACT_SUFX?=     .tar.bz2
                    659: .else
                    660: EXTRACT_CMD?=      ${GZIP_CMD}
                    661: EXTRACT_SUFX?=     .tar.gz
                    662: .endif
                    663:
1.1       niklas    664: .endif
                    665:
                    666: # Figure out where the local mtree file is
1.13      imp       667: .if !defined(MTREE_FILE)
                    668: .if defined(USE_IMAKE) || defined(USE_X11)
                    669: MTREE_FILE=    /etc/mtree/BSD.x11.dist
                    670: .else
                    671: MTREE_FILE=    /etc/mtree/BSD.local.dist
                    672: .endif
1.1       niklas    673: .endif
                    674: MTREE_CMD?=    /usr/sbin/mtree
1.43      marc      675: MTREE_ARGS?=   -U -f ${MTREE_FILE} -d -e -q -p
1.1       niklas    676:
1.10      niklas    677: .include <bsd.own.mk>
                    678: MAKE_ENV+= EXTRA_SYS_MK_INCLUDES="<bsd.own.mk>"
1.44      marc      679:
                    680: .if !defined(NO_WRKDIR)
                    681: .if defined(OBJMACHINE)
                    682: WRKDIR?=       ${.CURDIR}/work.${MACHINE_ARCH}
                    683: .else
                    684: WRKDIR?=       ${.CURDIR}/work
                    685: .endif
                    686: .else
                    687: WRKDIR?=       ${.CURDIR}
                    688: .endif
                    689: .if defined(NO_WRKSUBDIR)
                    690: WRKSRC?=       ${WRKDIR}
                    691: .else
                    692: WRKSRC?=       ${WRKDIR}/${DISTNAME}
                    693: .endif
                    694:
1.71      espie     695: .if defined(SEPARATE_BUILD)
                    696: WRKBUILD?=     ${WRKDIR}/build-${ARCH}
                    697: .else
1.60      rohee     698: WRKBUILD?=     ${WRKSRC}
1.71      espie     699: .endif
1.60      rohee     700:
1.44      marc      701: .if defined(WRKOBJDIR)
                    702: __canonical_PORTSDIR!= cd ${PORTSDIR}; pwd -P
                    703: __canonical_CURDIR!=   cd ${.CURDIR}; pwd -P
                    704: PORTSUBDIR=        ${__canonical_CURDIR:S,${__canonical_PORTSDIR}/,,}
1.10      niklas    705: .endif
                    706:
1.6       niklas    707: # A few aliases for *-install targets
                    708: INSTALL_PROGRAM= \
1.12      millert   709:    ${INSTALL} ${INSTALL_COPY} ${INSTALL_STRIP} -o ${BINOWN} -g ${BINGRP} -m ${BINMODE}
1.6       niklas    710: INSTALL_SCRIPT= \
1.12      millert   711:    ${INSTALL} ${INSTALL_COPY} -o ${BINOWN} -g ${BINGRP} -m ${BINMODE}
1.6       niklas    712: INSTALL_DATA= \
1.12      millert   713:    ${INSTALL} ${INSTALL_COPY} -o ${SHAREOWN} -g ${SHAREGRP} -m ${SHAREMODE}
1.6       niklas    714: INSTALL_MAN= \
1.12      millert   715:    ${INSTALL} ${INSTALL_COPY} -o ${MANOWN} -g ${MANGRP} -m ${MANMODE}
1.44      marc      716: INSTALL_PROGRAM_DIR= \
                    717:    ${INSTALL} -d -o ${BINOWN} -g ${BINGRP} -m ${BINMODE}
                    718: INSTALL_SCRIPT_DIR= \
                    719:    ${INSTALL_PROGRAM_DIR}
                    720: INSTALL_DATA_DIR= \
                    721:    ${INSTALL} -d -o ${SHAREOWN} -g ${SHAREGRP} -m ${BINMODE}
                    722: INSTALL_MAN_DIR= \
                    723:    ${INSTALL} -d -o ${MANOWN} -g ${MANGRP} -m ${BINMODE}
1.6       niklas    724:
1.13      imp       725: INSTALL_MACROS=    BSD_INSTALL_PROGRAM="${INSTALL_PROGRAM}" \
                    726:            BSD_INSTALL_SCRIPT="${INSTALL_SCRIPT}" \
                    727:            BSD_INSTALL_DATA="${INSTALL_DATA}" \
1.44      marc      728:            BSD_INSTALL_MAN="${INSTALL_MAN}" \
                    729:            BSD_INSTALL_PROGRAM_DIR="${INSTALL_PROGRAM_DIR}" \
                    730:            BSD_INSTALL_SCRIPT_DIR="${INSTALL_SCRIPT_DIR}" \
                    731:            BSD_INSTALL_DATA_DIR="${INSTALL_DATA_DIR}" \
                    732:            BSD_INSTALL_MAN_DIR="${INSTALL_MAN_DIR}"
1.13      imp       733: MAKE_ENV+= ${INSTALL_MACROS}
                    734: SCRIPTS_ENV+=  ${INSTALL_MACROS}
                    735:
1.1       niklas    736: # The user can override the NO_PACKAGE by specifying this from
                    737: # the make command line
                    738: .if defined(FORCE_PACKAGE)
                    739: .undef NO_PACKAGE
                    740: .endif
                    741:
1.31      marc      742: # Support architecture dependent packing lists
                    743: #
1.13      imp       744: COMMENT?=  ${PKGDIR}/COMMENT
                    745: DESCR?=        ${PKGDIR}/DESCR
1.31      marc      746: .if exists(${PKGDIR}/PLIST.${ARCH})
                    747: PLIST?=        ${PKGDIR}/PLIST.${ARCH}
1.62      marc      748: .else
                    749: .if defined(NO_SHARED_LIBS) && exists(${PKGDIR}/PLIST.noshared)
                    750: PLIST?=        ${PKGDIR}/PLIST.noshared
1.31      marc      751: .else
1.13      imp       752: PLIST?=        ${PKGDIR}/PLIST
1.63      marc      753: .endif
1.31      marc      754: .endif
1.13      imp       755:
1.1       niklas    756: PKG_CMD?=      /usr/sbin/pkg_create
1.52      espie     757: PKG_DELETE?=   /usr/sbin/pkg_delete
1.88      espie     758: SORT_DEPENDS?=tsort|tail +2|tail -r
                    759:
1.1       niklas    760: .if !defined(PKG_ARGS)
1.88      espie     761: PKG_ARGS=      -v -c ${COMMENT} -d ${DESCR} -f ${PLIST} -p ${PREFIX} -P "`${MAKE} package-depends|${SORT_DEPENDS}`"
1.1       niklas    762: .if exists(${PKGDIR}/INSTALL)
                    763: PKG_ARGS+=     -i ${PKGDIR}/INSTALL
                    764: .endif
                    765: .if exists(${PKGDIR}/DEINSTALL)
                    766: PKG_ARGS+=     -k ${PKGDIR}/DEINSTALL
                    767: .endif
                    768: .if exists(${PKGDIR}/REQ)
                    769: PKG_ARGS+=     -r ${PKGDIR}/REQ
                    770: .endif
1.9       imp       771: .if exists(${PKGDIR}/MESSAGE)
                    772: PKG_ARGS+=     -D ${PKGDIR}/MESSAGE
                    773: .endif
1.13      imp       774: .if !defined(NO_MTREE)
                    775: PKG_ARGS+=     -m ${MTREE_FILE}
1.1       niklas    776: .endif
                    777: .endif
                    778: PKG_SUFX?=     .tgz
                    779: # where pkg_add records its dirty deeds.
                    780: PKG_DBDIR?=        /var/db/pkg
                    781:
                    782: # shared/dynamic motif libs
1.49      form      783: .if defined(USE_MOTIF) || defined(HAVE_MOTIF)
1.1       niklas    784: .if defined(MOTIF_STATIC)
                    785: MOTIFLIB?= ${X11BASE}/lib/libXm.a
                    786: .else
                    787: MOTIFLIB?= -L${X11BASE}/lib -lXm
                    788: .endif
                    789: .endif
                    790:
1.13      imp       791: AWK?=      /usr/bin/awk
                    792: BASENAME?= /usr/bin/basename
1.9       imp       793: CAT?=      /bin/cat
1.1       niklas    794: CP?=       /bin/cp
1.32      marc      795: DIRNAME?=  /usr/bin/dirname
1.13      imp       796: ECHO?=     /bin/echo
1.52      espie     797: EXPR?=     /bin/expr
1.9       imp       798: FALSE?=        /usr/bin/false
1.44      marc      799: FILE?=     /usr/bin/file
1.9       imp       800: GREP?=     /usr/bin/grep
1.13      imp       801: GUNZIP_CMD?=   /usr/bin/gunzip -f
1.1       niklas    802: GZCAT?=        /usr/bin/gzcat
1.9       imp       803: GZIP?=     -9
                    804: GZIP_CMD?= /usr/bin/gzip -nf ${GZIP}
1.22      niklas    805: LDCONFIG?= [ ! -x /sbin/ldconfig ] || /sbin/ldconfig
1.14      niklas    806: LN?=       /bin/ln
1.50      espie     807: M4?=       /usr/bin/m4
1.13      imp       808: MKDIR?=        /bin/mkdir -p
                    809: MV?=       /bin/mv
1.18      niklas    810: READLINK?= /usr/bin/readlink
1.13      imp       811: RM?=       /bin/rm
                    812: RMDIR?=        /bin/rmdir
1.1       niklas    813: SED?=      /usr/bin/sed
1.87      espie     814: FIND?=      /usr/bin/find
1.52      espie     815:
                    816: # XXX ${SETENV} is needed in front of var=value lists whenever the next
                    817: # command is expanded from a variable, as this could be a shell construct
1.44      marc      818: SETENV?=   /usr/bin/env
1.13      imp       819: SH?=       /bin/sh
                    820: TR?=       /usr/bin/tr
1.44      marc      821: TRUE?=     /usr/bin/true
1.1       niklas    822:
                    823: # Used to print all the '===>' style prompts - override this to turn them off.
                    824: ECHO_MSG?=     ${ECHO}
                    825:
1.44      marc      826: # How to do nothing.  Override if you, for some strange reason, would rather
                    827: # do something.
                    828: DO_NADA?=      ${TRUE}
                    829:
1.1       niklas    830: ALL_TARGET?=       all
                    831: INSTALL_TARGET?=   install
                    832:
1.44      marc      833: .if defined(USE_IMAKE) && !defined(NO_INSTALL_MANPAGES)
                    834: INSTALL_TARGET+=   install.man
                    835: .endif
                    836:
1.9       imp       837: # Popular master sites
1.13      imp       838: MASTER_SITE_XCONTRIB+= \
                    839:    ftp://crl.dec.com/pub/X11/contrib/%SUBDIR%/ \
1.60      rohee     840:    ftp://ftp.eu.net/X11/contrib/%SUBDIR%/ \
1.44      marc      841:    ftp://ftp.uni-paderborn.de/pub/X11/contrib/%SUBDIR%/ \
                    842:    ftp://ftp.x.org/contrib/%SUBDIR%/
1.13      imp       843:
                    844: MASTER_SITE_GNU+=  \
                    845:    ftp://prep.ai.mit.edu/pub/gnu/%SUBDIR%/ \
1.92    ! brad      846:    ftp://wuarchive.wustl.edu/systems/gnu/%SUBDIR%/ \
        !           847:    ftp://ftp.kddlabs.co.jp/pub/gnu/%SUBDIR%/ \
        !           848:    ftp://ftp.digex.net/pub/gnu/%SUBDIR%/ \
        !           849:    ftp://ftp.cs.ubc.ca/mirror2/gnu/%SUBDIR%/ \
        !           850:    ftp://ftp.cdrom.com/pub/gnu/%SUBDIR%/ \
        !           851:    ftp://ftp.duke.edu/pub/gnu/%SUBDIR%/ \
        !           852:    ftp://ftp.gamma.ru/pub/gnu/%SUBDIR%/ \
        !           853:    ftp://tron.um.u-tokyo.ac.jp/pub/GNU/prep/%SUBDIR%/
1.13      imp       854:
                    855: MASTER_SITE_PERL_CPAN+=    \
                    856:    ftp://ftp.digital.com/pub/plan/perl/CPAN/modules/by-module/%SUBDIR%/ \
                    857:    ftp://ftp.cdrom.com/pub/perl/CPAN/modules/by-module/%SUBDIR%/
                    858:
1.78      rohee     859: MASTER_SITE_TEX_CTAN+= \
                    860:    ftp://ftp.cdrom.com/pub/tex/ctan/%SUBDIR%/ \
                    861:    ftp://wuarchive.wustl.edu/packages/TeX/%SUBDIR%/ \
                    862:    ftp://ftp.funet.fi/pub/TeX/CTAN/%SUBDIR%/ \
                    863:    ftp://ftp.tex.ac.uk/public/ctan/tex-archive/%SUBDIR%/ \
                    864:    ftp://ftp.dante.de/tex-archive/%SUBDIR%/
1.13      imp       865:
                    866: MASTER_SITE_SUNSITE+=  \
1.70      rohee     867:    ftp://metalab.unc.edu/pub/Linux/%SUBDIR%/ \
1.13      imp       868:    ftp://ftp.infomagic.com/pub/mirrors/linux/sunsite/%SUBDIR%/ \
1.70      rohee     869:    ftp://ftp.funet.fi/pub/mirrors/sunsite.unc.edu/pub/Linux/%SUBDIR%/ \
                    870:    ftp://ftp.lip6.fr/pub/linux/sunsite/%SUBDIR%
1.78      rohee     871:
                    872: MASTER_SITE_KDE+=  \
                    873:    ftp://ftp.us.kde.org/pub/kde/%SUBDIR%/ \
                    874:    ftp://ftp.kde.org/pub/kde/%SUBDIR%/ \
                    875:    ftp://ftp.tuniv.szczecin.pl/pub/kde/%SUBDIR%/ \
                    876:    ftp://ftp.fu-berlin.de/pub/unix/X11/gui/kde/%SUBDIR%/ \
                    877:    ftp://ftp.dataplus.se/pub/linux/kde/%SUBDIR%/
                    878:
                    879: MASTER_SITE_GNOME+=    \
                    880:    ftp://ftp.jimpick.com/pub/mirrors/gnome/%SUBDIR%/ \
                    881:    ftp://ftp.geo.net/pub/gnome/%SUBDIR%/ \
                    882:    ftp://gnomeftp.wgn.net/pub/gnome/%SUBDIR%/ \
                    883:    ftp://ftp.gnome.org/pub/GNOME/%SUBDIR%/
1.92    ! brad      884:
        !           885: MASTER_SITE_AFTERSTEP+=    \
        !           886:    ftp://ftp.afterstep.org/%SUBDIR%/ \
        !           887:    ftp://ftp.digex.net/pub/os/wm/AfterStep/%SUBDIR%/ \
        !           888:    ftp://ftp.alpha1.net/pub/mirrors/ftp.afterstep.org/%SUBDIR%/ \
        !           889:    ftp://ftp.math.uni-bonn.de/pub/mirror/ftp.afterstep.org/%SUBDIR%/ \
        !           890:    ftp://ftp.bse.bg/pub/Unix/X11/wm/afterstep/%SUBDIR%/ \
        !           891:    ftp://ftp.dti.ad.jp/pub/X/AfterStep/%SUBDIR%/ \
        !           892:    ftp://ftp.lbi.ro/mirrors/ftp.afterstep.org/pub/%SUBDIR%/ \
        !           893:    ftp://casper.yz.yamagata-u.ac.jp/pub/X11/apps/afterstep/%SUBDIR%/
        !           894:
        !           895: MASTER_SITE_WINDOWMAKER+= \
        !           896:    ftp://ftp.windowmaker.org/pub/%SUBDIR%/ \
        !           897:    ftp://ftp.goldweb.com.au/pub/WindowMaker/%SUBDIR%/ \
        !           898:    ftp://ftp.io.com/pub/mirror/windowmaker/%SUBDIR%/ \
        !           899:    ftp://ftp.ensm-ales.fr/pub/mirrors/ftp.windowmaker.org/%SUBDIR%/ \
        !           900:    ftp://ftp.freenews.de/pub/windowmaker/%SUBDIR%/ \
        !           901:    http://jgo.local.net/cool_downloads/wm/%SUBDIR%/ \
        !           902:    ftp://ftp.cybertrails.com/pub/windowmaker/%SUBDIR%/ \
        !           903:    ftp://ftp.ameth.org/pub/mirrors/ftp.windowmaker.org/%SUBDIR%/
        !           904:
        !           905: MASTER_SITE_TCLTK+= \
        !           906:    ftp://ftp.scriptics.com/pub/tcl/%SUBDIR%/ \
        !           907:    ftp://mirror.neosoft.com/pub/tcl/mirror/ftp.scriptics.com/%SUBDIR%/ \
        !           908:    ftp://sunsite.utk.edu/pub/tcl/%SUBDIR%/ \
        !           909:    ftp://ftp.funet.fi/pub/languages/tcl/tcl/%SUBDIR%/ \
        !           910:    ftp://ftp.cs.tu-berlin.de/pub/tcl/distrib/%SUBDIR%/ \
        !           911:    ftp://ftp.srcc.msu.su/mirror/ftp.scriptics.com/pub/tcl/%SUBDIR%/ \
        !           912:    ftp://ftp.lip6.fr/pub/tcl/distrib/%SUBDIR%/
1.13      imp       913:
                    914: # Empty declaration to avoid "variable MASTER_SITES recursive" error
                    915: MASTER_SITES?=
                    916: PATCH_SITES?=
                    917:
                    918: # Substitute subdirectory names
1.57      espie     919: _MASTER_SITES:=    ${MASTER_SITES:S/%SUBDIR%/${MASTER_SITE_SUBDIR}/}
1.13      imp       920: PATCH_SITES:=  ${PATCH_SITES:S/%SUBDIR%/${PATCH_SITE_SUBDIR}/}
1.57      espie     921: MASTER_SITES:= ${_MASTER_SITES}
1.9       imp       922:
1.27      marc      923: # Two backup master sites, First one at ftp.openbsd.org
                    924: #
                    925: _MASTER_SITE_OPENBSD?= \
1.34      marc      926:    ftp://ftp.openbsd.org/pub/OpenBSD/distfiles/${DIST_SUBDIR}/ \
                    927:    ftp://ftp.openbsd.org/pub/OpenBSD/licensed/${DIST_SUBDIR}/
1.27      marc      928:
                    929: # set the backup master sites.
                    930: #
1.9       imp       931: MASTER_SITE_BACKUP?=   \
1.58      pattonme  932:    ${_MASTER_SITE_OPENBSD} \
                    933:    ftp://ftp.freebsd.org/pub/FreeBSD/distfiles/${DIST_SUBDIR}/
1.27      marc      934:
                    935: # If the user has this set, go to the OpenBSD repository for everything.
                    936: #
                    937: .if defined(MASTER_SITE_OPENBSD)
                    938: MASTER_SITE_OVERRIDE=  ${_MASTER_SITE_OPENBSD}
                    939: .endif
1.9       imp       940:
1.13      imp       941: # Where to put distfiles that don't have any other master site
1.27      marc      942: # ;;; This is referenced in a few Makefiles -- I'd like to get rid of it
                    943: #
1.13      imp       944: MASTER_SITE_LOCAL?= \
1.44      marc      945:    ftp://ftp.netbsd.org/pub/NetBSD/packages/distfiles/LOCAL_PORTS/ \
1.13      imp       946:    ftp://ftp.freebsd.org/pub/FreeBSD/distfiles/LOCAL_PORTS/
                    947:
1.1       niklas    948: # I guess we're in the master distribution business! :)  As we gain mirror
                    949: # sites for distfiles, add them to this list.
                    950: .if !defined(MASTER_SITE_OVERRIDE)
1.9       imp       951: MASTER_SITES+= ${MASTER_SITE_BACKUP}
                    952: PATCH_SITES+=  ${MASTER_SITE_BACKUP}
1.1       niklas    953: .else
                    954: MASTER_SITES:= ${MASTER_SITE_OVERRIDE} ${MASTER_SITES}
                    955: PATCH_SITES:=  ${MASTER_SITE_OVERRIDE} ${PATCH_SITES}
                    956: .endif
                    957:
1.28      marc      958: # OpenBSD code to handle ports distfiles on a CDROM.  The distfiles
                    959: # are located in /cdrom/distfiles/${DIST_SUBDIR}/ (assuming that the
                    960: # CDROM is mounted on /cdrom).
                    961: #
                    962: .if exists(/cdrom/distfiles)
                    963: CDROM_SITE:=   /cdrom/distfiles/${DIST_SUBDIR}
                    964: .if defined(FETCH_SYMLINK_DISTFILES)
                    965: CDROM_COPY:=   ${LN}
                    966: CDROM_OPT=     -s
                    967: .else
                    968: CDROM_COPY:=   ${CP}
                    969: CDROM_OPT=     -f
                    970: .endif
                    971: .endif
                    972:
1.1       niklas    973: # Derived names so that they're easily overridable.
                    974: DISTFILES?=        ${DISTNAME}${EXTRACT_SUFX}
                    975: PKGNAME?=      ${DISTNAME}
                    976:
1.85      espie     977: .if make(makesum) || make(addsum) || defined(__FETCH_ALL)
                    978: .if defined(SUPDISTFILES)
                    979:  DISTFILES+=${SUPDISTFILES}
                    980: .endif
                    981: .if defined(SUPPATCHFILES)
                    982:  PATCHFILES+=${SUPPATCHFILES}
1.88      espie     983: .endif
1.85      espie     984: .endif
1.9       imp       985: ALLFILES?= ${DISTFILES} ${PATCHFILES}
                    986:
                    987: .if defined(IGNOREFILES)
                    988: CKSUMFILES!=   \
                    989:    for file in ${ALLFILES}; do \
                    990:        ignore=0; \
                    991:        for tmp in ${IGNOREFILES}; do \
                    992:            if [ "$$file" = "$$tmp" ]; then \
                    993:                ignore=1; \
                    994:            fi; \
                    995:        done; \
                    996:        if [ "$$ignore" = 0 ]; then \
                    997:            echo "$$file"; \
1.44      marc      998:        else \
                    999:            echo ""; \
1.9       imp      1000:        fi; \
                   1001:    done
                   1002: .else
                   1003: CKSUMFILES=        ${ALLFILES}
                   1004: .endif
                   1005:
                   1006: # List of all files, with ${DIST_SUBDIR} in front.  Used for checksum.
                   1007: .if defined(DIST_SUBDIR)
                   1008: _CKSUMFILES?=  ${CKSUMFILES:S/^/${DIST_SUBDIR}\//}
                   1009: _IGNOREFILES?= ${IGNOREFILES:S/^/${DIST_SUBDIR}\//}
                   1010: .else
                   1011: _CKSUMFILES?=  ${CKSUMFILES}
                   1012: _IGNOREFILES?= ${IGNOREFILES}
                   1013: .endif
                   1014:
1.1       niklas   1015: # This is what is actually going to be extracted, and is overridable
                   1016: #  by user.
                   1017: EXTRACT_ONLY?= ${DISTFILES}
                   1018:
                   1019: # Documentation
1.44      marc     1020: MAINTAINER?=   ports@OpenBSD.ORG
1.9       imp      1021:
                   1022: .if !defined(CATEGORIES)
                   1023: .BEGIN:
                   1024:    @${ECHO_MSG} "CATEGORIES is mandatory."
                   1025:    @${FALSE}
                   1026: .endif
1.1       niklas   1027:
                   1028: PKGREPOSITORYSUBDIR?=  All
                   1029: PKGREPOSITORY?=        ${PACKAGES}/${PKGREPOSITORYSUBDIR}
                   1030: .if exists(${PACKAGES})
                   1031: PKGFILE?=      ${PKGREPOSITORY}/${PKGNAME}${PKG_SUFX}
                   1032: .else
                   1033: PKGFILE?=      ${PKGNAME}${PKG_SUFX}
                   1034: .endif
                   1035:
1.74      marc     1036: CONFIGURE_SCRIPT?= configure
                   1037: .if defined(SEPARATE_BUILD)
                   1038: _CONFIGURE_SCRIPT=${WRKSRC}/${CONFIGURE_SCRIPT}
                   1039: .else
                   1040: _CONFIGURE_SCRIPT=./${CONFIGURE_SCRIPT}
                   1041: .endif
                   1042: CONFIGURE_ENV+=        PATH=${PORTPATH}
1.1       niklas   1043:
                   1044: .if defined(GNU_CONFIGURE)
                   1045: CONFIGURE_ARGS+=   --prefix=${PREFIX}
1.79      espie    1046: CONFIGURE_ARGS+=   --sysconfdir=${SYSCONFDIR}
1.1       niklas   1047: HAS_CONFIGURE=     yes
1.73      marc     1048: .endif
                   1049:
                   1050: .if defined(NO_SHARED_LIBS)
                   1051: CONFIGURE_SHARED?= --disable-shared
                   1052: .else
                   1053: CONFIGURE_SHARED?= --enable-shared
1.1       niklas   1054: .endif
                   1055:
1.13      imp      1056: # Passed to most of script invocations
1.44      marc     1057: SCRIPTS_ENV+= CURDIR=${.CURDIR} DISTDIR=${DISTDIR} \
1.52      espie    1058:           PATH=${PORTPATH} \
1.60      rohee    1059:          WRKDIR=${WRKDIR} WRKSRC=${WRKSRC} WRKBUILD=${WRKBUILD} \
                   1060:          PATCHDIR=${PATCHDIR} SCRIPTDIR=${SCRIPTDIR} FILESDIR=${FILESDIR} \
1.13      imp      1061:          PORTSDIR=${PORTSDIR} DEPENDS="${DEPENDS}" \
                   1062:          PREFIX=${PREFIX} LOCALBASE=${LOCALBASE} X11BASE=${X11BASE}
                   1063:
                   1064: .if defined(BATCH)
                   1065: SCRIPTS_ENV+=  BATCH=yes
                   1066: .endif
                   1067:
1.9       imp      1068: MANPREFIX?=    ${PREFIX}
1.44      marc     1069: CATPREFIX?=    ${PREFIX}
1.9       imp      1070:
                   1071: .for sect in 1 2 3 4 5 6 7 8 9
                   1072: MAN${sect}PREFIX?= ${MANPREFIX}
1.44      marc     1073: CAT${sect}PREFIX?= ${CATPREFIX}
1.9       imp      1074: .endfor
                   1075: MANLPREFIX?=   ${MANPREFIX}
                   1076: MANNPREFIX?=   ${MANPREFIX}
1.44      marc     1077: CATLPREFIX?=   ${CATPREFIX}
                   1078: CATNPREFIX?=   ${CATPREFIX}
1.9       imp      1079:
                   1080: MANLANG?=  ""  # english only by default
                   1081:
                   1082: .for lang in ${MANLANG}
                   1083:
                   1084: .for sect in 1 2 3 4 5 6 7 8 9
                   1085: .if defined(MAN${sect})
                   1086: _MANPAGES+=    ${MAN${sect}:S%^%${MAN${sect}PREFIX}/man/${lang}/man${sect}/%}
                   1087: .endif
1.44      marc     1088: .if defined(CAT${sect})
                   1089: _CATPAGES+=    ${CAT${sect}:S%^%${CAT${sect}PREFIX}/man/${lang}/cat${sect}/%}
                   1090: .endif
1.9       imp      1091: .endfor
                   1092:
                   1093: .if defined(MANL)
                   1094: _MANPAGES+=    ${MANL:S%^%${MANLPREFIX}/man/${lang}/manl/%}
                   1095: .endif
                   1096:
                   1097: .if defined(MANN)
                   1098: _MANPAGES+=    ${MANN:S%^%${MANNPREFIX}/man/${lang}/mann/%}
                   1099: .endif
                   1100:
1.44      marc     1101: .if defined(CATL)
                   1102: _CATPAGES+=    ${CATL:S%^%${CATLPREFIX}/man/${lang}/catl/%}
                   1103: .endif
1.9       imp      1104:
1.44      marc     1105: .if defined(CATN)
                   1106: _CATPAGES+=    ${CATN:S%^%${CATNPREFIX}/man/${lang}/catn/%}
1.9       imp      1107: .endif
                   1108:
1.44      marc     1109: .endfor
                   1110:
1.1       niklas   1111: .MAIN: all
                   1112:
                   1113: ################################################################
                   1114: # Many ways to disable a port.
                   1115: #
                   1116: # If we're in BATCH mode and the port is interactive, or we're
                   1117: # in interactive mode and the port is non-interactive, skip all
                   1118: # the important targets.  The reason we have two modes is that
                   1119: # one might want to leave a build in BATCH mode running
                   1120: # overnight, then come back in the morning and do _only_ the
                   1121: # interactive ones that required your intervention.
                   1122: #
                   1123: # Don't attempt to build ports that require Motif if you don't
                   1124: # have Motif.
                   1125: #
                   1126: # Ignore ports that can't be resold if building for a CDROM.
                   1127: #
                   1128: # Don't build a port if it's restricted and we don't want to get
                   1129: # into that.
                   1130: #
                   1131: # Don't build a port if it's broken.
1.27      marc     1132: #
                   1133: # Don't build a port if it comes with the base system.
1.1       niklas   1134: ################################################################
                   1135:
1.13      imp      1136: .if !defined(NO_IGNORE)
1.9       imp      1137: .if (defined(IS_INTERACTIVE) && defined(BATCH))
                   1138: IGNORE=    "is an interactive port"
                   1139: .elif (!defined(IS_INTERACTIVE) && defined(INTERACTIVE))
                   1140: IGNORE=    "is not an interactive port"
                   1141: .elif (defined(REQUIRES_MOTIF) && !defined(HAVE_MOTIF))
                   1142: IGNORE=    "requires Motif"
1.13      imp      1143: .elif (defined(MOTIF_ONLY) && !defined(REQUIRES_MOTIF))
                   1144: IGNORE=    "does not require Motif"
1.9       imp      1145: .elif (defined(NO_CDROM) && defined(FOR_CDROM))
                   1146: IGNORE=    "may not be placed on a CDROM: ${NO_CDROM}"
                   1147: .elif (defined(RESTRICTED) && defined(NO_RESTRICTED))
                   1148: IGNORE=    "is restricted: ${RESTRICTED}"
1.13      imp      1149: .elif ((defined(USE_IMAKE) || defined(USE_X11)) && !exists(${X11BASE}))
                   1150: IGNORE=    "uses X11, but ${X11BASE} not found"
1.9       imp      1151: .elif defined(BROKEN)
                   1152: IGNORE=    "is marked as broken: ${BROKEN}"
1.29      marc     1153: .elif defined(ONLY_FOR_ARCHS)
                   1154: .for __ARCH in ${ONLY_FOR_ARCHS}
1.48      form     1155: .if (${MACHINE_ARCH} == "${__ARCH}") || (${ARCH} == "${__ARCH}")
1.29      marc     1156: __ARCH_OK= 1
                   1157: .endif
                   1158: .endfor
                   1159: .if !defined(__ARCH_OK)
1.48      form     1160: .if ${MACHINE_ARCH} == "${ARCH}"
1.44      marc     1161: IGNORE= "is only for ${ONLY_FOR_ARCHS}, not ${MACHINE_ARCH}"
1.48      form     1162: .else
                   1163: IGNORE= "is only for ${ONLY_FOR_ARCHS}, not ${MACHINE_ARCH} \(${ARCH}\)"
                   1164: .endif
1.29      marc     1165: .endif
1.27      marc     1166: .elif defined(COMES_WITH)
1.32      marc     1167: .if ( ${OPSYS_VER} >= ${COMES_WITH} )
1.41      marc     1168: IGNORE= "-- ${PKGNAME:C/-[0-9].*//g} comes with ${OPSYS} as of release ${COMES_WITH}"
1.27      marc     1169: .endif
1.1       niklas   1170: .endif
                   1171:
                   1172: .if defined(IGNORE)
1.9       imp      1173: .if defined(IGNORE_SILENT)
                   1174: IGNORECMD= ${DO_NADA}
                   1175: .else
                   1176: IGNORECMD= ${ECHO_MSG} "===>  ${PKGNAME} ${IGNORE}."
                   1177: .endif
                   1178: fetch:
                   1179:    @${IGNORECMD}
                   1180: checksum:
                   1181:    @${IGNORECMD}
                   1182: extract:
                   1183:    @${IGNORECMD}
                   1184: patch:
                   1185:    @${IGNORECMD}
                   1186: configure:
                   1187:    @${IGNORECMD}
1.1       niklas   1188: all:
1.9       imp      1189:    @${IGNORECMD}
1.1       niklas   1190: build:
1.9       imp      1191:    @${IGNORECMD}
1.1       niklas   1192: install:
1.9       imp      1193:    @${IGNORECMD}
1.44      marc     1194: uninstall deinstall:
                   1195:    @${IGNORECMD}
1.1       niklas   1196: package:
1.9       imp      1197:    @${IGNORECMD}
1.44      marc     1198: .endif # IGNORE
                   1199: .endif # !NO_IGNORE
1.1       niklas   1200:
                   1201: .if defined(ALL_HOOK)
                   1202: all:
1.6       niklas   1203:    @cd ${.CURDIR} && ${SETENV} CURDIR=${.CURDIR} DISTNAME=${DISTNAME} \
1.60      rohee    1204:      DISTDIR=${DISTDIR} WRKDIR=${WRKDIR} WRKSRC=${WRKSRC} WRKBUILD=${WRKBUILD}\
1.1       niklas   1205:      PATCHDIR=${PATCHDIR} SCRIPTDIR=${SCRIPTDIR} \
                   1206:      FILESDIR=${FILESDIR} PORTSDIR=${PORTSDIR} PREFIX=${PREFIX} \
                   1207:      DEPENDS="${DEPENDS}" BUILD_DEPENDS="${BUILD_DEPENDS}" \
                   1208:      RUN_DEPENDS="${RUN_DEPENDS}" X11BASE=${X11BASE} \
                   1209:    ${ALL_HOOK}
                   1210: .endif
                   1211:
                   1212: .if !target(all)
                   1213: all: build
                   1214: .endif
                   1215:
1.13      imp      1216: .if !defined(DEPENDS_TARGET)
                   1217: .if make(reinstall)
                   1218: DEPENDS_TARGET=    reinstall
                   1219: .else
                   1220: DEPENDS_TARGET=    install
1.1       niklas   1221: .endif
                   1222: .endif
                   1223:
                   1224: ################################################################
                   1225: # The following are used to create easy dummy targets for
                   1226: # disabling some bit of default target behavior you don't want.
                   1227: # They still check to see if the target exists, and if so don't
                   1228: # do anything, since you might want to set this globally for a
                   1229: # group of ports in a Makefile.inc, but still be able to
                   1230: # override from an individual Makefile.
                   1231: ################################################################
                   1232:
1.9       imp      1233: # Disable checksum
1.76      espie    1234: .if defined(NO_CHECKSUM)
1.85      espie    1235: .for _TARGET in makesum addsum
1.76      espie    1236: .if !target(${_TARGET})
1.85      espie    1237: ${_TARGET}: fetch-all
1.9       imp      1238:    @${DO_NADA}
                   1239: .endif
1.76      espie    1240: .endfor
1.85      espie    1241: .if !target(checksum)
                   1242: checksum: fetch
                   1243:    @${DO_NADA}
                   1244: .endif
1.76      espie    1245: .endif
1.9       imp      1246:
1.1       niklas   1247: # Disable extract
                   1248: .if defined(NO_EXTRACT) && !target(extract)
1.61      espie    1249: extract:
1.1       niklas   1250:    @${TOUCH} ${TOUCH_FLAGS} ${EXTRACT_COOKIE}
1.85      espie    1251: checksum: fetch
                   1252:    @${DO_NADA}
                   1253: makesum addsum: fetch-all
1.50      espie    1254:    @${DO_NADA}
1.1       niklas   1255: .endif
                   1256:
1.9       imp      1257: # Disable patch
                   1258: .if defined(NO_PATCH) && !target(patch)
                   1259: patch: extract
                   1260:    @${TOUCH} ${TOUCH_FLAGS} ${PATCH_COOKIE}
                   1261: .endif
                   1262:
1.1       niklas   1263: # Disable configure
                   1264: .if defined(NO_CONFIGURE) && !target(configure)
                   1265: configure: patch
                   1266:    @${TOUCH} ${TOUCH_FLAGS} ${CONFIGURE_COOKIE}
                   1267: .endif
                   1268:
                   1269: # Disable build
                   1270: .if defined(NO_BUILD) && !target(build)
                   1271: build: configure
                   1272:    @${TOUCH} ${TOUCH_FLAGS} ${BUILD_COOKIE}
                   1273: .endif
                   1274:
1.9       imp      1275: # Disable install
                   1276: .if defined(NO_INSTALL) && !target(install)
                   1277: install: build
                   1278:    @${TOUCH} ${TOUCH_FLAGS} ${INSTALL_COOKIE}
                   1279: .endif
                   1280:
1.1       niklas   1281: # Disable package
                   1282: .if defined(NO_PACKAGE) && !target(package)
                   1283: package:
1.9       imp      1284: .if defined(IGNORE_SILENT)
1.1       niklas   1285:    @${DO_NADA}
1.9       imp      1286: .else
                   1287:    @${ECHO_MSG} "===>  ${PKGNAME} may not be packaged: ${NO_PACKAGE}."
1.1       niklas   1288: .endif
                   1289: .endif
                   1290:
1.9       imp      1291: # Disable describe
                   1292: .if defined(NO_DESCRIBE) && !target(describe)
                   1293: describe:
                   1294:    @${DO_NADA}
1.1       niklas   1295: .endif
                   1296:
                   1297: ################################################################
                   1298: # More standard targets start here.
                   1299: #
                   1300: # These are the body of the build/install framework.  If you are
                   1301: # not happy with the default actions, and you can't solve it by
                   1302: # adding pre-* or post-* targets/scripts, override these.
                   1303: ################################################################
                   1304:
                   1305: # Fetch
                   1306:
                   1307: .if !target(do-fetch)
                   1308: do-fetch:
1.9       imp      1309:    @${MKDIR} ${_DISTDIR}
                   1310:    @(cd ${_DISTDIR}; \
1.1       niklas   1311:     for file in ${DISTFILES}; do \
                   1312:        if [ ! -f $$file -a ! -f `${BASENAME} $$file` ]; then \
                   1313:            if [ -h $$file -o -h `${BASENAME} $$file` ]; then \
1.9       imp      1314:                ${ECHO_MSG} ">> ${_DISTDIR}/$$file is a broken symlink."; \
1.1       niklas   1315:                ${ECHO_MSG} ">> Perhaps a filesystem (most likely a CD) isn't mounted?"; \
                   1316:                ${ECHO_MSG} ">> Please correct this problem and try again."; \
                   1317:                exit 1; \
1.28      marc     1318:            fi ; \
                   1319:            if [ ! -z ${CDROM_COPY} ]; then \
                   1320:                if ${CDROM_COPY} ${CDROM_OPT} ${CDROM_SITE}/$$file .; then \
                   1321:                    continue; \
                   1322:                fi ; \
1.1       niklas   1323:            fi ; \
                   1324:            ${ECHO_MSG} ">> $$file doesn't seem to exist on this system."; \
1.46      form     1325:            if [ ! -w ${_DISTDIR}/. ]; then \
                   1326:                ${ECHO_MSG} ">> Can't download to ${_DISTDIR} (permission denied?)."; \
                   1327:                exit 1; \
                   1328:            fi; \
1.1       niklas   1329:            for site in ${MASTER_SITES}; do \
                   1330:                ${ECHO_MSG} ">> Attempting to fetch from $${site}."; \
1.6       niklas   1331:                if ${FETCH_CMD} ${FETCH_BEFORE_ARGS} $${site}$${file} ${FETCH_AFTER_ARGS}; then \
1.1       niklas   1332:                    continue 2; \
                   1333:                fi \
                   1334:            done; \
1.6       niklas   1335:            ${ECHO_MSG} ">> Couldn't fetch it - please try to retrieve this";\
1.9       imp      1336:            ${ECHO_MSG} ">> port manually into ${_DISTDIR} and try again."; \
1.1       niklas   1337:            exit 1; \
                   1338:        fi \
                   1339:     done)
                   1340: .if defined(PATCHFILES)
1.9       imp      1341:    @(cd ${_DISTDIR}; \
1.1       niklas   1342:     for file in ${PATCHFILES}; do \
                   1343:        if [ ! -f $$file -a ! -f `${BASENAME} $$file` ]; then \
                   1344:            if [ -h $$file -o -h `${BASENAME} $$file` ]; then \
1.9       imp      1345:                ${ECHO_MSG} ">> ${_DISTDIR}/$$file is a broken symlink."; \
1.1       niklas   1346:                ${ECHO_MSG} ">> Perhaps a filesystem (most likely a CD) isn't mounted?"; \
                   1347:                ${ECHO_MSG} ">> Please correct this problem and try again."; \
                   1348:                exit 1; \
                   1349:            fi ; \
                   1350:            ${ECHO_MSG} ">> $$file doesn't seem to exist on this system."; \
                   1351:            for site in ${PATCH_SITES}; do \
                   1352:                ${ECHO_MSG} ">> Attempting to fetch from $${site}."; \
1.6       niklas   1353:                if ${FETCH_CMD} ${FETCH_BEFORE_ARGS} $${site}$${file} ${FETCH_AFTER_ARGS}; then \
1.1       niklas   1354:                    continue 2; \
                   1355:                fi \
                   1356:            done; \
1.6       niklas   1357:            ${ECHO_MSG} ">> Couldn't fetch it - please try to retrieve this";\
1.9       imp      1358:            ${ECHO_MSG} ">> port manually into ${_DISTDIR} and try again."; \
1.1       niklas   1359:            exit 1; \
                   1360:        fi \
                   1361:     done)
                   1362: .endif
                   1363: .endif
                   1364:
1.44      marc     1365: # This is for the use of sites which store distfiles which others may
                   1366: # fetch - only fetch the distfile if it is allowed to be
                   1367: # re-distributed freely
                   1368: mirror-distfiles:
                   1369: .if (${MIRROR_DISTFILE} == "yes")
1.85      espie    1370:    @make fetch-all __ARCH_OK=yes NO_IGNORE=yes NO_WARNINGS=yes
1.81      marc     1371: .endif
                   1372:
1.82      marc     1373: # list the distribution and patch files used by a port.  Typical
                   1374: # use is       make ECHO_MSG=: list-distfiles | tee some-file
                   1375: #
                   1376: list-distfiles:
1.83      marc     1377:    @echo "${PKGNAME}"
                   1378:    @for file in ${DISTFILES} ${PATCHFILES}; do \
                   1379:        if [ "$$file" != "${EXTRACT_SUFX}" ]; then \
                   1380:            if [ -z "${DIST_SUBDIR}" ]; then \
                   1381:                printf "\t$$file\n"; \
                   1382:            else \
                   1383:                printf "\t${DIST_SUBDIR}/$$file\n"; \
                   1384:            fi \
                   1385:        fi \
                   1386:     done
                   1387:    @echo ""
1.82      marc     1388:
1.81      marc     1389: # Obj
1.82      marc     1390: #
1.81      marc     1391: .if !target(obj)
                   1392: obj:
                   1393: .if !defined(NO_WRKDIR)
                   1394: .if defined(WRKOBJDIR)
                   1395:    @${RM} -rf ${WRKOBJDIR}/${PORTSUBDIR}
                   1396:    @${MKDIR} -p ${WRKOBJDIR}/${PORTSUBDIR}
                   1397:    @if [ ! -L ${WRKDIR} ] || \
                   1398:      [ X`${READLINK} ${WRKDIR}` != X${WRKOBJDIR}/${PORTSUBDIR} ]; then \
                   1399:        echo "${WRKDIR} -> ${WRKOBJDIR}/${PORTSUBDIR}"; \
                   1400:        ${RM} -f ${WRKDIR}; \
                   1401:        ${LN} -sf ${WRKOBJDIR}/${PORTSUBDIR} ${WRKDIR}; \
                   1402:    fi
                   1403: .else
                   1404:    @${ECHO_MSG} ">>"
                   1405:    @${ECHO_MSG} ">> Please set the WRKOBJDIR variable before using 'make obj'"
                   1406:    @${ECHO_MSG} ">>"
                   1407:    @exit 1;
                   1408: .endif
                   1409: .endif
1.44      marc     1410: .endif
                   1411:
1.1       niklas   1412: # Extract
                   1413:
                   1414: .if !target(do-extract)
                   1415: do-extract:
1.6       niklas   1416: .if !defined(NO_WRKDIR)
1.14      niklas   1417: .if defined(WRKOBJDIR)
                   1418:    @${RM} -rf ${WRKOBJDIR}/${PORTSUBDIR}
1.44      marc     1419:    @${MKDIR} -p ${WRKOBJDIR}/${PORTSUBDIR}
1.18      niklas   1420:    @if [ ! -L ${WRKDIR} ] || \
                   1421:      [ X`${READLINK} ${WRKDIR}` != X${WRKOBJDIR}/${PORTSUBDIR} ]; then \
                   1422:        echo "${WRKDIR} -> ${WRKOBJDIR}/${PORTSUBDIR}"; \
                   1423:        ${RM} -f ${WRKDIR}; \
                   1424:        ${LN} -sf ${WRKOBJDIR}/${PORTSUBDIR} ${WRKDIR}; \
                   1425:    fi
1.14      niklas   1426: .else
1.1       niklas   1427:    @${RM} -rf ${WRKDIR}
1.9       imp      1428:    @${MKDIR} ${WRKDIR}
1.6       niklas   1429: .endif
1.14      niklas   1430: .endif
1.91      brad     1431:    @PATH=${PORTPATH}; \
                   1432:    for file in ${EXTRACT_ONLY}; do \
1.10      niklas   1433:        if ! (cd ${WRKDIR} && ${EXTRACT_CMD} ${EXTRACT_BEFORE_ARGS} ${_DISTDIR}/$$file ${EXTRACT_AFTER_ARGS});\
1.1       niklas   1434:        then \
                   1435:            exit 1; \
                   1436:        fi \
                   1437:    done
                   1438: .endif
                   1439:
                   1440: # Patch
                   1441:
                   1442: .if !target(do-patch)
                   1443: do-patch:
                   1444: .if defined(PATCHFILES)
                   1445:    @${ECHO_MSG} "===>  Applying distribution patches for ${PKGNAME}"
1.9       imp      1446:    @(cd ${_DISTDIR}; \
1.1       niklas   1447:      for i in ${PATCHFILES}; do \
1.6       niklas   1448:        if [ ${PATCH_DEBUG_TMP} = yes ]; then \
                   1449:            ${ECHO_MSG} "===>   Applying distribution patch $$i" ; \
                   1450:        fi; \
1.1       niklas   1451:        case $$i in \
                   1452:            *.Z|*.gz) \
                   1453:                ${GZCAT} $$i | ${PATCH} ${PATCH_DIST_ARGS}; \
                   1454:                ;; \
                   1455:            *) \
                   1456:                ${PATCH} ${PATCH_DIST_ARGS} < $$i; \
                   1457:                ;; \
                   1458:        esac; \
                   1459:      done)
                   1460: .endif
                   1461:    @if [ -d ${PATCHDIR} ]; then \
1.52      espie    1462:        (cd ${PATCHDIR}; \
                   1463:        for i in ${PATCH_LIST}; do \
1.50      espie    1464:            case $$i in \
                   1465:                *.orig|*.rej|*~) \
                   1466:                    ${ECHO_MSG} "===>   Ignoring patchfile $$i" ; \
                   1467:                    ;; \
                   1468:                *) \
                   1469:                    if [ -e $$i ]; then \
1.6       niklas   1470:                        if [ ${PATCH_DEBUG_TMP} = yes ]; then \
1.9       imp      1471:                            ${ECHO_MSG} "===>   Applying ${OPSYS} patch $$i" ; \
1.6       niklas   1472:                        fi; \
                   1473:                        ${PATCH} ${PATCH_ARGS} < $$i; \
1.50      espie    1474:                    else \
                   1475:                        ${ECHO_MSG} "===>   Can't find patch matching $$i"; \
                   1476:                        if [ -d ${PATCHDIR}/CVS -a "$$i" = \
                   1477:                            "${PATCHDIR}/patch-*" ]; then \
                   1478:                                ${ECHO_MSG} "===>   Perhaps you forgot the -P flag to cvs co or update?"; \
                   1479:                        fi; \
                   1480:                    fi; \
                   1481:                    ;; \
                   1482:            esac; \
1.52      espie    1483:        done) \
1.1       niklas   1484:    fi
                   1485: .endif
                   1486:
                   1487: # Configure
                   1488:
                   1489: .if !target(do-configure)
1.60      rohee    1490: do-configure: ${WRKBUILD}
1.52      espie    1491: .if defined(USE_AUTOCONF)
                   1492:    @cd ${AUTOCONF_DIR} && ${SETENV} ${AUTOCONF_ENV} ${AUTOCONF}
                   1493: .endif
1.7       niklas   1494:    @if [ -f ${SCRIPTDIR}/configure ]; then \
1.13      imp      1495:        cd ${.CURDIR} && ${SETENV} ${SCRIPTS_ENV} ${SH} \
                   1496:          ${SCRIPTDIR}/configure; \
1.1       niklas   1497:    fi
                   1498: .if defined(HAS_CONFIGURE)
1.60      rohee    1499:    @(cd ${WRKBUILD} && CC="${CC}" ac_cv_path_CC="${CC}" CFLAGS="${CFLAGS}" \
1.47      espie    1500:        CXX="${CXX}" ac_cv_path_CXX="${CXX}" CXXFLAGS="${CXXFLAGS}" \
1.59      marc     1501:        INSTALL="/usr/bin/install -c -o ${BINOWN} -g ${BINGRP}" \
                   1502:        INSTALL_PROGRAM="${INSTALL_PROGRAM}" INSTALL_MAN="${INSTALL_MAN}" \
                   1503:        INSTALL_SCRIPT="${INSTALL_SCRIPT}" INSTALL_DATA="${INSTALL_DATA}" \
1.74      marc     1504:        ${CONFIGURE_ENV} ${_CONFIGURE_SCRIPT} ${CONFIGURE_ARGS})
1.1       niklas   1505: .endif
                   1506: .if defined(USE_IMAKE)
1.44      marc     1507:    @(cd ${WRKSRC} && ${SETENV} ${MAKE_ENV} ${XMKMF})
1.1       niklas   1508: .endif
                   1509: .endif
                   1510:
1.60      rohee    1511: ${WRKBUILD}:
                   1512:    ${MKDIR} ${WRKBUILD}
                   1513:
1.1       niklas   1514: # Build
                   1515:
                   1516: .if !target(do-build)
                   1517: do-build:
1.60      rohee    1518:    @(cd ${WRKBUILD}; ${SETENV} ${MAKE_ENV} ${MAKE_PROGRAM} ${MAKE_FLAGS} ${MAKEFILE} ${ALL_TARGET})
1.1       niklas   1519: .endif
                   1520:
                   1521: # Install
                   1522:
                   1523: .if !target(do-install)
                   1524: do-install:
1.60      rohee    1525:    @(cd ${WRKBUILD} && ${SETENV} ${MAKE_ENV} ${MAKE_PROGRAM} ${MAKE_FLAGS} ${MAKEFILE} ${INSTALL_TARGET})
1.1       niklas   1526: .endif
                   1527:
                   1528: # Package
                   1529:
                   1530: .if !target(do-package)
                   1531: do-package:
1.13      imp      1532:    @if [ -e ${PLIST} ]; then \
1.1       niklas   1533:        ${ECHO_MSG} "===>  Building package for ${PKGNAME}"; \
                   1534:        if [ -d ${PACKAGES} ]; then \
                   1535:            if [ ! -d ${PKGREPOSITORY} ]; then \
1.9       imp      1536:                if ! ${MKDIR} ${PKGREPOSITORY}; then \
1.1       niklas   1537:                    ${ECHO_MSG} ">> Can't create directory ${PKGREPOSITORY}."; \
                   1538:                    exit 1; \
                   1539:                fi; \
                   1540:            fi; \
                   1541:        fi; \
                   1542:        if ${PKG_CMD} ${PKG_ARGS} ${PKGFILE}; then \
                   1543:            if [ -d ${PACKAGES} ]; then \
                   1544:                ${MAKE} ${.MAKEFLAGS} package-links; \
                   1545:            fi; \
                   1546:        else \
                   1547:            ${MAKE} ${.MAKEFLAGS} delete-package; \
                   1548:            exit 1; \
                   1549:        fi; \
                   1550:    fi
                   1551: .endif
                   1552:
                   1553: # Some support rules for do-package
                   1554:
                   1555: .if !target(package-links)
                   1556: package-links:
                   1557:    @${MAKE} ${.MAKEFLAGS} delete-package-links
                   1558:    @for cat in ${CATEGORIES}; do \
                   1559:        if [ ! -d ${PACKAGES}/$$cat ]; then \
1.9       imp      1560:            if ! ${MKDIR} ${PACKAGES}/$$cat; then \
1.1       niklas   1561:                ${ECHO_MSG} ">> Can't create directory ${PACKAGES}/$$cat."; \
                   1562:                exit 1; \
                   1563:            fi; \
                   1564:        fi; \
                   1565:        ln -s ../${PKGREPOSITORYSUBDIR}/${PKGNAME}${PKG_SUFX} ${PACKAGES}/$$cat; \
                   1566:    done;
                   1567: .endif
                   1568:
                   1569: .if !target(delete-package-links)
                   1570: delete-package-links:
1.87      espie    1571:    @${FIND} ${PACKAGES} -type l -name ${PKGNAME}${PKG_SUFX}|xargs ${RM} -f
1.1       niklas   1572: .endif
                   1573:
                   1574: .if !target(delete-package)
                   1575: delete-package:
                   1576:    @${MAKE} ${.MAKEFLAGS} delete-package-links
                   1577:    @${RM} -f ${PKGFILE}
                   1578: .endif
                   1579:
                   1580: ################################################################
                   1581: # This is the "generic" port target, actually a macro used from the
                   1582: # six main targets.  See below for more.
                   1583: ################################################################
                   1584:
                   1585: _PORT_USE: .USE
                   1586: .if make(real-fetch)
1.6       niklas   1587:    @cd ${.CURDIR} && ${MAKE} ${.MAKEFLAGS} fetch-depends
1.1       niklas   1588: .endif
                   1589: .if make(real-extract)
1.6       niklas   1590:    @cd ${.CURDIR} && ${MAKE} ${.MAKEFLAGS} build-depends lib-depends misc-depends
1.1       niklas   1591: .endif
                   1592: .if make(real-install)
1.13      imp      1593: .if !defined(NO_PKG_REGISTER) && !defined(FORCE_PKG_REGISTER)
1.40      espie    1594:    @if [ -d ${PKG_DBDIR}/${PKGNAME} -o "X$$(ls -d ${PKG_DBDIR}/${PKGNAME:C/-[0-9].*//g}-* 2> /dev/null)" != "X" ]; then \
1.13      imp      1595:        ${ECHO_MSG} "===>  ${PKGNAME} is already installed - perhaps an older version?"; \
1.44      marc     1596:        ${ECHO_MSG} "      If so, you may wish to \`\`make deinstall'' and install"; \
1.13      imp      1597:        ${ECHO_MSG} "      this port again by \`\`make reinstall'' to upgrade it properly."; \
                   1598:        ${ECHO_MSG} "      If you really wish to overwrite the old port of ${PKGNAME}"; \
                   1599:        ${ECHO_MSG} "      without deleting it first, set the variable \"FORCE_PKG_REGISTER\""; \
                   1600:        ${ECHO_MSG} "      in your environment or the \"make install\" command line."; \
                   1601:        exit 1; \
                   1602:    fi
                   1603: .endif
1.14      niklas   1604:    @if [ `${SH} -c umask` != ${DEF_UMASK} ]; then \
1.13      imp      1605:        ${ECHO_MSG} "===>  Warning: your umask is \"`${SH} -c umask`"\".; \
                   1606:        ${ECHO_MSG} "      If this is not desired, set it to an appropriate value"; \
                   1607:        ${ECHO_MSG} "      and install this port again by \`\`make reinstall''."; \
                   1608:    fi
1.9       imp      1609:    @cd ${.CURDIR} && ${MAKE} ${.MAKEFLAGS} run-depends lib-depends
1.1       niklas   1610: .endif
                   1611: .if make(real-install)
1.56      form     1612:    @touch ${INSTALL_PRE_COOKIE}
1.1       niklas   1613: .if !defined(NO_MTREE)
                   1614:    @if [ `id -u` = 0 ]; then \
1.13      imp      1615:        if [ ! -f ${MTREE_FILE} ]; then \
                   1616:            ${ECHO_MSG} "Error: mtree file \"${MTREE_FILE}\" is missing."; \
                   1617:            ${ECHO_MSG} "Copy it from a suitable location (e.g., /usr/src/etc/mtree) and try again."; \
                   1618:            exit 1; \
                   1619:        else \
1.44      marc     1620:            if [ ! -d ${PREFIX} ]; then \
                   1621:                mkdir -p ${PREFIX}; \
                   1622:            fi; \
1.13      imp      1623:            ${MTREE_CMD} ${MTREE_ARGS} ${PREFIX}/; \
                   1624:        fi; \
1.1       niklas   1625:    else \
                   1626:        ${ECHO_MSG} "Warning: not superuser, can't run mtree."; \
                   1627:        ${ECHO_MSG} "Become root and try again to ensure correct permissions."; \
                   1628:    fi
                   1629: .endif
                   1630: .endif
1.6       niklas   1631:    @cd ${.CURDIR} && ${MAKE} ${.MAKEFLAGS} ${.TARGET:S/^real-/pre-/}
1.1       niklas   1632:    @if [ -f ${SCRIPTDIR}/${.TARGET:S/^real-/pre-/} ]; then \
1.13      imp      1633:        cd ${.CURDIR} && ${SETENV} ${SCRIPTS_ENV} ${SH} \
                   1634:            ${SCRIPTDIR}/${.TARGET:S/^real-/pre-/}; \
1.1       niklas   1635:    fi
1.6       niklas   1636:    @cd ${.CURDIR} && ${MAKE} ${.MAKEFLAGS} ${.TARGET:S/^real-/do-/}
                   1637:    @cd ${.CURDIR} && ${MAKE} ${.MAKEFLAGS} ${.TARGET:S/^real-/post-/}
1.1       niklas   1638:    @if [ -f ${SCRIPTDIR}/${.TARGET:S/^real-/post-/} ]; then \
1.13      imp      1639:        cd ${.CURDIR} && ${SETENV} ${SCRIPTS_ENV} ${SH} \
                   1640:            ${SCRIPTDIR}/${.TARGET:S/^real-/post-/}; \
1.1       niklas   1641:    fi
1.44      marc     1642: .if make(real-install) && (defined(_MANPAGES) || defined(_CATPAGES))
1.9       imp      1643: .if defined(MANCOMPRESSED) && defined(NOMANCOMPRESS)
                   1644:    @${ECHO_MSG} "===>   Uncompressing manual pages for ${PKGNAME}"
1.44      marc     1645: .for manpage in ${_MANPAGES} ${_CATPAGES}
                   1646:    @${GUNZIP_CMD} ${manpage}.gz
1.9       imp      1647: .endfor
                   1648: .elif !defined(MANCOMPRESSED) && !defined(NOMANCOMPRESS)
                   1649:    @${ECHO_MSG} "===>   Compressing manual pages for ${PKGNAME}"
1.44      marc     1650: .for manpage in ${_MANPAGES} ${_CATPAGES}
                   1651:    @if [ -L ${manpage} ]; then \
                   1652:        set - `${FILE} ${manpage}`; \
1.52      espie    1653:        shift `${EXPR} $$# - 1`; \
1.44      marc     1654:        ${LN} -sf $${1}.gz ${manpage}.gz; \
                   1655:        ${RM} ${manpage}; \
                   1656:    else \
                   1657:        ${GZIP_CMD} ${manpage}; \
                   1658:    fi
1.9       imp      1659: .endfor
                   1660: .endif
1.65      marc     1661: .endif
                   1662: .if make(real-install) && exists(${PKGDIR}/MESSAGE)
                   1663:    @${CAT} ${PKGDIR}/MESSAGE
1.9       imp      1664: .endif
                   1665: .if make(real-install) && !defined(NO_PKG_REGISTER)
1.6       niklas   1666:    @cd ${.CURDIR} && ${MAKE} ${.MAKEFLAGS} fake-pkg
1.1       niklas   1667: .endif
1.71      espie    1668: .if make(real-extract)
                   1669:    @${TOUCH} ${TOUCH_FLAGS} ${EXTRACT_COOKIE}
                   1670: .endif
                   1671: .if make(real-patch) && !defined(PATCH_CHECK_ONLY)
                   1672:    @${TOUCH} ${TOUCH_FLAGS} ${PATCH_COOKIE}
                   1673: .endif
                   1674: .if make(real-configure)
                   1675:    @${TOUCH} ${TOUCH_FLAGS} ${CONFIGURE_COOKIE}
                   1676: .endif
                   1677: .if make(real-install)
                   1678:    @${TOUCH} ${TOUCH_FLAGS} ${INSTALL_COOKIE}
                   1679: .endif
                   1680: .if make(real-build)
                   1681:    @${TOUCH} ${TOUCH_FLAGS} ${BUILD_COOKIE}
                   1682: .endif
                   1683: .if make(real-package) && !defined(PACKAGE_NOINSTALL)
                   1684:    @${TOUCH} ${TOUCH_FLAGS} ${PACKAGE_COOKIE}
1.1       niklas   1685: .endif
                   1686:
                   1687: ################################################################
                   1688: # Skeleton targets start here
                   1689: #
                   1690: # You shouldn't have to change these.  Either add the pre-* or
                   1691: # post-* targets/scripts or redefine the do-* targets.  These
                   1692: # targets don't do anything other than checking for cookies and
                   1693: # call the necessary targets/scripts.
                   1694: ################################################################
                   1695:
                   1696: .if !target(fetch)
                   1697: fetch:
1.6       niklas   1698:    @cd ${.CURDIR} && ${MAKE} ${.MAKEFLAGS} real-fetch
1.1       niklas   1699: .endif
1.85      espie    1700: .if !target(fetch-all)
                   1701: fetch-all:
                   1702:    @cd ${.CURDIR} && ${MAKE} ${.MAKEFLAGS} __FETCH_ALL=yes real-fetch
                   1703: .endif
                   1704:
1.1       niklas   1705:
                   1706: .if !target(extract)
1.61      espie    1707: extract: ${EXTRACT_COOKIE}
1.1       niklas   1708: .endif
                   1709:
                   1710: .if !target(patch)
                   1711: patch: extract ${PATCH_COOKIE}
                   1712: .endif
                   1713:
                   1714: .if !target(configure)
                   1715: configure: patch ${CONFIGURE_COOKIE}
                   1716: .endif
                   1717:
                   1718: .if !target(build)
                   1719: build: configure ${BUILD_COOKIE}
                   1720: .endif
                   1721:
                   1722: .if !target(install)
                   1723: install: build ${INSTALL_COOKIE}
                   1724: .endif
                   1725:
                   1726: .if !target(package)
                   1727: package: install ${PACKAGE_COOKIE}
                   1728: .endif
                   1729:
1.61      espie    1730: ${EXTRACT_COOKIE}:
                   1731:    @cd ${.CURDIR} && ${MAKE} ${.MAKEFLAGS} checksum real-extract
1.1       niklas   1732: ${PATCH_COOKIE}:
1.6       niklas   1733:    @cd ${.CURDIR} && ${MAKE} ${.MAKEFLAGS} real-patch
1.1       niklas   1734: ${CONFIGURE_COOKIE}:
1.6       niklas   1735:    @cd ${.CURDIR} && ${MAKE} ${.MAKEFLAGS} real-configure
1.1       niklas   1736: ${BUILD_COOKIE}:
1.6       niklas   1737:    @cd ${.CURDIR} && ${MAKE} ${.MAKEFLAGS} real-build
1.1       niklas   1738: ${INSTALL_COOKIE}:
1.6       niklas   1739:    @cd ${.CURDIR} && ${MAKE} ${.MAKEFLAGS} real-install
1.1       niklas   1740: ${PACKAGE_COOKIE}:
1.6       niklas   1741:    @cd ${.CURDIR} && ${MAKE} ${.MAKEFLAGS} real-package
1.1       niklas   1742:
                   1743: # And call the macros
                   1744:
                   1745: real-fetch: _PORT_USE
                   1746: real-extract: _PORT_USE
                   1747:    @${ECHO_MSG} "===>  Extracting for ${PKGNAME}"
                   1748: real-patch: _PORT_USE
                   1749:    @${ECHO_MSG} "===>  Patching for ${PKGNAME}"
                   1750: real-configure: _PORT_USE
                   1751:    @${ECHO_MSG} "===>  Configuring for ${PKGNAME}"
                   1752: real-build: _PORT_USE
                   1753:    @${ECHO_MSG} "===>  Building for ${PKGNAME}"
                   1754: real-install: _PORT_USE
                   1755:    @${ECHO_MSG} "===>  Installing for ${PKGNAME}"
                   1756: real-package: _PORT_USE
                   1757:
                   1758: # Empty pre-* and post-* targets, note we can't use .if !target()
                   1759: # in the _PORT_USE macro
                   1760:
                   1761: .for name in fetch extract patch configure build install package
                   1762:
                   1763: .if !target(pre-${name})
                   1764: pre-${name}:
                   1765:    @${DO_NADA}
                   1766: .endif
                   1767:
                   1768: .if !target(post-${name})
                   1769: post-${name}:
                   1770:    @${DO_NADA}
                   1771: .endif
                   1772:
                   1773: .endfor
                   1774:
                   1775: # Checkpatch
                   1776: #
                   1777: # Special target to verify patches
1.52      espie    1778:
1.1       niklas   1779: .if !target(checkpatch)
                   1780: checkpatch:
1.6       niklas   1781:    @cd ${.CURDIR} && ${MAKE} PATCH_CHECK_ONLY=yes ${.MAKEFLAGS} patch
1.51      marc     1782: .endif
1.1       niklas   1783:
                   1784: # Reinstall
                   1785: #
                   1786: # Special target to re-run install
                   1787:
                   1788: .if !target(reinstall)
1.13      imp      1789: reinstall:
1.32      marc     1790:    @${RM} -f ${INSTALL_PRE_COOKIE} ${INSTALL_COOKIE} ${PACKAGE_COOKIE}
1.13      imp      1791:    @DEPENDS_TARGET=${DEPENDS_TARGET} ${MAKE} install
1.1       niklas   1792: .endif
                   1793:
1.44      marc     1794: # Deinstall
                   1795: #
                   1796: # Special target to remove installation
                   1797:
                   1798: .if !target(deinstall)
                   1799: uninstall deinstall:
                   1800:    @${ECHO_MSG} "===> Deinstalling for ${PKGNAME}"
1.52      espie    1801:    @${PKG_DELETE} -f ${PKGNAME}
1.44      marc     1802:    @${RM} -f ${INSTALL_COOKIE} ${PACKAGE_COOKIE}
                   1803: .endif
                   1804:
                   1805:
1.1       niklas   1806: ################################################################
                   1807: # Some more targets supplied for users' convenience
                   1808: ################################################################
                   1809:
                   1810: # Cleaning up
                   1811:
                   1812: .if !target(pre-clean)
                   1813: pre-clean:
                   1814:    @${DO_NADA}
                   1815: .endif
                   1816:
                   1817: .if !target(clean)
                   1818: clean: pre-clean
1.9       imp      1819: .if !defined(NOCLEANDEPENDS)
                   1820:    @${MAKE} clean-depends
                   1821: .endif
1.1       niklas   1822:    @${ECHO_MSG} "===>  Cleaning for ${PKGNAME}"
1.6       niklas   1823: .if !defined(NO_WRKDIR)
1.44      marc     1824: .if  defined(WRKOBJDIR)
                   1825:    @${RM} -rf ${WRKOBJDIR}/${PORTSUBDIR}
                   1826:    @${RM} -f ${WRKDIR}
                   1827: .else
1.9       imp      1828:    @if [ -d ${WRKDIR} ]; then \
                   1829:        if [ -w ${WRKDIR} ]; then \
                   1830:            ${RM} -rf ${WRKDIR}; \
                   1831:        else \
                   1832:            ${ECHO_MSG} "===>   ${WRKDIR} not writable, skipping"; \
                   1833:        fi; \
                   1834:    fi
1.44      marc     1835: .endif
1.6       niklas   1836: .else
1.84      marc     1837:    @${RM} -f ${WRKDIR}/.*_started ${WRKDIR}/.*_done
1.1       niklas   1838: .endif
                   1839: .endif
                   1840:
1.9       imp      1841: .if !target(pre-distclean)
                   1842: pre-distclean:
                   1843:    @${DO_NADA}
                   1844: .endif
                   1845:
                   1846: .if !target(distclean)
                   1847: distclean: pre-distclean clean
                   1848:    @${ECHO_MSG} "===>  Dist cleaning for ${PKGNAME}"
1.13      imp      1849:    @(if [ -d ${_DISTDIR} ]; then \
                   1850:        cd ${_DISTDIR}; \
                   1851:        ${RM} -f ${DISTFILES} ${PATCHFILES}; \
                   1852:    fi)
1.9       imp      1853: .if defined(DIST_SUBDIR)
1.13      imp      1854:    -@${RMDIR} ${_DISTDIR}
1.9       imp      1855: .endif
                   1856: .endif
                   1857:
1.1       niklas   1858: # Prints out a list of files to fetch (useful to do a batch fetch)
                   1859:
1.44      marc     1860: # are we called from bsd.port.subdir.mk (i.e. do we scan all dirs anyways)? XXX
                   1861: .ifdef(DIRPRFX)
                   1862: RECURSIVE_FETCH_LIST?= NO
                   1863: .else
                   1864: RECURSIVE_FETCH_LIST?= YES
                   1865: .endif
                   1866:
1.1       niklas   1867: .if !target(fetch-list)
                   1868: fetch-list:
1.44      marc     1869:    @${MAKE} fetch-list-recursive RECURSIVE_FETCH_LIST=${RECURSIVE_FETCH_LIST} | sort -u
                   1870: .endif # !target(fetch-list)
                   1871:
                   1872: .if !target(fetch-list-recursive)
                   1873: fetch-list-recursive:
                   1874:    @${MAKE} fetch-list-one-pkg
                   1875: .if ${RECURSIVE_FETCH_LIST} != "NO"
                   1876:    @for dir in `${ECHO} ${FETCH_DEPENDS} ${BUILD_DEPENDS} ${LIB_DEPENDS}  ${RUN_DEPENDS} | ${TR} '\040' '\012' | ${SED} -e 's/^[^:]*://' -e 's/:.*//' | sort -u` `${ECHO} ${DEPENDS} | ${TR} '\040' '\012' | ${SED} -e 's/:.*//' | sort -u`; do \
                   1877:        (cd $$dir; ${MAKE} fetch-list-recursive; ); \
                   1878:    done
                   1879: .endif # ${RECURSIVE_FETCH_LIST} != "NO"
                   1880: .endif # !target(fetch-list-recursive)
                   1881:
                   1882: .if !target(fetch-list-one-pkg)
                   1883: fetch-list-one-pkg:
1.9       imp      1884:    @${MKDIR} ${_DISTDIR}
1.44      marc     1885:    @[ -z "${_DISTDIR}" ] || ${ECHO} "${MKDIR} ${_DISTDIR}"
1.9       imp      1886:    @(cd ${_DISTDIR}; \
1.1       niklas   1887:     for file in ${DISTFILES}; do \
                   1888:        if [ ! -f $$file -a ! -f `${BASENAME} $$file` ]; then \
1.44      marc     1889:            ${ECHO} -n "cd ${_DISTDIR} && [ -f $$file -o -f `${BASENAME} $$file` ] || " ; \
                   1890:            for site in ${MASTER_SITES} ; do \
                   1891:                ${ECHO} -n ${FETCH_CMD} ${FETCH_BEFORE_ARGS} $${site}$${file} "${FETCH_AFTER_ARGS}" '|| ' ; \
1.1       niklas   1892:            done; \
                   1893:            ${ECHO} "echo $${file} not fetched" ; \
                   1894:        fi \
                   1895:    done)
                   1896: .if defined(PATCHFILES)
1.9       imp      1897:    @(cd ${_DISTDIR}; \
1.1       niklas   1898:     for file in ${PATCHFILES}; do \
                   1899:        if [ ! -f $$file -a ! -f `${BASENAME} $$file` ]; then \
1.44      marc     1900:            ${ECHO} -n "cd ${_DISTDIR} && [ -f $$file -o -f `${BASENAME} $$file` ] || " ; \
1.1       niklas   1901:            for site in ${PATCH_SITES}; do \
1.44      marc     1902:                ${ECHO} -n ${FETCH_CMD} ${FETCH_BEFORE_ARGS} $${site}$${file} "${FETCH_AFTER_ARGS}" '|| ' ; \
1.1       niklas   1903:            done; \
                   1904:            ${ECHO} "echo $${file} not fetched" ; \
                   1905:        fi \
1.44      marc     1906:    done)
                   1907: .endif # defined(PATCHFILES)
                   1908: .endif # !target(fetch-list-one-pkg)
1.1       niklas   1909:
                   1910: # Checksumming utilities
                   1911:
                   1912: .if !target(makesum)
1.85      espie    1913: makesum: fetch-all
1.9       imp      1914:    @${MKDIR} ${FILESDIR}
1.75      espie    1915:    @if [ -f ${CHECKSUM_FILE} ]; then ${RM} -f ${CHECKSUM_FILE}; fi
1.1       niklas   1916:    @(cd ${DISTDIR}; \
1.9       imp      1917:     for file in ${_CKSUMFILES}; do \
1.75      espie    1918:        for cipher in ${CIPHERS:R}; do \
                   1919:            $$cipher $$file >> ${CHECKSUM_FILE}; \
                   1920:        done; \
1.1       niklas   1921:     done)
1.9       imp      1922:    @for file in ${_IGNOREFILES}; do \
1.75      espie    1923:        ${ECHO} "MD5 ($$file) = IGNORE" >> ${CHECKSUM_FILE}; \
1.9       imp      1924:    done
1.85      espie    1925:    @sort -u -o ${CHECKSUM_FILE} ${CHECKSUM_FILE}
1.50      espie    1926: .endif
                   1927:
                   1928: .if !target(addsum)
1.85      espie    1929: addsum: fetch-all
1.50      espie    1930:    @${MKDIR} ${FILESDIR}
1.75      espie    1931:    @touch ${CHECKSUM_FILE}
1.50      espie    1932:    @(cd ${DISTDIR}; \
                   1933:     for file in ${_CKSUMFILES}; do \
1.75      espie    1934:        for cipher in ${CIPHERS:R}; do \
                   1935:            $$cipher $$file >> ${CHECKSUM_FILE}; \
                   1936:        done; \
1.50      espie    1937:     done)
                   1938:    @for file in ${_IGNOREFILES}; do \
1.75      espie    1939:        ${ECHO} "MD5 ($$file) = IGNORE" >> ${CHECKSUM_FILE}; \
1.50      espie    1940:    done
1.85      espie    1941:    @sort -u -o ${CHECKSUM_FILE} ${CHECKSUM_FILE}
1.75      espie    1942:    @if [ `${SED} -e 's/\=.*$$//' ${CHECKSUM_FILE} | uniq -d | wc -l` -ne 0 ]; then \
                   1943:        ${ECHO} "Inconsistent checksum in ${CHECKSUM_FILE}"; \
1.76      espie    1944:        ${FALSE}; \
1.50      espie    1945:    else \
1.75      espie    1946:        ${ECHO} "${CHECKSUM_FILE} updated okay, don't forget to remove cruft"; \
1.50      espie    1947:    fi
1.1       niklas   1948: .endif
                   1949:
                   1950: .if !target(checksum)
                   1951: checksum: fetch
1.75      espie    1952:    @if [ ! -f ${CHECKSUM_FILE} ]; then \
                   1953:        ${ECHO_MSG} ">> No checksum file."; \
1.1       niklas   1954:    else \
1.9       imp      1955:        (cd ${DISTDIR}; OK="true"; \
                   1956:          for file in ${_CKSUMFILES}; do \
1.75      espie    1957:            for cipher_sig in ${PREFERRED_CIPHERS}; do \
                   1958:                sig=`${EXPR} $$cipher_sig : '.*\.\(.*\)'`; \
                   1959:                CKSUM2=`${GREP} "^$$sig ($$file)" ${CHECKSUM_FILE} | ${AWK} '{print $$4}'`; \
                   1960:                if [ "$$CKSUM2" = "" ]; then \
                   1961:                    ${ECHO_MSG} ">> No $$sig checksum recorded for $$file."; \
                   1962:                else \
                   1963:                    cipher=`${EXPR} $$cipher_sig : '\(.*\)\.'`; \
                   1964:                    break; \
                   1965:                fi; \
                   1966:            done; \
1.1       niklas   1967:            if [ "$$CKSUM2" = "" ]; then \
1.9       imp      1968:                ${ECHO_MSG} ">> No checksum recorded for $$file."; \
                   1969:                OK="false"; \
                   1970:            elif [ "$$CKSUM2" = "IGNORE" ]; then \
                   1971:                ${ECHO_MSG} ">> Checksum for $$file is set to IGNORE in md5 file even though"; \
                   1972:                ${ECHO_MSG} "   the file is not in the "'$$'"{IGNOREFILES} list."; \
1.1       niklas   1973:                OK="false"; \
1.13      imp      1974:            else \
1.75      espie    1975:                CKSUM=`$$cipher < $$file`; \
                   1976:                if [ "$$CKSUM" = "$$CKSUM2" ]; then \
                   1977:                    ${ECHO_MSG} ">> Checksum OK for $$file. ($$sig)"; \
                   1978:                else \
                   1979:                    ${ECHO_MSG} ">> Checksum mismatch for $$file. ($$sig)"; \
                   1980:                    OK="false"; \
                   1981:                fi; \
1.1       niklas   1982:            fi; \
                   1983:          done; \
1.9       imp      1984:          for file in ${_IGNOREFILES}; do \
1.75      espie    1985:            CKSUM2=`${GREP} "($$file)" ${CHECKSUM_FILE} | ${AWK} '{print $$4}'`; \
1.9       imp      1986:            if [ "$$CKSUM2" = "" ]; then \
                   1987:                ${ECHO_MSG} ">> No checksum recorded for $$file, file is in "'$$'"{IGNOREFILES} list."; \
                   1988:                OK="false"; \
                   1989:            elif [ "$$CKSUM2" != "IGNORE" ]; then \
                   1990:                ${ECHO_MSG} ">> Checksum for $$file is not set to IGNORE in md5 file even though"; \
                   1991:                ${ECHO_MSG} "   the file is in the "'$$'"{IGNOREFILES} list."; \
                   1992:                OK="false"; \
                   1993:            fi; \
                   1994:          done; \
1.13      imp      1995:          if [ "$$OK" != "true" ]; then \
1.75      espie    1996:            ${ECHO_MSG} "Make sure the Makefile and checksum file (${CHECKSUM_FILE})"; \
1.13      imp      1997:            ${ECHO_MSG} "are up to date.  If you want to override this check, type"; \
                   1998:            ${ECHO_MSG} "\"make NO_CHECKSUM=yes [other args]\"."; \
                   1999:            exit 1; \
1.1       niklas   2000:          fi) ; \
                   2001:    fi
1.32      marc     2002: .endif
                   2003:
                   2004: # packing list utilities.  This generates a packing list from a recently
                   2005: # installed port.  Not perfect, but pretty close.  The generated file
                   2006: # will have to have some tweaks done by hand.
1.35      marc     2007: # Note: add @comment PACKAGE(arch=${ARCH}, opsys=${OPSYS}, vers=${OPSYS_VER})
                   2008: # when port is installed or package created.
1.32      marc     2009: #
                   2010: .if !target(plist)
                   2011: plist: install
                   2012:    @${MKDIR} ${PKGDIR}
                   2013:    @(dirs=""; \
                   2014:      ld=""; \
1.87      espie    2015:      for f in `${FIND} ${PREFIX} -newer ${INSTALL_PRE_COOKIE} -print 2> /dev/null`; do \
1.32      marc     2016:       ff=`${ECHO} $$f | ${SED} -e 's|^${PREFIX}/||'`; \
1.53      form     2017:       if [ -d $$f -a ! -h $$f ]; then dirs="$$ff $$dirs"; \
1.32      marc     2018:       else \
                   2019:        ${ECHO} $$ff; \
1.45      marc     2020:        if ${ECHO} $$f | ${GREP} -E -q -e '[^/]+\.so\.[0-9]+\.[0-9]+$$'; then \
1.32      marc     2021:         ld="$$LDCONFIG `${DIRNAME} $$f`"; \
                   2022:        fi; \
                   2023:       fi; \
                   2024:      done; \
                   2025:      for f in $$dirs; do \
                   2026:        if ${GREP} -q -e `${BASENAME} $$f` ${MTREE_FILE}; then \
                   2027:         :; \
                   2028:        else \
                   2029:         ${ECHO} "@dirrm $$f"; \
                   2030:        fi; \
                   2031:       done; \
                   2032:      for f in $$ld; do ${ECHO} "@exec ${LDCONFIG} -m $$f"; done; \
                   2033:    ) > ${PLIST}-auto
1.1       niklas   2034: .endif
                   2035:
                   2036: ################################################################
                   2037: # The special package-building targets
                   2038: # You probably won't need to touch these
                   2039: ################################################################
                   2040:
1.44      marc     2041:
1.88      espie    2042: # The README.html target needs full information (this is passed via
                   2043: # depends-list and package-depends)
                   2044: .ifndef FULL_PACKAGE_NAME
                   2045: FULL_PACKAGE_NAME=NO
                   2046: .endif
1.44      marc     2047:
                   2048:
1.1       niklas   2049: # Nobody should want to override this unless PKGNAME is simply bogus.
                   2050:
                   2051: .if !target(package-name)
                   2052: package-name:
1.88      espie    2053: .if (${FULL_PACKAGE_NAME} == "YES")
                   2054:    @${ECHO} `${MAKE} package-path`/${PKGNAME}
1.44      marc     2055: .else
                   2056:    @${ECHO} '${PKGNAME}'
1.88      espie    2057: .endif
                   2058: .endif
1.44      marc     2059:
                   2060: .if !target(package-path)
                   2061: package-path:
                   2062:    @pwd | sed s@`cd ${PORTSDIR} ; pwd`/@@g
1.1       niklas   2063: .endif
                   2064:
1.88      espie    2065: # Build (recursively) a list of package dependencies suitable for tsort
1.1       niklas   2066:
                   2067: .if !target(package-depends)
                   2068: package-depends:
1.13      imp      2069:    @for dir in `${ECHO} ${LIB_DEPENDS} ${RUN_DEPENDS} | ${TR} '\040' '\012' | ${SED} -e 's/^[^:]*://' -e 's/:.*//' | sort -u` `${ECHO} ${DEPENDS} | ${TR} '\040' '\012' | ${SED} -e 's/:.*//' | sort -u`; do \
                   2070:        if [ -d $$dir ]; then \
1.88      espie    2071:            ${MAKE} ECHO='${ECHO} -n' package-name FULL_PACKAGE_NAME=${FULL_PACKAGE_NAME}; \
                   2072:            ${ECHO} -n " "; \
                   2073:            (cd $$dir ; ${MAKE} package-name package-depends FULL_PACKAGE_NAME=${FULL_PACKAGE_NAME}); \
1.13      imp      2074:        else \
                   2075:            ${ECHO_MSG} "Warning: \"$$dir\" non-existent -- @pkgdep registration incomplete" >&2; \
                   2076:        fi; \
1.1       niklas   2077:    done
                   2078: .endif
                   2079:
                   2080: # Build a package but don't check the package cookie
                   2081:
                   2082: .if !target(repackage)
                   2083: repackage: pre-repackage package
                   2084:
                   2085: pre-repackage:
                   2086:    @${RM} -f ${PACKAGE_COOKIE}
                   2087: .endif
                   2088:
                   2089: # Build a package but don't check the cookie for installation, also don't
                   2090: # install package cookie
                   2091:
                   2092: .if !target(package-noinstall)
                   2093: package-noinstall:
1.6       niklas   2094:    @cd ${.CURDIR} && ${MAKE} ${.MAKEFLAGS} PACKAGE_NOINSTALL=yes real-package
1.1       niklas   2095: .endif
                   2096:
                   2097: ################################################################
                   2098: # Dependency checking
                   2099: ################################################################
                   2100:
                   2101: .if !target(depends)
                   2102: depends: lib-depends misc-depends
1.6       niklas   2103:    @cd ${.CURDIR} && ${MAKE} ${.MAKEFLAGS} fetch-depends
                   2104:    @cd ${.CURDIR} && ${MAKE} ${.MAKEFLAGS} build-depends
                   2105:    @cd ${.CURDIR} && ${MAKE} ${.MAKEFLAGS} run-depends
1.1       niklas   2106:
                   2107: .if make(fetch-depends)
                   2108: DEPENDS_TMP+=  ${FETCH_DEPENDS}
                   2109: .endif
                   2110:
                   2111: .if make(build-depends)
                   2112: DEPENDS_TMP+=  ${BUILD_DEPENDS}
                   2113: .endif
                   2114:
                   2115: .if make(run-depends)
                   2116: DEPENDS_TMP+=  ${RUN_DEPENDS}
                   2117: .endif
                   2118:
                   2119: _DEPENDS_USE:  .USE
                   2120: .if defined(DEPENDS_TMP)
1.13      imp      2121: .if !defined(NO_DEPENDS)
1.52      espie    2122:    @PATH=${PORTPATH}; \
                   2123:    for i in ${DEPENDS_TMP}; do \
1.1       niklas   2124:        prog=`${ECHO} $$i | ${SED} -e 's/:.*//'`; \
1.13      imp      2125:        dir=`${ECHO} $$i | ${SED} -e 's/[^:]*://'`; \
1.52      espie    2126:        if ${EXPR} "$$dir" : '.*:' > /dev/null; then \
1.13      imp      2127:            target=`${ECHO} $$dir | ${SED} -e 's/.*://'`; \
                   2128:            dir=`${ECHO} $$dir | ${SED} -e 's/:.*//'`; \
1.1       niklas   2129:        else \
1.13      imp      2130:            target=${DEPENDS_TARGET}; \
1.1       niklas   2131:        fi; \
1.44      marc     2132:        found=not; \
1.52      espie    2133:        if ${EXPR} "$$prog" : \\/ >/dev/null; then \
1.1       niklas   2134:            if [ -e "$$prog" ]; then \
                   2135:                ${ECHO_MSG} "===>  ${PKGNAME} depends on file: $$prog - found"; \
1.44      marc     2136:                found=""; \
1.1       niklas   2137:            else \
                   2138:                ${ECHO_MSG} "===>  ${PKGNAME} depends on file: $$prog - not found"; \
                   2139:            fi; \
                   2140:        else \
1.44      marc     2141:            for d in `echo $$PATH | tr ':' ' '`; do \
                   2142:                if [ -x $$d/$$prog ]; then \
                   2143:                    found="$$d/$$prog"; \
                   2144:                    break; \
                   2145:                fi \
                   2146:            done; \
                   2147:            ${ECHO_MSG} "===>  ${PKGNAME} depends on executable: $$prog - $$found found"; \
1.1       niklas   2148:        fi; \
1.44      marc     2149:        if [ X"$$found" = Xnot ]; then \
1.13      imp      2150:            ${ECHO_MSG} "===>  Verifying $$target for $$prog in $$dir"; \
1.1       niklas   2151:            if [ ! -d "$$dir" ]; then \
                   2152:                ${ECHO_MSG} ">> No directory for $$prog.  Skipping.."; \
                   2153:            else \
1.13      imp      2154:                (cd $$dir; ${MAKE} ${.MAKEFLAGS} $$target) ; \
1.1       niklas   2155:                ${ECHO_MSG} "===>  Returning to build of ${PKGNAME}"; \
                   2156:            fi; \
                   2157:        fi; \
                   2158:    done
                   2159: .endif
                   2160: .else
                   2161:    @${DO_NADA}
                   2162: .endif
                   2163:
                   2164: fetch-depends: _DEPENDS_USE
                   2165: build-depends: _DEPENDS_USE
                   2166: run-depends:   _DEPENDS_USE
                   2167:
                   2168: lib-depends:
                   2169: .if defined(LIB_DEPENDS)
1.13      imp      2170: .if !defined(NO_DEPENDS)
1.64      marc     2171: .if defined(NO_SHARED_LIBS)
1.16      niklas   2172:    @for i in ${LIB_DEPENDS}; do \
1.83      marc     2173:        lib=`${ECHO} $$i | ${SED} -e 's/:.*//' -e 's|\([^\\]\)[\\\.].*|\1|'`; \
1.16      niklas   2174:        dir=`${ECHO} $$i | ${SED} -e 's/[^:]*://'`; \
1.52      espie    2175:        if ${EXPR} "$$dir" : '.*:' > /dev/null; then \
1.16      niklas   2176:            target=`${ECHO} $$dir | ${SED} -e 's/.*://'`; \
                   2177:            dir=`${ECHO} $$dir | ${SED} -e 's/:.*//'`; \
                   2178:        else \
                   2179:            target=${DEPENDS_TARGET}; \
                   2180:        fi; \
1.17      niklas   2181:        tmp=`mktemp /tmp/bpmXXXXXXXXXX`; \
1.42      marc     2182:        if ${LD} -r -o $$tmp -L${LOCALBASE}/lib -L${X11BASE}/lib -l$$lib; then \
1.16      niklas   2183:            ${ECHO_MSG} "===>  ${PKGNAME} depends on library: $$lib - found"; \
                   2184:        else \
                   2185:            ${ECHO_MSG} "===>  ${PKGNAME} depends on library: $$lib - not found"; \
                   2186:            ${ECHO_MSG} "===>  Verifying $$target for $$lib in $$dir"; \
                   2187:            if [ ! -d "$$dir" ]; then \
                   2188:                ${ECHO_MSG} ">> No directory for $$lib.  Skipping.."; \
                   2189:            else \
                   2190:                (cd $$dir; ${MAKE} ${.MAKEFLAGS} $$target) ; \
                   2191:                ${ECHO_MSG} "===>  Returning to build of ${PKGNAME}"; \
                   2192:            fi; \
                   2193:        fi; \
1.17      niklas   2194:        ${RM} -f $$tmp; \
1.16      niklas   2195:    done
                   2196: .else
1.1       niklas   2197:    @for i in ${LIB_DEPENDS}; do \
1.44      marc     2198:        lib=`${ECHO} $$i | ${SED} -e 's/:.*//' -e 's|\([^\\]\)\.|\1\\\\.|g'`; \
1.13      imp      2199:        dir=`${ECHO} $$i | ${SED} -e 's/[^:]*://'`; \
1.52      espie    2200:        if ${EXPR} "$$dir" : '.*:' > /dev/null; then \
1.13      imp      2201:            target=`${ECHO} $$dir | ${SED} -e 's/.*://'`; \
                   2202:            dir=`${ECHO} $$dir | ${SED} -e 's/:.*//'`; \
                   2203:        else \
                   2204:            target=${DEPENDS_TARGET}; \
                   2205:        fi; \
1.44      marc     2206:        libname=`${ECHO} $$lib | ${SED} -e 's|\\\\||g'`; \
                   2207:        reallib=`${LDCONFIG} -r | ${GREP} -e "-l$$lib" | awk '{ print $$3 }'`; \
                   2208:        if [ "X$$reallib" = X"" ]; then \
                   2209:            ${ECHO_MSG} "===>  ${PKGNAME} depends on shared library: $$libname - not found"; \
                   2210:            ${ECHO_MSG} "===>  Verifying $$target for $$libname in $$dir"; \
1.1       niklas   2211:            if [ ! -d "$$dir" ]; then \
1.44      marc     2212:                ${ECHO_MSG} ">> No directory for $$libname.  Skipping.."; \
1.1       niklas   2213:            else \
1.13      imp      2214:                (cd $$dir; ${MAKE} ${.MAKEFLAGS} $$target) ; \
1.1       niklas   2215:                ${ECHO_MSG} "===>  Returning to build of ${PKGNAME}"; \
                   2216:            fi; \
1.44      marc     2217:        else \
                   2218:            ${ECHO_MSG} "===>  ${PKGNAME} depends on shared library: $$libname - $$reallib found"; \
1.1       niklas   2219:        fi; \
                   2220:    done
1.16      niklas   2221: .endif
1.1       niklas   2222: .endif
                   2223: .else
                   2224:    @${DO_NADA}
                   2225: .endif
                   2226:
                   2227: misc-depends:
                   2228: .if defined(DEPENDS)
                   2229: .if !defined(NO_DEPENDS)
1.13      imp      2230:    @for dir in ${DEPENDS}; do \
1.52      espie    2231:        if ${EXPR} "$$dir" : '.*:' > /dev/null; then \
1.13      imp      2232:            target=`${ECHO} $$dir | ${SED} -e 's/.*://'`; \
                   2233:            dir=`${ECHO} $$dir | ${SED} -e 's/:.*//'`; \
                   2234:        else \
                   2235:            target=${DEPENDS_TARGET}; \
                   2236:        fi; \
                   2237:        ${ECHO_MSG} "===>  ${PKGNAME} depends on: $$dir"; \
                   2238:        ${ECHO_MSG} "===>  Verifying $$target for $$dir"; \
                   2239:        if [ ! -d $$dir ]; then \
                   2240:            ${ECHO_MSG} ">> No directory for $$dir.  Skipping.."; \
1.1       niklas   2241:        else \
1.13      imp      2242:            (cd $$dir; ${MAKE} ${.MAKEFLAGS} $$target) ; \
1.1       niklas   2243:        fi \
                   2244:    done
                   2245:    @${ECHO_MSG} "===>  Returning to build of ${PKGNAME}"
                   2246: .endif
                   2247: .else
                   2248:    @${DO_NADA}
                   2249: .endif
                   2250:
                   2251: .endif
                   2252:
1.9       imp      2253: .if !target(clean-depends)
                   2254: clean-depends:
                   2255: .if defined(FETCH_DEPENDS) || defined(BUILD_DEPENDS) || defined(LIB_DEPENDS) \
                   2256:    || defined(RUN_DEPENDS)
1.13      imp      2257:    @for dir in `${ECHO} ${FETCH_DEPENDS} ${BUILD_DEPENDS} ${LIB_DEPENDS} ${RUN_DEPENDS} | ${TR} '\040' '\012' | ${SED} -e 's/^[^:]*://' -e 's/:.*//' | sort -u`; do \
                   2258:        if [ -d $$dir ] ; then \
                   2259:            (cd $$dir; ${MAKE} NOCLEANDEPENDS=yes clean clean-depends); \
                   2260:        fi \
1.9       imp      2261:    done
                   2262: .endif
                   2263: .if defined(DEPENDS)
1.13      imp      2264:    @for dir in `${ECHO} ${DEPENDS} | ${TR} '\040' '\012' | ${SED} -e 's/:.*//' | sort -u`; do \
                   2265:        if [ -d $$dir ] ; then \
                   2266:            (cd $$dir; ${MAKE} NOCLEANDEPENDS=yes clean clean-depends); \
                   2267:        fi \
1.9       imp      2268:    done
                   2269: .endif
                   2270: .endif
                   2271:
1.1       niklas   2272: .if !target(depends-list)
                   2273: depends-list:
1.13      imp      2274:    @for dir in `${ECHO} ${FETCH_DEPENDS} ${BUILD_DEPENDS} ${LIB_DEPENDS} | ${TR} '\040' '\012' | ${SED} -e 's/^[^:]*://' -e 's/:.*//' | sort -u` `${ECHO} ${DEPENDS} | ${TR} '\040' '\012' | ${SED} -e 's/:.*//' | sort -u`; do \
1.88      espie    2275:        if [ -d $$dir ]; then \
                   2276:            ${MAKE} ECHO='${ECHO} -n' package-name FULL_PACKAGE_NAME=${FULL_PACKAGE_NAME}; \
                   2277:            ${ECHO} -n " "; \
                   2278:            (cd $$dir ; ${MAKE} package-name depends-list FULL_PACKAGE_NAME=${FULL_PACKAGE_NAME}); \
                   2279:        else \
                   2280:            ${ECHO_MSG} "Warning: \"$$dir\" non-existent" >&2; \
                   2281:        fi; \
1.1       niklas   2282:    done
                   2283: .endif
                   2284:
                   2285: ################################################################
                   2286: # Everything after here are internal targets and really
                   2287: # shouldn't be touched by anybody but the release engineers.
                   2288: ################################################################
                   2289:
                   2290: # This target generates an index entry suitable for aggregation into
                   2291: # a large index.  Format is:
                   2292: #
                   2293: # distribution-name|port-path|installation-prefix|comment| \
1.44      marc     2294: #  description-file|maintainer|categories|build deps|run deps|for arch
1.1       niklas   2295: #
                   2296: .if !target(describe)
                   2297: describe:
1.13      imp      2298:    @${ECHO} -n "${PKGNAME}|${.CURDIR}|"; \
                   2299:    ${ECHO} -n "${PREFIX}|"; \
                   2300:    if [ -f ${COMMENT} ]; then \
                   2301:        ${ECHO} -n "`${CAT} ${COMMENT}`"; \
1.1       niklas   2302:    else \
                   2303:        ${ECHO} -n "** No Description"; \
1.13      imp      2304:    fi; \
                   2305:    if [ -f ${DESCR} ]; then \
                   2306:        ${ECHO} -n "|${DESCR}"; \
1.1       niklas   2307:    else \
                   2308:        ${ECHO} -n "|/dev/null"; \
1.13      imp      2309:    fi; \
                   2310:    ${ECHO} -n "|${MAINTAINER}|${CATEGORIES}|"; \
                   2311:    case "A${FETCH_DEPENDS}B${BUILD_DEPENDS}C${LIB_DEPENDS}D${DEPENDS}E" in \
                   2312:        ABCDE) ;; \
1.88      espie    2313:        *) cd ${.CURDIR} && ${ECHO} -n `make depends-list|${SORT_DEPENDS}`;; \
1.13      imp      2314:    esac; \
                   2315:    ${ECHO} -n "|"; \
                   2316:    case "A${RUN_DEPENDS}B${LIB_DEPENDS}C${DEPENDS}D" in \
                   2317:        ABCD) ;; \
1.88      espie    2318:        *) cd ${.CURDIR} && ${ECHO} -n `make package-depends|${SORT_DEPENDS}`;; \
1.13      imp      2319:    esac; \
1.44      marc     2320:    ${ECHO} -n "|"; \
                   2321:    if [ "${ONLY_FOR_ARCHS}" = "" ]; then \
                   2322:        ${ECHO} -n "any"; \
                   2323:    else \
                   2324:        ${ECHO} -n "${ONLY_FOR_ARCHS}"; \
                   2325:    fi; \
1.13      imp      2326:    ${ECHO} ""
1.1       niklas   2327: .endif
                   2328:
1.88      espie    2329: README_NAME?=  ${TEMPLATES}/README.port
                   2330:
1.1       niklas   2331: .if !target(readmes)
                   2332: readmes:   readme
                   2333: .endif
                   2334:
                   2335: .if !target(readme)
                   2336: readme:
                   2337:    @rm -f README.html
1.88      espie    2338:    @cd ${.CURDIR} && make README_NAME=${README_NAME} README.html
1.1       niklas   2339: .endif
                   2340:
1.88      espie    2341:
                   2342: HTMLIFY=   ${SED} -e 's/&/\&amp;/g' -e 's/>/\&gt;/g' -e 's/</\&lt;/g'
                   2343:
                   2344: .if make(README.html) || make(readme) || make(readmes)
                   2345: PKGDEPTH!=${MAKE} package-path|${SED} -e 's|[^./][^/]*|..|g'
                   2346: .endif
1.44      marc     2347:
1.1       niklas   2348: README.html:
                   2349:    @${ECHO_MSG} "===>  Creating README.html for ${PKGNAME}"
1.88      espie    2350:    @${ECHO} ${PKGNAME} | ${HTMLIFY} > $@.tmp3
                   2351:    @${MAKE} depends-list FULL_PACKAGE_NAME=YES | ${SORT_DEPENDS}>$@.tmp1
                   2352:    @${MAKE} package-depends FULL_PACKAGE_NAME=YES | ${SORT_DEPENDS} >$@.tmp2
                   2353: .for I in 1 2
                   2354:    @if [ -s $@.tmp$I ]; then \
                   2355:        (${CAT} $@.tmp$I | while read n; do \
                   2356:            j=`dirname $$n|${HTMLIFY}`; k=`basename $$n|${HTMLIFY}`; \
                   2357:            echo "<A HREF=\"${PKGDEPTH}/$$j/README.html\">$$k</A>"; \
                   2358:         done;) >$@.tmp$Ia; \
                   2359:     else \
                   2360:     echo "(none)" > $@.tmp$Ia; \
                   2361:    fi
                   2362: .endfor
1.44      marc     2363:    @${CAT} ${README_NAME} | \
                   2364:        ${SED} -e 's|%%PORT%%|'"`${MAKE} package-path | ${HTMLIFY}`"'|g' \
                   2365:            -e '/%%PKG%%/r$@.tmp3' \
                   2366:            -e '/%%PKG%%/d' \
1.1       niklas   2367:            -e '/%%COMMENT%%/r${PKGDIR}/COMMENT' \
                   2368:            -e '/%%COMMENT%%/d' \
1.88      espie    2369:            -e '/%%BUILD_DEPENDS%%/r$@.tmp1a' \
1.44      marc     2370:            -e '/%%BUILD_DEPENDS%%/d' \
1.88      espie    2371:            -e '/%%RUN_DEPENDS%%/r$@.tmp2a' \
1.44      marc     2372:            -e '/%%RUN_DEPENDS%%/d' \
1.1       niklas   2373:        >> $@
1.88      espie    2374:    @rm -f $@.tmp*
1.1       niklas   2375:
                   2376: .if !target(print-depends-list)
                   2377: print-depends-list:
                   2378: .if defined(FETCH_DEPENDS) || defined(BUILD_DEPENDS) || \
                   2379:    defined(LIB_DEPENDS) || defined(DEPENDS)
                   2380:    @${ECHO} -n 'This port requires package(s) "'
1.88      espie    2381:    @${ECHO} -n `make FULL_PACKAGE_NAME=${FULL_PACKAGE_NAME} depends-list | ${SORT_DEPENDS}`
1.1       niklas   2382:    @${ECHO} '" to build.'
                   2383: .endif
                   2384: .endif
                   2385:
                   2386: .if !target(print-package-depends)
                   2387: print-package-depends:
                   2388: .if defined(RUN_DEPENDS) || defined(LIB_DEPENDS) || defined(DEPENDS)
                   2389:    @${ECHO} -n 'This port requires package(s) "'
1.88      espie    2390:    @${ECHO} -n `make FULL_PACKAGE_NAME=${FULL_PACKAGE_NAME} package-depends | ${SORT_DEPENDS}`
1.1       niklas   2391:    @${ECHO} '" to run.'
                   2392: .endif
                   2393: .endif
                   2394:
1.88      espie    2395: .if !target(print-depends)
                   2396: print-depends:
                   2397:    @${MAKE} FULL_PACKAGE_NAME=YES print-depends-list print-package-depends
                   2398: .endif
                   2399:
1.1       niklas   2400: # Fake installation of package so that user can pkg_delete it later.
                   2401: # Also, make sure that an installed port is recognized correctly in
                   2402: # accordance to the @pkgdep directive in the packing lists
                   2403:
                   2404: .if !target(fake-pkg)
                   2405: fake-pkg:
1.13      imp      2406:    @if [ ! -f ${PLIST} -o ! -f ${COMMENT} -o ! -f ${DESCR} ]; then ${ECHO} "** Missing package files for ${PKGNAME} - installation not recorded."; exit 1; fi
1.66      marc     2407:    @if [ `/bin/ls -l ${COMMENT} | ${AWK} '{print $$5}'` -gt 60 ]; then \
                   2408:        ${ECHO} "** ${COMMENT} too large - installation not recorded."; \
                   2409:        exit 1; \
                   2410:     fi
1.9       imp      2411:    @if [ ! -d ${PKG_DBDIR} ]; then ${RM} -f ${PKG_DBDIR}; ${MKDIR} ${PKG_DBDIR}; fi
1.1       niklas   2412: .if defined(FORCE_PKG_REGISTER)
                   2413:    @${RM} -rf ${PKG_DBDIR}/${PKGNAME}
                   2414: .endif
                   2415:    @if [ ! -d ${PKG_DBDIR}/${PKGNAME} ]; then \
                   2416:        ${ECHO_MSG} "===>  Registering installation for ${PKGNAME}"; \
1.9       imp      2417:        ${MKDIR} ${PKG_DBDIR}/${PKGNAME}; \
1.1       niklas   2418:        ${PKG_CMD} ${PKG_ARGS} -O ${PKGFILE} > ${PKG_DBDIR}/${PKGNAME}/+CONTENTS; \
1.13      imp      2419:        ${CP} ${DESCR} ${PKG_DBDIR}/${PKGNAME}/+DESC; \
                   2420:        ${CP} ${COMMENT} ${PKG_DBDIR}/${PKGNAME}/+COMMENT; \
1.1       niklas   2421:        if [ -f ${PKGDIR}/INSTALL ]; then \
                   2422:            ${CP} ${PKGDIR}/INSTALL ${PKG_DBDIR}/${PKGNAME}/+INSTALL; \
                   2423:        fi; \
                   2424:        if [ -f ${PKGDIR}/DEINSTALL ]; then \
                   2425:            ${CP} ${PKGDIR}/DEINSTALL ${PKG_DBDIR}/${PKGNAME}/+DEINSTALL; \
                   2426:        fi; \
                   2427:        if [ -f ${PKGDIR}/REQ ]; then \
                   2428:            ${CP} ${PKGDIR}/REQ ${PKG_DBDIR}/${PKGNAME}/+REQ; \
                   2429:        fi; \
1.44      marc     2430:        if [ -f ${PKGDIR}/MESSAGE ]; then \
                   2431:            ${CP} ${PKGDIR}/MESSAGE ${PKG_DBDIR}/${PKGNAME}/+DISPLAY; \
                   2432:        fi; \
1.88      espie    2433:        for dep in `make package-depends ECHO_MSG=${TRUE} | ${SORT_DEPENDS}`; do \
1.13      imp      2434:            if [ -d ${PKG_DBDIR}/$$dep ]; then \
                   2435:                if ! ${GREP} ^${PKGNAME}$$ ${PKG_DBDIR}/$$dep/+REQUIRED_BY \
                   2436:                    >/dev/null 2>&1; then \
                   2437:                    ${ECHO} ${PKGNAME} >> ${PKG_DBDIR}/$$dep/+REQUIRED_BY; \
                   2438:                fi; \
                   2439:            fi; \
                   2440:        done; \
1.1       niklas   2441:    fi
                   2442: .endif
                   2443:
                   2444: # Depend is generally meaningless for arbitrary ports, but if someone wants
                   2445: # one they can override this.  This is just to catch people who've gotten into
                   2446: # the habit of typing `make depend all install' as a matter of course.
                   2447: #
                   2448: .if !target(depend)
                   2449: depend:
                   2450: .endif
                   2451:
                   2452: # Same goes for tags
                   2453: .if !target(tags)
                   2454: tags:
1.10      niklas   2455: .endif
                   2456:
1.68      espie    2457: .PHONY: \
                   2458:    addsum all build build-depends checkpatch \
                   2459:    checksum clean clean-depends configure deinstall \
                   2460:    delete-package delete-package-links depend depends depends-list \
                   2461:    describe distclean do-build do-configure do-extract \
1.82      marc     2462:    do-fetch do-install do-package do-patch extract list-distfiles \
1.68      espie    2463:    fake-pkg fetch fetch-depends fetch-list fetch-list-one-pkg \
                   2464:    fetch-list-recursive install lib-depends makesum mirror-distfiles \
                   2465:    misc-depends package package-depends package-links package-name \
                   2466:    package-noinstall package-path patch plist post-build \
                   2467:    post-configure post-extract post-fetch post-install post-package \
                   2468:    post-patch pre-build pre-clean pre-configure pre-distclean \
                   2469:    pre-extract pre-fetch pre-install pre-package pre-patch \
                   2470:    pre-repackage print-depends-list print-package-depends readme \
                   2471:    readmes real-extract real-fetch real-install reinstall \
1.88      espie    2472:    repackage run-depends tags uninstall fetch-all print-depends