summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Makefile2
-rw-r--r--include/arpa/nameser.h6
-rw-r--r--include/rpc/rpc.h2
-rw-r--r--libc/inet/Makefile11
-rw-r--r--libc/inet/rpc/Makefile7
-rw-r--r--libc/inet/rpc/clnt_generic.c4
-rw-r--r--libc/inet/rpc/get_myaddress.c2
-rw-r--r--libc/inet/rpc/getrpcent.c16
-rw-r--r--libc/inet/rpc/pmap_rmt.c2
-rw-r--r--libc/inet/rpc/svc.c6
-rw-r--r--libc/inet/rpc/xdr_float.c2
-rw-r--r--libc/misc/time/Makefile11
-rw-r--r--libc/pwd_grp/Makefile9
-rw-r--r--libc/stdio/Makefile11
-rw-r--r--libc/stdlib/Makefile11
-rw-r--r--libc/stdlib/malloc/Makefile10
-rw-r--r--libc/string/Makefile11
-rw-r--r--libc/termios/Makefile11
18 files changed, 48 insertions, 86 deletions
diff --git a/Makefile b/Makefile
index fc320afed..741235adc 100644
--- a/Makefile
+++ b/Makefile
@@ -59,6 +59,6 @@ crt: dummy
dummy:
clean:
- -rm `find -name \*.[oa]` `find -name \*~` core
+ -rm -f `find -name \*.[oa]` `find -name \*~` core
-rm include/asm include/net include/linux
diff --git a/include/arpa/nameser.h b/include/arpa/nameser.h
index ba6014216..e88ad8226 100644
--- a/include/arpa/nameser.h
+++ b/include/arpa/nameser.h
@@ -77,7 +77,7 @@
/*
* @(#)nameser.h 8.1 (Berkeley) 6/2/93
- * $Id: nameser.h,v 1.1 2000/05/14 04:16:36 erik Exp $
+ * $Id: nameser.h,v 1.2 2000/05/14 06:07:30 erik Exp $
*/
#ifndef _NAMESER_H_
@@ -258,7 +258,7 @@
#if (BSD >= 199103)
# include <machine/endian.h>
#else
-#ifdef linux
+#ifdef __linux__
# include <endian.h>
#else
#define LITTLE_ENDIAN 1234 /* least-significant byte first (vax, pc) */
@@ -280,7 +280,7 @@
defined (BIT_ZERO_ON_LEFT) || defined(m68k)
#define BYTE_ORDER BIG_ENDIAN
#endif
-#endif /* linux */
+#endif /* __linux__ */
#endif /* BSD */
#endif /* BYTE_ORDER */
diff --git a/include/rpc/rpc.h b/include/rpc/rpc.h
index b7d50d2dc..1edf4a334 100644
--- a/include/rpc/rpc.h
+++ b/include/rpc/rpc.h
@@ -37,7 +37,7 @@
#ifndef __RPC_HEADER__
#define __RPC_HEADER__
-#ifdef linux
+#ifdef __linux__
#include <sys/time.h>
#endif
diff --git a/libc/inet/Makefile b/libc/inet/Makefile
index 0b8797488..1e954307f 100644
--- a/libc/inet/Makefile
+++ b/libc/inet/Makefile
@@ -4,13 +4,10 @@
# Copyright (C) 1999 D. Jeff Dionne <jeff@rt-control.com>
# under the GNU Library General Public License.
-LIBC=../libc.a
-
-CC=$(CROSS)gcc
-AR=$(CROSS)ar
-RANLIB=$(CROSS)ranlib
+TOPDIR=../
+include Rules.make
-CCFLAGS= -O2 $(CPUFLAGS) -fno-builtin -I../include
+LIBC=../libc.a
ASRC=addr.c
AOBJ=inet_aton.o inet_addr.o inet_ntoa.o
@@ -24,8 +21,6 @@ gethostbyaddr.o
OBJ=$(AOBJ) $(ROBJ)
-CFLAGS=$(ARCH) $(CCFLAGS) $(DEFS)
-
all: $(LIBC)
@$(RM) $(OBJ)
diff --git a/libc/inet/rpc/Makefile b/libc/inet/rpc/Makefile
index 8c2229374..b2d7c6d4a 100644
--- a/libc/inet/rpc/Makefile
+++ b/libc/inet/rpc/Makefile
@@ -1,8 +1,5 @@
-CC=$(CROSS)gcc
-AR=$(CROSS)ar
-RANLIB=$(CROSS)ranlib
-
-CFLAGS= -O2 -fomit-frame-pointer -Dlinux -I../include
+TOPDIR=../
+include $(TOPDIR)Rules.make
OBJS = auth_none.o auth_unix.o authunix_prot.o \
bindresvport.o clnt_generic.o clnt_perror.o \
diff --git a/libc/inet/rpc/clnt_generic.c b/libc/inet/rpc/clnt_generic.c
index 9124ccf16..fabcc2b32 100644
--- a/libc/inet/rpc/clnt_generic.c
+++ b/libc/inet/rpc/clnt_generic.c
@@ -70,12 +70,12 @@ clnt_create(hostname, prog, vers, proto)
rpc_createerr.cf_error.re_errno = EAFNOSUPPORT;
return (NULL);
}
-#ifdef linux
+#ifdef __linux__
bzero((char *) &sin, sizeof(sin));
#endif
sin.sin_family = h->h_addrtype;
sin.sin_port = 0;
-#ifndef linux
+#ifndef __linux__
bzero(sin.sin_zero, sizeof(sin.sin_zero));
#endif
bcopy(h->h_addr, (char*)&sin.sin_addr, h->h_length);
diff --git a/libc/inet/rpc/get_myaddress.c b/libc/inet/rpc/get_myaddress.c
index 44a6eb38c..1940d3e27 100644
--- a/libc/inet/rpc/get_myaddress.c
+++ b/libc/inet/rpc/get_myaddress.c
@@ -47,7 +47,7 @@ static char sccsid[] = "@(#)get_myaddress.c 1.4 87/08/11 Copyr 1984 Sun Micro";
#include <arpa/inet.h>
#include <netinet/in.h>
-#ifdef linux
+#ifdef __linux__
/* DO use gethostbyname because it's portable */
#include <netdb.h>
get_myaddress(addr)
diff --git a/libc/inet/rpc/getrpcent.c b/libc/inet/rpc/getrpcent.c
index e0b7342cc..b3b3ece4c 100644
--- a/libc/inet/rpc/getrpcent.c
+++ b/libc/inet/rpc/getrpcent.c
@@ -60,7 +60,7 @@ struct rpcdata {
static struct rpcent *interpret();
struct hostent *gethostent();
char *inet_ntoa();
-#ifndef linux
+#ifndef __linux__
static char *index();
#else
char *index();
@@ -102,7 +102,7 @@ getrpcbynumber(number)
}
struct rpcent *
-#ifdef linux
+#ifdef __linux__
getrpcbyname(const char *name)
#else
getrpcbyname(name)
@@ -125,7 +125,7 @@ getrpcbyname(name)
return (NULL);
}
-#ifdef linux
+#ifdef __linux__
void
#endif
setrpcent(f)
@@ -145,7 +145,7 @@ setrpcent(f)
d->stayopen |= f;
}
-#ifdef linux
+#ifdef __linux__
void
#endif
endrpcent()
@@ -182,7 +182,7 @@ getrpcent()
return interpret(d->line, strlen(d->line));
}
-#ifdef linux
+#ifdef __linux__
static char *
firstwhite(s)
char *s;
@@ -224,7 +224,7 @@ interpret(val, len)
return (getrpcent());
}
*cp = '\0';
-#ifdef linux
+#ifdef __linux__
if ((cp = firstwhite(p)))
*cp++ = 0;
else
@@ -245,7 +245,7 @@ interpret(val, len)
cp++;
d->rpc.r_number = atoi(cp);
q = d->rpc.r_aliases = d->rpc_aliases;
-#ifdef linux
+#ifdef __linux__
if ((cp = firstwhite(cp)))
*cp++ = '\0';
#else
@@ -266,7 +266,7 @@ interpret(val, len)
}
if (q < &(d->rpc_aliases[MAXALIASES - 1]))
*q++ = cp;
-#ifdef linux
+#ifdef __linux__
if ((cp = firstwhite(cp)))
*cp++ = '\0';
#else
diff --git a/libc/inet/rpc/pmap_rmt.c b/libc/inet/rpc/pmap_rmt.c
index 08b6bebd3..336d0c112 100644
--- a/libc/inet/rpc/pmap_rmt.c
+++ b/libc/inet/rpc/pmap_rmt.c
@@ -164,7 +164,7 @@ getbroadcastnets(addrs, sock, buf)
int sock; /* any valid socket will do */
char *buf; /* why allocxate more when we can use existing... */
{
-#ifdef linux
+#ifdef __linux__
struct sockaddr_in addr;
get_myaddress(&addr);
diff --git a/libc/inet/rpc/svc.c b/libc/inet/rpc/svc.c
index feac64628..9d0092d8a 100644
--- a/libc/inet/rpc/svc.c
+++ b/libc/inet/rpc/svc.c
@@ -44,7 +44,7 @@ static char sccsid[] = "@(#)svc.c 1.41 87/10/13 Copyr 1984 Sun Micro";
#include <sys/errno.h>
#include <rpc/rpc.h>
#include <rpc/pmap_clnt.h>
-#ifdef linux
+#ifdef __linux__
#include <sys/types.h>
#endif
@@ -375,7 +375,7 @@ svc_getreq(rdfds)
fd_set readfds;
FD_ZERO(&readfds);
-/*#ifdef linux*/
+/*#ifdef __linux__*/
#if 0
readfds = rdfds;
#else
@@ -419,7 +419,7 @@ svc_getreqset(readfds)
#ifdef FD_SETSIZE
setsize = _rpc_dtablesize();
-#ifdef linux
+#ifdef __linux__
/*#define NFDBITS 32*/
maskp = (u_long *)readfds;
#else
diff --git a/libc/inet/rpc/xdr_float.c b/libc/inet/rpc/xdr_float.c
index ad221a79f..ce7b6e07f 100644
--- a/libc/inet/rpc/xdr_float.c
+++ b/libc/inet/rpc/xdr_float.c
@@ -51,7 +51,7 @@ static char sccsid[] = "@(#)xdr_float.c 1.12 87/08/11 Copyr 1984 Sun Micro";
* This routine works on Suns (Sky / 68000's) and Vaxen.
*/
-#ifdef linux
+#ifdef __linux__
/* cheat big time */
#define sparc
#endif
diff --git a/libc/misc/time/Makefile b/libc/misc/time/Makefile
index e68ee5dc7..ce2351ddf 100644
--- a/libc/misc/time/Makefile
+++ b/libc/misc/time/Makefile
@@ -2,19 +2,16 @@
# This file is part of the Linux-8086 C library and is distributed
# under the GNU Library General Public License.
-LIBC=../libc.a
+TOPDIR=../
+include $(TOPDIR)Rules.make
-CC=$(CROSS)gcc
-AR=$(CROSS)ar
-RANLIB=$(CROSS)ranlib
+CFLAGS+=-I$(TOPDIR)/include/linux
-CCFLAGS= -O2 $(CPUFLAGS) -I../include
+LIBC=../libc.a
OBJ=localtime.o gmtime.o asctime.o ctime.o asc_conv.o tm_conv.o mktime.o \
localtime_r.o gmtime_r.o asctime_r.o ctime_r.o
-CFLAGS=$(ARCH) $(CCFLAGS) $(DEFS)
-
all: $(LIBC)
@$(RM) $(OBJ)
diff --git a/libc/pwd_grp/Makefile b/libc/pwd_grp/Makefile
index 48b2b3aab..8be9015f1 100644
--- a/libc/pwd_grp/Makefile
+++ b/libc/pwd_grp/Makefile
@@ -2,13 +2,10 @@
# This file is part of the Linux-8086 C library and is distributed
# under the GNU Library General Public License.
-LIBC=../libc.a
-
-CC=$(CROSS)gcc
-AR=$(CROSS)ar
-RANLIB=$(CROSS)ranlib
+TOPDIR=../
+include $(TOPDIR)Rules.make
-CCFLAGS= -O2 $(CPUFLAGS) -I../include
+LIBC=../libc.a
CFLAGS=$(ARCH) -ansi $(CCFLAGS) $(DEFS)
diff --git a/libc/stdio/Makefile b/libc/stdio/Makefile
index 72836d9d1..020d33ce0 100644
--- a/libc/stdio/Makefile
+++ b/libc/stdio/Makefile
@@ -2,13 +2,10 @@
# This file is part of the Linux-8086 C library and is distributed
# under the GNU Library General Public License.
-LIBC=../libc.a
-
-CC=$(CROSS)gcc
-AR=$(CROSS)ar
-RANLIB=$(CROSS)ranlib
+TOPDIR=../
+include $(TOPDIR)Rules.make
-CCFLAGS= -O2 $(CPUFLAGS) -I../include
+LIBC=../libc.a
ASRC=stdio.c
AOBJ=_stdio_init.o fputc.o fgetc.o fflush.o fgets.o gets.o fputs.o \
@@ -23,8 +20,6 @@ SOBJ=scanf.o sscanf.o fscanf.o vscanf.o vsscanf.o vfscanf.o
OBJ= $(AOBJ) $(POBJ) $(SOBJ) dputs.o
-CFLAGS=$(ARCH) $(CCFLAGS) $(DEFS)
-
all: $(LIBC)
@$(RM) $(OBJ)
diff --git a/libc/stdlib/Makefile b/libc/stdlib/Makefile
index c45cd2840..61a82a2d6 100644
--- a/libc/stdlib/Makefile
+++ b/libc/stdlib/Makefile
@@ -2,13 +2,10 @@
# This file is part of the Linux-8086 C library and is distributed
# under the GNU Library General Public License.
-LIBC=../libc.a
-
-CC=$(CROSS)gcc
-AR=$(CROSS)ar
-RANLIB=$(CROSS)ranlib
+TOPDIR=../
+include $(TOPDIR)Rules.make
-CCFLAGS= -O2 $(CPUFLAGS) -fno-builtin -I../include
+LIBC=../libc.a
MSRC=aliases.c
MOBJ=abs.o remove.o creat.o bcopy.o bzero.o
@@ -33,8 +30,6 @@ OBJ=$(MOBJ) $(EOBJ) $(GOBJ) $(UOBJ)
#OBJ+=strtod.o
#endif
-CFLAGS=$(ARCH) $(CCFLAGS) $(DEFS)
-
all: $(LIBC)
@$(RM) $(OBJ)
diff --git a/libc/stdlib/malloc/Makefile b/libc/stdlib/malloc/Makefile
index 26cfb6930..368adb797 100644
--- a/libc/stdlib/malloc/Makefile
+++ b/libc/stdlib/malloc/Makefile
@@ -2,14 +2,10 @@
# This file is part of the Linux-8086 C library and is distributed
# under the GNU Library General Public License.
-LIBC=../libc.a
-
-CC=$(CROSS)gcc
-AR=$(CROSS)ar
-RANLIB=$(CROSS)ranlib
-
-CCFLAGS= -O2 $(CPUFLAGS) -I../include
+TOPDIR=../
+include Rules.make
+LIBC=../libc.a
MSRC=alloc.c
MOBJ=malloc.o free.o calloc.o malloc_dbg.o free_dbg.o calloc_dbg.o
diff --git a/libc/string/Makefile b/libc/string/Makefile
index de79004ba..a64d0b82b 100644
--- a/libc/string/Makefile
+++ b/libc/string/Makefile
@@ -2,13 +2,10 @@
# This file is part of the Linux-8086 C library and is distributed
# under the GNU Library General Public License.
-LIBC=../libc.a
-
-CC=$(CROSS)gcc
-AR=$(CROSS)ar
-RANLIB=$(CROSS)ranlib
+TOPDIR=../
+include $(TOPDIR)Rules.make
-CCFLAGS= -O2 $(CPUFLAGS) -I../include
+LIBC=../libc.a
SSRC=string.c
SOBJ=strlen.o strcat.o strcpy.o strcmp.o strncat.o strncpy.o strncmp.o \
@@ -18,8 +15,6 @@ SOBJ=strlen.o strcat.o strcpy.o strcmp.o strncat.o strncpy.o strncmp.o \
OBJ=$(SOBJ) strpbrk.o strsep.o strstr.o strtok.o strcspn.o \
strspn.o strcasecmp.o strncasecmp.o config.o
-CFLAGS=$(ARCH) $(CCFLAGS) $(DEFS)
-
all: $(LIBC)
@$(RM) $(OBJ)
diff --git a/libc/termios/Makefile b/libc/termios/Makefile
index d0d64681d..a4ff4b7d9 100644
--- a/libc/termios/Makefile
+++ b/libc/termios/Makefile
@@ -2,13 +2,10 @@
# This file is part of the Linux-8086 C library and is distributed
# under the GNU Library General Public License.
-LIBC=../libc.a
-
-CC=$(CROSS)gcc
-AR=$(CROSS)ar
-RANLIB=$(CROSS)ranlib
+TOPDIR=../
+include $(TOPDIR)Rules.make
-CCFLAGS= -O2 $(CPUFLAGS) -I../include
+LIBC=../libc.a
TSRC=termios.c
TOBJ=tcsetattr.o tcgetattr.o tcdrain.o tcflow.o tcflush.o tcsendbreak.o \
@@ -21,8 +18,6 @@ OBJ=$(TOBJ) ttyname.o
# unlike everything else, this does not compile out of the box...
# ttyname.o
-CFLAGS=$(ARCH) $(CCFLAGS) $(DEFS)
-
all: $(LIBC)
@$(RM) $(OBJ)