summaryrefslogtreecommitdiff
path: root/Makefile
blob: c31efca1356798c0dd2c9e5ef9d39c03fd6b60ab (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
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93

# This makefile is compatible with MS nmake and can be used as a
# replacement for buildlib.bat. I've changed the target from an ordinary dll
# (/LD) to a debugging dll (/LDd).
# 
# The variables $DLLDEST and $LIBDEST hold the destination directories for the
# dll and the lib, respectively. Probably all that needs to change is $DEVROOT.

DEVROOT=c:\pthreads\dll

DLLDEST=$(DEVROOT)
LIBDEST=$(DEVROOT)

DLLS	= pthreadVCE.dll pthreadVSE.dll pthreadVC.dll

OPTIM	= /O2

# C++ Exceptions
VCEFLAGS	= /GX /TP /DPtW32NoCatchWarn /D__CLEANUP_CXX
#Structured Exceptions
VSEFLAGS	= /D__CLEANUP_SEH
#C cleanup code
VCFLAGS	= /D__CLEANUP_C

#CFLAGS	= $(OPTIM) /W3 /MT /nologo /Yd /Zi /I. /D_WIN32_WINNT=0x400 /DPTW32_BUILD /DTEST_ICE
CFLAGS	= $(OPTIM) /W3 /MT /nologo /Yd /Zi /I. /D_WIN32_WINNT=0x400 /DPTW32_BUILD

OBJ=  attr.obj \
	barrier.obj \
	cancel.obj \
	cleanup.obj \
	condvar.obj \
	create.obj \
	dll.obj \
	errno.obj \
	exit.obj \
	fork.obj \
	global.obj \
	misc.obj \
	mutex.obj \
	nonportable.obj \
	private.obj \
	rwlock.obj \
	sched.obj \
	semaphore.obj \
	signal.obj \
	spin.obj \
	sync.obj \
	tsd.obj

all:
	@ echo Run one of the following command lines:
	@ echo nmake clean VCE   (to build the MSVC dll with C++ exception handling)
	@ echo nmake clean VSE   (to build the MSVC dll with structured exception handling)
	@ echo nmake clean VC    (to build the MSVC dll with C cleanup code)

auto:
	@ nmake clean VCE
	@ nmake clean VSE
	@ nmake clean VC

VCE:
	@ nmake /nologo EHFLAGS="$(VCEFLAGS)" pthreadVCE.dll

VSE:
	@ nmake /nologo EHFLAGS="$(VSEFLAGS)" pthreadVSE.dll

VC:
	@ nmake /nologo EHFLAGS="$(VCFLAGS)" pthreadVC.dll

realclean: clean
	if exist *.dll del *.dll
	if exist *.lib del *.lib

clean:
	if exist *.obj del *.obj
	if exist *.ilk del *.ilk
	if exist *.pdb del *.pdb
	if exist *.exp del *.exp
	if exist *.o del *.o


install: $(DLLS)
	copy pthread*.dll $(DLLDEST)
	copy pthread*.lib $(LIBDEST)

$(DLLS): $(OBJ) pthread.def
	cl /LD /Zi /nologo $(OBJ) \
		/link /nodefaultlib:libcmt /implib:$*.lib \
		msvcrt.lib wsock32.lib /def:pthread.def /out:$@

.c.obj:
	cl $(EHFLAGS) $(CFLAGS) -c $<