diff -rc make-3.62/Makefile make-3.62/Makefile
*** make-3.62/Makefile	Wed Oct 30 02:04:27 1991
--- make-3.62/Makefile	Fri Mar 27 02:29:41 1992
***************
*** 19,26 ****
  #	Makefile for GNU Make
  #
  
! CFLAGS = $(defines) -g
! LDFLAGS = -g
  
  # Define these for your system as follows:
  # 	-DUSG			System V
--- 19,26 ----
  #	Makefile for GNU Make
  #
  
! CFLAGS = $(defines) -Wall #-g
! LDFLAGS = #-g
  
  # Define these for your system as follows:
  # 	-DUSG			System V
***************
*** 38,44 ****
  #				without complaint but produce losing code,
  #				so beware.
  # NeXT 1.0a uses an old version of GCC, which required -D__inline=inline.
! defines =
  
  # Define these for your system as follows:
  #	-DUMAX		Encore UMAX
--- 38,44 ----
  #				without complaint but produce losing code,
  #				so beware.
  # NeXT 1.0a uses an old version of GCC, which required -D__inline=inline.
! defines = -DPOSIX -DLINUX -DHAVE_DUP2
  
  # Define these for your system as follows:
  #	-DUMAX		Encore UMAX
***************
*** 52,58 ****
  # Define:
  #	-DNLIST_NAME_UNION	If `struct nlist' has a n_un member.
  #	-DNLIST_NAME_ARRAY	If `n_name' is an array.
! LOAD_AVG =
  
  # If you don't want archive support, comment these out.
  ARCHIVES = arscan.o ar.o
--- 52,58 ----
  # Define:
  #	-DNLIST_NAME_UNION	If `struct nlist' has a n_un member.
  #	-DNLIST_NAME_ARRAY	If `n_name' is an array.
! LOAD_AVG = -DNO_LDAV
  
  # If you don't want archive support, comment these out.
  ARCHIVES = arscan.o ar.o
