diff -uNr stdhep.ORIG/src/display/GNUmakefile stdhep/src/display/GNUmakefile
--- stdhep.ORIG/src/display/GNUmakefile	Thu Feb 28 02:15:33 2002
+++ stdhep/src/display/GNUmakefile	Thu Feb  5 16:19:47 2004
@@ -21,6 +21,10 @@
     endif
 endif
 
+ifeq "$(UNAME)" "Darwin"
+	UNAME=Darwin
+endif
+
 ifndef DEBUG
     DEBUG = none
     DFLG =
@@ -87,6 +91,16 @@
     LIBS= -L/usr/X11R6/lib -lXm -lXt -lX11 -lXp -lXext \
           -lm -lg2c -lnsl
 endif
+ifeq "$(UNAME)" "Darwin"
+    CC=gcc
+    CPP = gcc -E
+    F77=g77
+    AR=ar
+    CFLAGS=$(DFLG) -I$(STDHEP_DIR)/src/inc -I/usr/X11R6/include
+    FFLAGS=$(DFLG)
+    LIBS= -L/usr/X11R6/lib -lXm -lXt -lX11 -lXp -lXext \
+          -lm -lg2c
+endif
 ifeq "$(UNAME)" "OSF1"
     CC=cc
     CPP = /usr/lib/cpp
@@ -130,7 +144,7 @@
 	Tree$(SFX).o dispTree$(SFX).o listNodeHep$(SFX).o stdHepFiles$(SFX).o help$(SFX).o \
 	panelSpace$(SFX).o space$(SFX).o panelPara$(SFX).o Space_main$(SFX).o
 SRCS  =	phase.c panel.c menu.c drawEvent.c pick.c pixmaps.c settings.c \
-	rotation.c help.c hepnmg.f stdHepFortranUtil.f \
+	rotation.c help.c hepnmg.f stdHepFortranUtil.F \
 	Tree.c dispTree.c listNodeHep.c stdHepFiles.c \
 	panelSpace.c space.c panelPara.c Space_main.c
 INCLS =	drawEvent.h panel.h phaseP.h pixmaps.h settings.h menu.h phase.h \
@@ -138,7 +152,11 @@
 	listNodeHep.h help.h \
 	panelSpace.h space.h panelPara.h
 INCS = $(STDHEP_DIR)/src/inc
+ifneq "$(UNAME)" "Darwin"
 CPPFLG = -C -P -DUNIX -I$(INCS)
+else
+CPPFLG = -DUNIX -I$(INCS)
+endif
 
 all: $(NLIBDIR)/libPhaseStdHep$(SFX).a $(NBINDIR)/Phase$(SFX) $(NBINDIR)/Space$(SFX)
 
@@ -185,6 +203,7 @@
 .SUFFIXES : 		# cancel implicit rules
 .SUFFIXES : .o .c .F .f
 
+ifneq "$(UNAME)" "Darwin"
 %.o: %.F
 	$(CPP) $(CPPFLG) $< > $*.f
 	$(F77) $(FFLAGS) -c $*.f
@@ -194,6 +213,13 @@
 	$(CPP) $(CPPFLG) $< > $*.f
 	$(F77) $(FFLAGS) -c -o $@ $*.f
 	rm -f $*.f
+else
+%.o: %.F
+	$(F77) $(CPPFLG) $(FFLAGS) -c $*.F
+
+%_g.o: %.F
+	$(F77) $(CPPFLG) $(FFLAGS) -c -o $@ $*.F
+endif
 
 %.o: %.f
 	$(F77) $(FFLAGS) -c $*.f
diff -uNr stdhep.ORIG/src/display/panel.c stdhep/src/display/panel.c
--- stdhep.ORIG/src/display/panel.c	Thu Oct 30 05:43:13 1997
+++ stdhep/src/display/panel.c	Thu Feb  5 14:07:01 2004
@@ -26,7 +26,9 @@
 #include <stdio.h>
 #include <stdarg.h>
 #include <sys/param.h>
+#ifndef __APPLE__
 #include <values.h>
+#endif
 #include <X11/Intrinsic.h>
 #include <X11/Shell.h>
 #include <X11/Xatom.h>
diff -uNr stdhep.ORIG/src/display/panelPara.c stdhep/src/display/panelPara.c
--- stdhep.ORIG/src/display/panelPara.c	Thu Oct 30 05:43:13 1997
+++ stdhep/src/display/panelPara.c	Thu Feb  5 14:09:54 2004
@@ -27,7 +27,9 @@
 #include <math.h>
 #include <stdarg.h>
 #include <sys/param.h>
