summaryrefslogtreecommitdiff
path: root/Makefile.pthreads
diff options
context:
space:
mode:
Diffstat (limited to 'Makefile.pthreads')
-rw-r--r--Makefile.pthreads67
1 files changed, 67 insertions, 0 deletions
diff --git a/Makefile.pthreads b/Makefile.pthreads
new file mode 100644
index 0000000..8981a01
--- /dev/null
+++ b/Makefile.pthreads
@@ -0,0 +1,67 @@
+# If your make barfs, try gnumake instead.
+
+# Supported targets:
+# <default> - builds gc.a and gctest
+# gc.a - builds basic library
+# gctest - tests basic library
+# c++ - adds C++ interface to library
+
+# Default threads package -- uncomment ONE of the following
+
+THR=MIT
+#THR=DEC
+
+ifeq ($(THR),MIT)
+
+# Definitions for MIT-pthreads
+CC=pgcc
+IFCC=cc
+CXX=pg++
+CFLAGS=-g -DNO_SIGNALS -DALL_INTERIOR_POINTERS -DSILENT \
+ -DMIT_PTHREADS -DGATHERSTATS
+endif
+
+ifeq ($(THR),DEC)
+
+# Definitions for DECthreads
+CC=cc
+IFCC=cc
+CXX=gcc
+CFLAGS= -g -DNO_SIGNALS -DALL_INTERIOR_POINTERS -DSILENT \
+ -DDEC_PTHREADS -DGATHERSTATS
+THRLIB=-lpthreads -lmach -lc_r
+endif
+
+ifeq ($(THR),SOLARIS)
+
+# Definitions for Solaris threads
+CC=gcc
+IFCC=gcc
+CXX=gcc
+CFLAGS= -g -DNO_SIGNALS -DALL_INTERIOR_POINTERS -DSILENT \
+ -DSOLARIS_THREADS -DGATHERSTATS
+endif
+
+all: gc.a gctest
+
+gc.a: pre-built
+ $(MAKE) -f Makefile CC=$(CC) CXX=$(CXX) CFLAGS="$(CFLAGS)" $@
+
+test.o:
+ $(MAKE) -f Makefile CC=$(CC) CXX=$(CXX) CFLAGS="$(CFLAGS)" $@
+
+gctest: pre-built gc.a test.o
+ $(MAKE) -f Makefile CC=$(CC) CXX=$(CXX) CFLAGS="$(CFLAGS) $(THRLIB)" $@
+
+c++: gc.a test.o
+ $(MAKE) -f Makefile CC=$(CC) CXX=$(CXX) CFLAGS="$(CFLAGS) $(THRLIB)" $@
+
+# May need to avoid pgcc for if_not_there and if_mach...
+
+pre-built: if_not_there if_mach
+
+if_not_there: if_not_there.c
+ $(MAKE) -f Makefile CC=$(IFCC) if_not_there
+
+if_mach: if_mach.c config.h
+ $(MAKE) -f Makefile CC=$(IFCC) if_mach