aboutsummaryrefslogtreecommitdiffstats
path: root/lib/ssl/c_src/Makefile.win32
blob: 668cd2a28dd25f3fb3e083907588a89018e16b93 (plain) (blame)
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
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
#
# %CopyrightBegin%
# 
# Copyright Ericsson AB 1999-2009. All Rights Reserved.
# 
# The contents of this file are subject to the Erlang Public License,
# Version 1.1, (the "License"); you may not use this file except in
# compliance with the License. You should have received a copy of the
# Erlang Public License along with this software. If not, it can be
# retrieved online at http://www.erlang.org/.
# 
# Software distributed under the License is distributed on an "AS IS"
# basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
# the License for the specific language governing rights and limitations
# under the License.
# 
# %CopyrightEnd%
#

#
# SSL - Makefile for Windows NT
#
# It is assumed that the following environment variables have been set:
#
# INCLUDE       X:\MSDEV\INCLUDE
# LIB           X:\MSDEV\LIB
#
# so that standard include files, and the socket library can be found.
#
# When ssl_esock.exe is run, the PATH environment variable must contain
# the name of a directory that contains ssleay32.dll and libeay32.dll,
# and windows socket dll.
#

# Roots
!ifndef OPENSSL_ROOT
!	error "Makefile.win32: ssl: OPENSSL_ROOT not set"
!endif

TARGET = win32

BINDIR = ..\priv\bin\$(TARGET)
OBJDIR = ..\priv\obj\$(TARGET)

!if !exist($(BINDIR)) 
!	if [mkdir $(BINDIR)]
!	error "SSL: cannot create BINDIR"
!	endif
!endif

!if !exist($(OBJDIR))
!	if [mkdir $(OBJDIR)]
!	error "SSL: cannot create OBJDIR"
!	endif
!endif

# Includes
#
OPENSSL_INCLUDE = $(OPENSSL_ROOT)\inc32

INCLUDES = /I. /I$(OPENSSL_INCLUDE)

# Libraries
#
OPENSSL_LIBDIR = $(OPENSSL_ROOT)\out32dll
OPENSSL_LIBS = \
	$(OPENSSL_LIBDIR)\ssleay32.lib \
	$(OPENSSL_LIBDIR)\libeay32.lib 

!ifdef ESOCK_WINSOCK2
WINSOCK_LIB = ws2_32.lib 
DEFS = -DESOCK_WINSOCK2
!else
WINSOCK_LIB = wsock32.lib
!endif	

# Compiler options
# 
# NOTE: Size of fd_set is set in esock_winsock.h but can be overridden
# with a -D option here.
#
OPTS = /MDd /G5 /Ox /O2 /Ob2 /Z7
DEFS = -D__WIN32__ -DWIN32 $(DEFS)
CFLAGS = $(INCLUDES) /nologo $(OPTS) $(DEFS)

# Object files
#
SSL_BASE_OBJS = \
	$(OBJDIR)\esock.obj \
	$(OBJDIR)\debuglog.obj \
	$(OBJDIR)\esock_poll$(obj) \
	$(OBJDIR)\esock_osio.obj \
	$(OBJDIR)\esock_utils.obj \
	$(OBJDIR)\esock_posix_str.obj

OPENSSL_OBJS = \
	$(OBJDIR)\esock_openssl.obj

#
# Targets
#

all:	$(SSL_BASE_OBJS) $(OPENSSL_OBJS) $(BINDIR)\ssl_esock.exe

clean: 
	del $(BINDIR)\*.exe
	del $(OBJDIR)\*.obj

# Inference rule .c.obj:
#
{.}.c{$(OBJDIR)}.obj:
	$(CC) $(CFLAGS) /c /Fo$@ $(*B).c

# Binary
#
$(BINDIR)\ssl_esock.exe:	$(SSL_BASE_OBJS) $(OPENSSL_OBJS)
	$(CC) /nologo  $(SSL_BASE_OBJS) $(OPENSSL_OBJS) $(OPENSSL_LIBS) \
		$(WINSOCK_LIB) /Fe$(BINDIR)\ssl_esock.exe



# Dependencies
#
$(OBJDIR)\esock.o:	esock.h debuglog.h esock_ssl.h esock_osio.h \
			esock_utils.h esock_winsock.h
$(OBJDIR)\debuglog.o:	debuglog.h esock_ssl.h esock_utils.h
$(OBJDIR)\esock_osio.o:	esock_osio.h esock.h debuglog.h esock_utils.h \
			esock_winsock.h
$(OBJDIR)\esock_utils.o:	esock_utils.h
$(OBJDIR)\esock_posix_str.o:	esock_posix_str.h esock_winsock.h

$(OBJDIR)\esock_openssl.o: 	esock.h esock_ssl.h debuglog.h esock_utils.h \
		                $(OPENSSL_INCLUDE)\crypto.h \
		                $(OPENSSL_INCLUDE)\ssl.h \
				$(OPENSSL_INCLUDE)\err.h