+#ifndef __APPLE__
 #include <values.h>
+#endif
 #include <X11/Intrinsic.h>
 #include <X11/Shell.h>
 #include <X11/Xatom.h>
diff -uNr stdhep.ORIG/src/display/panelSpace.c stdhep/src/display/panelSpace.c
--- stdhep.ORIG/src/display/panelSpace.c	Thu Oct 30 05:43:14 1997
+++ stdhep/src/display/panelSpace.c	Thu Feb  5 14:09:22 2004
@@ -27,7 +27,9 @@
 #include <math.h>
 #include <stdarg.h>
 #include <sys/param.h>
+#ifndef __APPLE__
 #include <values.h>
+#endif
 #include <X11/Intrinsic.h>
 #include <X11/Shell.h>
 #include <X11/Xatom.h>
diff -uNr stdhep.ORIG/src/display/pick.c stdhep/src/display/pick.c
--- stdhep.ORIG/src/display/pick.c	Tue Jan 19 03:45:52 1999
+++ stdhep/src/display/pick.c	Thu Feb  5 14:08:29 2004
@@ -27,7 +27,12 @@
 #include <Xm/Xm.h>
 #include <Xm/Label.h>
 #include <Xm/DialogS.h>
+#ifndef __APPLE__
 #include <values.h>	/* for MAXFLOAT */
+#else
+#include <float.h>
+#define MAXFLOAT __FLT_MAX__
+#endif
 #include <math.h>
 #include "spin/Spin.h"
 #include "util/stringUtils.h"
diff -uNr stdhep.ORIG/src/display/spin/GNUmakefile stdhep/src/display/spin/GNUmakefile
--- stdhep.ORIG/src/display/spin/GNUmakefile	Sat Mar 23 05:04:35 2002
+++ stdhep/src/display/spin/GNUmakefile	Thu Feb  5 13:52:51 2004
@@ -21,6 +21,10 @@
     endif
 endif
 
+ifeq "$(UNAME)" "Darwin"
+	UNAME=Linux24
+endif
+
 ifndef DEBUG
     DEBUG = none
     DFLG =
diff -uNr stdhep.ORIG/src/display/spin/Spin.c stdhep/src/display/spin/Spin.c
--- stdhep.ORIG/src/display/spin/Spin.c	Thu Oct 30 05:53:01 1997
+++ stdhep/src/display/spin/Spin.c	Thu Feb  5 14:01:19 2004
@@ -26,7 +26,12 @@
 #include <stdio.h>
 #include <math.h>
 #include <time.h>
+#ifndef __APPLE__
 #include <values.h>
+#else
+#include <stdint.h>
+#define MAXSHORT INT16_MAX
+#endif
 #include <sys/time.h>
 #include <X11/Xlib.h>
 #include <X11/Intrinsic.h>
diff -uNr stdhep.ORIG/src/display/util/GNUmakefile stdhep/src/display/util/GNUmakefile
--- stdhep.ORIG/src/display/util/GNUmakefile	Sat Mar 23 05:04:36 2002
+++ stdhep/src/display/util/GNUmakefile	Thu Feb  5 14:02:46 2004
@@ -21,6 +21,10 @@
     endif
 endif
 
+ifeq "$(UNAME)" "Darwin"
+	UNAME=Linux24
+endif
+
 ifndef DEBUG
     DEBUG = none
     DFLG =
diff -uNr stdhep.ORIG/src/mcfio/GNUmakefile stdhep/src/mcfio/GNUmakefile
--- stdhep.ORIG/src/mcfio/GNUmakefile	Wed Apr 10 05:48:44 2002
+++ stdhep/src/mcfio/GNUmakefile	Thu Feb  5 14:52:59 2004
@@ -19,6 +19,10 @@
     endif
 endif
 
+ifeq "$(UNAME)" "Darwin"
+	UNAME=Darwin
+endif
+
 ifndef DEBUG
     DEBUG = none
     DFLG =
@@ -79,11 +83,21 @@
 ifeq "$(UNAME)" "Linux"
    CC=gcc
    F77=g77
-   CFLAGS= -I/usr/X11/include
+   CFLAGS= -I/usr/X11R6/include
    FFLAGS= -fdebug-kludge -fno-second-underscore
    CPP = gcc -E
    CPPFLG= -C -P