diff -rc make-3.62/commands.c make-3.62/commands.c
*** make-3.62/commands.c	Tue Oct  8 20:20:30 1991
--- make-3.62/commands.c	Fri Mar 27 02:27:59 1992
***************
*** 342,348 ****
       int sig;
  {
    signal (sig, SIG_DFL);
! #ifndef USG
    (void) sigsetmask (0);
  #endif
  
--- 342,348 ----
       int sig;
  {
    signal (sig, SIG_DFL);
! #if !defined(USG) && !defined(LINUX)
    (void) sigsetmask (0);
  #endif
  
diff -rc make-3.62/glob/glob.c make-3.62/glob/glob.c
*** make-3.62/glob/glob.c	Sat Oct 19 20:39:24 1991
--- make-3.62/glob/glob.c	Fri Mar 27 02:42:49 1992
***************
*** 18,23 ****
--- 18,28 ----
  
  /*  */
  
+ #define bcopy(s, d, n)	memcpy ((d), (s), (n))
+ #define	index(s, c)	strchr((s), (c))
+ #define	rindex(s, c)	strrchr((s), (c))
+ #define STDC_STRINGS
+ 
  #include <glob.h>
  #include <fnmatch.h>
  
diff -rc make-3.62/job.c make-3.62/job.c
*** make-3.62/job.c	Thu Oct 24 21:58:34 1991
--- make-3.62/job.c	Fri Mar 27 02:44:44 1992
***************
*** 117,122 ****
--- 117,123 ----
  extern int setgid (), getgid ();
  #endif	/* GNU C library.  */
  
+ #ifndef LINUX
  #ifndef USG
  extern int getdtablesize ();
  #else
***************
*** 123,128 ****
--- 124,130 ----
  #include <sys/param.h>
  #define getdtablesize() NOFILE
  #endif
+ #endif
  
  extern void wait_to_start_job ();
  extern int start_remote_job_p ();
***************
*** 129,135 ****
  extern int start_remote_job (), remote_status ();
  
  
! #if	(defined(USG) && !defined(HAVE_SIGLIST)) || defined(DGUX)
  static char *sys_siglist[NSIG];
  void init_siglist ();
  #else	/* Not (USG and HAVE_SIGLIST), or DGUX.  */
--- 131,137 ----
  extern int start_remote_job (), remote_status ();
  
  
! #if	(defined(USG) && !defined(HAVE_SIGLIST)) || defined(DGUX) || defined(linux)
  static char *sys_siglist[NSIG];
  void init_siglist ();
  #else	/* Not (USG and HAVE_SIGLIST), or DGUX.  */
***************
*** 180,186 ****
  
  extern int fatal_signal_mask;
  
! #ifdef	USG
  /* Set nonzero in the interval when it's possible that we may see a dead
     child that's not in the `children' chain.  */
  static int unknown_children_possible = 0;
--- 182,188 ----
  
  extern int fatal_signal_mask;
  
! #if defined(USG) || defined(LINUX)
  /* Set nonzero in the interval when it's possible that we may see a dead
     child that's not in the `children' chain.  */
  static int unknown_children_possible = 0;
***************
*** 192,198 ****
  static void
  block_signals ()
  {
! #ifdef USG
  
    /* Tell child_handler that it might see children that aren't yet
       in the `children' chain.  */
--- 194,200 ----
  static void
  block_signals ()
  {
! #if defined(USG) || defined(LINUX)
  
    /* Tell child_handler that it might see children that aren't yet
       in the `children' chain.  */
***************
*** 216,222 ****
  static void
  unblock_signals ()
  {
! #ifdef	USG
  
    (void) SIGNAL (SIGCLD, child_handler);
  
--- 218,224 ----
  static void
  unblock_signals ()
  {
! #if defined(USG) || defined(LINUX)
  
    (void) SIGNAL (SIGCLD, child_handler);
  
***************
*** 396,402 ****
        if (c == 0)
  	{
  	  /* An unknown child died.  */
! #ifdef	USG
  	  if (!unknown_children_possible)
  	    {
  #endif
--- 398,404 ----
        if (c == 0)
  	{
  	  /* An unknown child died.  */
! #if defined(USG) || defined(LINUX)
  	  if (!unknown_children_possible)
  	    {
  #endif
***************
*** 407,413 ****
  			     ignore_errors_flag);
  	      else
  		error ("%s finished.", buf);
! #ifdef	USG
  	    }
  #endif
  	}
--- 409,415 ----
  			     ignore_errors_flag);
  	      else
  		error ("%s finished.", buf);
! #if defined(USG) || defined(LINUX)
  	    }
  #endif
  	}
diff -rc make-3.62/main.c make-3.62/main.c
*** make-3.62/main.c	Mon Sep  9 23:36:15 1991
--- make-3.62/main.c	Fri Mar 27 02:28:00 1992
***************
*** 321,329 ****
--- 321,333 ----
    FATAL_SIG (SIGDANGER);
  #endif
    FATAL_SIG (SIGFPE);
+ #ifdef SIGBUS
    FATAL_SIG (SIGBUS);
+ #endif
    FATAL_SIG (SIGSEGV);
+ #ifdef SIGSYS
    FATAL_SIG (SIGSYS);
+ #endif
    FATAL_SIG (SIGTERM);
  #ifdef SIGXCPU
    FATAL_SIG (SIGXCPU);
diff -rc make-3.62/make.h make-3.62/make.h
*** make-3.62/make.h	Sat Oct 26 21:19:59 1991
--- make-3.62/make.h	Fri Mar 27 02:33:23 1992
***************
*** 22,27 ****
--- 22,37 ----
  #include <stdio.h>
  #include <ctype.h>
  
+ #ifdef linux
+ #define SIGCLD	SIGCHLD
+ #define	index(s, c)	strchr((s), (c))
+ #define	rindex(s, c)	strrchr((s), (c))
+ 
+ #define bcmp(s1, s2, n)	memcmp ((s1), (s2), (n))
+ #define bzero(s, n)	memset ((s), 0, (n))
+ #define bcopy(s, d, n)	memcpy ((d), (s), (n))
+ #endif
+ 
  #ifndef	isblank
  #define	isblank(c)	((c) == ' ' || (c) == '\t')
  #endif
***************
*** 205,211 ****
  extern void user_access (), make_access (), child_access ();
  
  
! #if	defined(USG) && !defined(HAVE_VFORK)
  #define	vfork	fork
  #define	VFORK_NAME	"fork"
  #else	/* Have vfork or not USG.  */
--- 215,221 ----
  extern void user_access (), make_access (), child_access ();
  
  
! #if	(defined(USG) || defined(LINUX)) && !defined(HAVE_VFORK)
  #define	vfork	fork
  #define	VFORK_NAME	"fork"
  #else	/* Have vfork or not USG.  */
***************
*** 232,238 ****
  extern char *ctime ();
  #endif	/* GNU C library or POSIX.  */
  
! #if	defined(USG) || defined(POSIX) && !defined(__GNU_LIBRARY__)
  extern char *getcwd ();
  #ifdef	PATH_MAX
  #define	getwd(buf)	getcwd (buf, PATH_MAX - 2)
--- 242,248 ----
  extern char *ctime ();
  #endif	/* GNU C library or POSIX.  */
  
! #if	defined(USG) || defined(LINUX) || defined(POSIX) && !defined(__GNU_LIBRARY__)
  extern char *getcwd ();
  #ifdef	PATH_MAX
  #define	getwd(buf)	getcwd (buf, PATH_MAX - 2)
diff -rc make-3.62/read.c make-3.62/read.c
*** make-3.62/read.c	Thu Oct 10 20:20:55 1991
--- make-3.62/read.c	Fri Mar 27 02:51:37 1992
***************
*** 1477,1482 ****
--- 1477,1488 ----
  		}
  	      if (home_dir == 0 || home_dir[0] == '\0')
  		{
+ #ifdef	linux
+ 		  struct passwd *p = getpwuid(getuid()); /* missing lib function! */
+ 		  home_dir = 0;		/* may fail for undefined users */
+ 		  if (p != 0)
+ 		    home_dir = p->pw_dir;
+ #else
  		  extern char *getlogin ();
  		  char *name = getlogin ();
  		  home_dir = 0;
***************
*** 1486,1491 ****
--- 1492,1498 ----
  		      if (p != 0)
  			home_dir = p->pw_dir;
  		    }
+ #endif
  		}
  	      if (home_dir != 0)
  		{
