Browse Source

Some makefile updates to make it behave a bit better/consistently.
-Erik

Erik Andersen 24 years ago
parent
commit
c3a27f5095

+ 1 - 1
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
 

+ 3 - 3
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 */
 

+ 1 - 1
include/rpc/rpc.h

@@ -37,7 +37,7 @@
 #ifndef __RPC_HEADER__
 #define __RPC_HEADER__
 
-#ifdef linux
+#ifdef __linux__
 #include <sys/time.h>
 #endif
 

+ 3 - 8
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)
 

+ 2 - 5
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 \

+ 2 - 2
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);

+ 1 - 1
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)

+ 8 - 8
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

+ 1 - 1
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);

+ 3 - 3
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

+ 1 - 1
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

+ 4 - 7
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)
 

+ 3 - 6
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)
 

+ 3 - 8
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)
 

+ 3 - 8
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)
 

+ 3 - 7
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

+ 3 - 8
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)
 

+ 3 - 8
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)