summaryrefslogtreecommitdiff
path: root/Makefile.pthreads
blob: 8981a014f41408a25d6bbfc304775d21b6581032 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
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