1
0
mirror of https://git.FreeBSD.org/ports.git synced 2025-01-01 05:45:45 +00:00

Add a port of the modern make from FreeBSD 5.x and above.

This commit is contained in:
Shaun Amott 2006-11-23 16:44:44 +00:00
parent e762c47cd6
commit 9fed815c9b
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=177910
6 changed files with 177 additions and 0 deletions

View File

@ -649,6 +649,7 @@
SUBDIR += m68k-rtems-gcc
SUBDIR += m68k-rtems-gdb
SUBDIR += m68k-rtems-objc
SUBDIR += make
SUBDIR += make++
SUBDIR += makedepend
SUBDIR += makeplus

39
devel/make/Makefile Normal file
View File

@ -0,0 +1,39 @@
# New ports collection makefile for: make
# Date Created: 2006-11-23
# Whom: Shaun Amott <shaun@FreeBSD.org>
#
# $FreeBSD$
#
PORTNAME= make
PORTVERSION= 20050524
CATEGORIES= devel sysutils
MASTER_SITES= ${MASTER_SITE_LOCAL}
MASTER_SITE_SUBDIR= shaun
DISTNAME= pmake-${PORTVERSION}
MAINTAINER= shaun@FreeBSD.org
COMMENT= Berkeley make, back-ported to FreeBSD 4.x
WRKSRC= ${WRKDIR}/make
MAN1= make.1
PLIST_FILES= bin/make
.include <bsd.port.pre.mk>
.if ${OSVERSION} >= 500000
IGNORE= is already installed in the base system on FreeBSD 5.x and above
.endif
post-extract:
@${REINPLACE_CMD} -e 's/^\(SRCS= *\)/\1freebsd.o /' ${WRKSRC}/Makefile
@${REINPLACE_CMD} -e 's/<stdint\.h>/"freebsd.h"/' ${WRKSRC}/*.[ch]
@${CP} ${FILESDIR}/freebsd.* ${WRKSRC}
do-install:
${INSTALL_PROGRAM} ${WRKSRC}/make ${PREFIX}/bin
${INSTALL_MAN} ${WRKSRC}/${MAN1} ${MAN1PREFIX}/man/man1
.include <bsd.port.post.mk>

3
devel/make/distinfo Normal file
View File

@ -0,0 +1,3 @@
MD5 (pmake-20050524.tar.gz) = f8d633008736cb48bb3aaaaefea81f68
SHA256 (pmake-20050524.tar.gz) = eaa0ba23d17f149a1fa415036bc64ab86c25ebff1efe9f6575c88706792d4883
SIZE (pmake-20050524.tar.gz) = 210701

117
devel/make/files/freebsd.c Normal file
View File

@ -0,0 +1,117 @@
/*-
* Copyright (c) 1992, 1993
* The Regents of the University of California. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. All advertising materials mentioning features or use of this software
* must display the following acknowledgement:
* This product includes software developed by the University of
* California, Berkeley and its contributors.
* 4. Neither the name of the University nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*/
#include <ctype.h>
#include <errno.h>
#include <stdlib.h>
#include <inttypes.h>
#include <freebsd.h>
/*
* Convert a string to a uintmax_t integer.
*
* Assumes that the upper and lower case
* alphabets and digits are each contiguous.
*/
uintmax_t
strtoumax(const char * __restrict nptr, char ** __restrict endptr, int base)
{
const char *s;
uintmax_t acc;
char c;
uintmax_t cutoff;
int neg, any, cutlim;
/*
* See strtoimax for comments as to the logic used.
*/
s = nptr;
do {
c = *s++;
} while (isspace((unsigned char)c));
if (c == '-') {
neg = 1;
c = *s++;
} else {
neg = 0;
if (c == '+')
c = *s++;
}
if ((base == 0 || base == 16) &&
c == '0' && (*s == 'x' || *s == 'X') &&
((s[1] >= '0' && s[1] <= '9') ||
(s[1] >= 'A' && s[1] <= 'F') ||
(s[1] >= 'a' && s[1] <= 'f'))) {
c = s[1];
s += 2;
base = 16;
}
if (base == 0)
base = c == '0' ? 8 : 10;
acc = any = 0;
if (base < 2 || base > 36)
goto noconv;
cutoff = UINTMAX_MAX / base;
cutlim = UINTMAX_MAX % base;
for ( ; ; c = *s++) {
if (c >= '0' && c <= '9')
c -= '0';
else if (c >= 'A' && c <= 'Z')
c -= 'A' - 10;
else if (c >= 'a' && c <= 'z')
c -= 'a' - 10;
else
break;
if (c >= base)
break;
if (any < 0 || acc > cutoff || (acc == cutoff && c > cutlim))
any = -1;
else {
any = 1;
acc *= base;
acc += c;
}
}
if (any < 0) {
acc = UINTMAX_MAX;
errno = ERANGE;
} else if (!any) {
noconv:
errno = EINVAL;
} else if (neg)
acc = -acc;
if (endptr != NULL)
*endptr = (char *)(any ? s - 1 : nptr);
return (acc);
}

View File

@ -0,0 +1,16 @@
#ifndef _FREEBSD_H_
#define _FREEBSD_H_
typedef signed long long intmax_t;
typedef unsigned long long uintmax_t;
#define INT64_MIN (-0x7fffffffffffffffLL-1)
#define UINT64_MAX 0xffffffffffffffffULL
#define INTMAX_MIN INT64_MIN
#define INTMAX_MAX INT64_MAX
#define UINTMAX_MAX UINT64_MAX
uintmax_t strtoumax(const char * __restrict, char ** __restrict, int);
#endif

1
devel/make/pkg-descr Normal file
View File

@ -0,0 +1 @@
This is Berkeley make, taken directly from a modern version of FreeBSD.