-   MXTLIBS = /usr/X11R6/lib/libXm.a -L/usr/X11R6/lib -lX11 -lXt -lXp -lXext -lm
+   MXTLIBS = -L/usr/X11R6/lib -lXm -lX11 -lXt -lXp -lXext -lm
+   EXES = $(BINDIR)/ntuBuild$(SFX) $(BINDIR)/ntuBrowser$(SFX) 
+endif
+ifeq "$(UNAME)" "Darwin"
+   CC=gcc
+   F77=g77
+   CFLAGS= -I/usr/X11R6/include
+   FFLAGS= -fdebug-kludge -fno-second-underscore
+   CPP = gcc -E
+   CPPFLG= 
+   MXTLIBS = -L/usr/X11R6/lib -lXm -lX11 -lXt -lXp -lXext -lm
    EXES = $(BINDIR)/ntuBuild$(SFX) $(BINDIR)/ntuBrowser$(SFX) 
 endif
 ifeq "$(UNAME)" "Linux22"
@@ -198,6 +212,7 @@
 
 #--------------------------
 
+ifneq "$(UNAME)" "Darwin"
 $(BLDDIR)/%.o: $(SRCDIR)/%.F
 	$(CPP) $(CPPFLGS) $< > $*.f
 	$(F77) -c -o $(BLDDIR)/$*.o $(FFLAGS) $(SRCDIR)/$*.f
@@ -205,6 +220,13 @@
 $(BLDDIR)/%_g.o: $(SRCDIR)/%.F
 	$(CPP) $(CPPFLGS) $< > $*.f
 	$(F77) -c -o $(BLDDIR)/$*_g.o $(FFLAGS) $(DFLG) $(SRCDIR)/$*.f
+else
+$(BLDDIR)/%.o: $(SRCDIR)/%.F
+	$(F77) -c -o $(BLDDIR)/$*.o $(CPPFLGS) $(FFLAGS) $(SRCDIR)/$*.F
+
+$(BLDDIR)/%_g.o: $(SRCDIR)/%.F
+	$(F77) -c -o $(BLDDIR)/$*_g.o $(CPPFLGS) $(FFLAGS) $(DFLG) $(SRCDIR)/$*.F
+endif
 
 $(BLDDIR)/%.o: $(SRCDIR)/%.c
 	$(CC) -c -o $(BLDDIR)/$*.o $(CFLAGS) $(CINC) $(SRCDIR)/$*.c
diff -uNr stdhep.ORIG/src/stdhep/GNUmakefile stdhep/src/stdhep/GNUmakefile
--- stdhep.ORIG/src/stdhep/GNUmakefile	Sun Mar 10 14:32:59 2002
+++ stdhep/src/stdhep/GNUmakefile	Thu Feb  5 14:53:21 2004
@@ -16,6 +16,10 @@
     endif
 endif
 
+ifeq "$(UNAME)" "Darwin"
+	UNAME=Darwin
+endif
+
 ifndef DEBUG
     DEBUG = none
     DFLG =
@@ -64,6 +68,15 @@
     FFLAG= $(DFLG) -fno-second-underscore
     CPPFLG= -C -P
 endif
+ifeq "$(UNAME)" "Darwin"
+    CC=gcc
+    AR=ar
+    F77=g77
+    CPP = gcc -E
+    CFLG=
+    FFLAG= $(DFLG) -fno-second-underscore
+    CPPFLG=
+endif
 ifeq "$(UNAME)" "Linux22"
     CC=/usr/bin/gcc
     AR=ar
@@ -135,6 +148,7 @@
 .SUFFIXES : 		# cancel implicit rules
 .SUFFIXES : .o .c .F
 
+ifneq "$(UNAME)" "Darwin"
 %.o: %.F
 	$(CPP) $(CPPFLGS) $< > $*.f
 	$(F77) $(FFLAG) -c $*.f
@@ -142,6 +156,13 @@
 %_g.o: %.F
 	$(CPP) $(CPPFLGS) $< > $*.f
 	$(F77) $(FFLAG) -c -o $@ $*.f
+else
+%.o: %.F
+	$(F77) $(CPPFLGS) $(FFLAG) -c $<
+
+%_g.o: %.F
+	$(F77) $(CPPFLGS) $(FFLAG) -c $<
+endif
 
 %.o: %.c
 	$(CC) $(CFLAGS) -c $<
