xref: /trunk/main/openssl/makefile.mk (revision 89dcc3fe)
1#**************************************************************
2#
3#  Licensed to the Apache Software Foundation (ASF) under one
4#  or more contributor license agreements.  See the NOTICE file
5#  distributed with this work for additional information
6#  regarding copyright ownership.  The ASF licenses this file
7#  to you under the Apache License, Version 2.0 (the
8#  "License"); you may not use this file except in compliance
9#  with the License.  You may obtain a copy of the License at
10#
11#    http://www.apache.org/licenses/LICENSE-2.0
12#
13#  Unless required by applicable law or agreed to in writing,
14#  software distributed under the License is distributed on an
15#  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16#  KIND, either express or implied.  See the License for the
17#  specific language governing permissions and limitations
18#  under the License.
19#
20#**************************************************************
21
22
23
24PRJ=.
25
26PRJNAME=openssl
27TARGET=openssl
28
29# --- Settings -----------------------------------------------------
30
31.INCLUDE :	settings.mk
32
33# --- Files --------------------------------------------------------
34
35.IF "$(SYSTEM_OPENSSL)" == "YES"
36@all:
37	@echo "Using system openssl...."
38.ENDIF
39
40.IF "$(DISABLE_OPENSSL)" == "TRUE"
41@all:
42	@echo "openssl disabled...."
43.ENDIF
44
45OPENSSL_NAME=openssl-1.0.2u
46
47TARFILE_NAME=$(OPENSSL_NAME)
48TARFILE_MD5=cdc2638f789ecc2db2c91488265686c1
49
50CONFIGURE_DIR=.
51CONFIGURE_ACTION=config
52CONFIGURE_FLAGS=-I$(SYSBASE)$/usr$/include -L$(SYSBASE)$/usr$/lib shared
53
54BUILD_DIR=.
55BUILD_ACTION=make CC='$(CC)' build_libs
56
57OUT2LIB = libssl.*
58OUT2LIB += libcrypto.*
59OUT2INC += include/openssl/*
60
61UNAME=$(shell uname)
62
63.IF "$(COM)"=="GCC" && "$(CCNUMVER)">="000400060000" || "$(OS)"=="WNT" && "$(NASM_PATH)"=="NO_NASM_HOME"
64  NO_ASM="no-asm"
65.ELSE
66  NO_ASM=
67.ENDIF
68
69.IF "$(OS)" == "LINUX" || "$(OS)" == "FREEBSD"
70	PATCH_FILES=openssllnx.patch
71	.IF "$(CPU)" == "I"
72		.IF "$(UNAME)" == "GNU/kFreeBSD"
73			CONFIGURE_ACTION=Configure debian-kfreebsd-i386 no-dso no-shared $(NO_ASM)
74		.ELIF "$(UNAME)" == "FreeBSD"
75			CONFIGURE_ACTION=Configure BSD-x86-elf no-dso no-shared $(NO_ASM)
76		.ELSE
77			CONFIGURE_ACTION=Configure linux-generic32 no-dso no-shared $(NO_ASM)
78		.ENDIF
79	.ELIF "$(BUILD64)" == "1"
80		.IF "$(UNAME)" == "GNU/kFreeBSD"
81			CONFIGURE_ACTION=Configure debian-kfreebsd-amd64 no-dso no-shared $(NO_ASM)
82		.ELIF "$(UNAME)" == "FreeBSD"
83			CONFIGURE_ACTION=Configure BSD-x86_64 no-dso no-shared $(NO_ASM)
84		.ELSE
85			CONFIGURE_ACTION=Configure linux-x86_64 no-dso no-shared $(NO_ASM)
86		.ENDIF
87	.ELSE
88		CONFIGURE_ACTION=Configure linux-generic32 no-dso no-shared $(NO_ASM)
89	.ENDIF
90	# if you build openssl as shared library you have to patch the Makefile.Shared "LD_LIBRARY_PATH=$$LD_LIBRARY_PATH \"
91	#BUILD_ACTION=make 'SHARED_LDFLAGS=-Wl,--version-script=./lib$$(SHLIBDIRS)_OOo_0_9_8e.map'
92.ENDIF
93
94.IF "$(OS)" == "SOLARIS"
95	PATCH_FILES=opensslsol.patch
96	#BUILD_ACTION=make 'SHARED_LDFLAGS=-G -dy -z text -M./lib$$$$$$$$(SHLIBDIRS)_OOo_0_9_8e.map'
97
98	# Use BUILD64 when 1 to select new specific 64bit Configurations if necessary
99
100	.IF "$(CPUNAME)" == "INTEL" # Solaris INTEL
101		.IF "$(CPU)" == "X"
102		   CONFIGURE_ACTION=Configure solaris64-x86_64-cc
103		.ELSE
104		   CONFIGURE_ACTION=Configure solaris-x86-cc
105		.ENDIF
106	.ELIF "$(CPU)" == "U" # Solaris SPARC
107	   CONFIGURE_ACTION=Configure solaris64-sparcv9-cc
108	.ELSE
109	   CONFIGURE_ACTION=Configure solaris-sparcv9-cc
110	.ENDIF
111.ENDIF
112
113.IF "$(OS)" == "MACOSX"
114	CONFIGURE_ACTION=Configure darwin64-x86_64-cc no-dso no-shared $(NO_ASM)
115.ENDIF
116
117.IF "$(OS)" == "WNT"
118
119.IF "$(COM)"=="GCC"
120PATCH_FILES=opensslmingw.patch
121.IF "$(USE_MINGW)" == "cygwin"
122CONFIGURE_ACTION=$(PERL) configure
123CONFIGURE_FLAGS=mingw shared
124INSTALL_ACTION=mv libcrypto.a libcrypto_static.a && mv libcrypto.dll.a libcrypto.a && mv libssl.a libssl_static.a && mv libssl.dll.a libssl.a
125OUT2LIB = libcrypto_static.*
126OUT2LIB += libssl_static.*
127OUT2LIB += libcrypto.*
128OUT2LIB += libssl.*
129OUT2BIN = ssleay32.dll
130OUT2BIN += libeay32.dll
131.ELSE
132CONFIGURE_ACTION=
133BUILD_ACTION=cmd /c "ms\mingw32"
134OUT2LIB = out/libcrypto_static.*
135OUT2LIB += out/libssl_static.*
136OUT2LIB += out/libcrypto.*
137OUT2LIB += out/libssl.*
138OUT2BIN = out/ssleay32.dll
139OUT2BIN += out/libeay32.dll
140.ENDIF
141.ELSE
142
143		PATCH_FILES=openssl.patch
144		.IF "$(MAKETARGETS)" == ""
145			# The env. vars CC and PERL are used by nmake, and nmake insists on '\'s
146			# If WRAPCMD is set it is prepended before the compiler, don't touch that.
147			.IF "$(WRAPCMD)"==""
148				CC!:=$(subst,/,\ $(normpath,1 $(CC)))
149				.EXPORT : CC
150			.ENDIF
151			PERL_bak:=$(PERL)
152			PERL!:=$(subst,/,\ $(normpath,1 $(PERL)))
153			.EXPORT : PERL
154			PERL!:=$(PERL_bak)
155		.ENDIF
156
157		#CONFIGURE_ACTION=cmd /c $(PERL:s!\!/!) configure
158		.IF "$(CPUNAME)"=="INTEL"
159			CONFIGURE_ACTION=$(PERL) configure $(NO_ASM)
160			CONFIGURE_FLAGS=VC-WIN32
161			.IF "$(NASM_PATH)"=="NO_NASM_HOME"
162			  BUILD_ACTION=cmd /c "ms$(EMQ)\do_ms.bat $(subst,/,\ $(normpath,1 $(PERL)))" && nmake -f ms/ntdll.mak
163			.ELSE
164			  BUILD_ACTION=cmd /c "ms$(EMQ)\do_nasm.bat $(subst,/,\ $(normpath,1 $(PERL)))" && nmake -f ms/ntdll.mak
165			.ENDIF
166		.ELIF "$(CPUNAME)"=="X86_64"
167			CONFIGURE_ACTION=$(PERL) configure $(NO_ASM)
168			CONFIGURE_FLAGS=VC-WIN64A
169			BUILD_ACTION=cmd /c "ms$(EMQ)\do_win64a.bat $(subst,/,\ $(normpath,1 $(PERL)))" && cmd /c "nmake -f ms/ntdll.mak"
170		.ENDIF
171
172		OUT2LIB = out32dll$/ssleay32.lib
173		OUT2LIB += out32dll$/libeay32.lib
174		OUT2BIN = out32dll$/ssleay32.dll
175		OUT2BIN += out32dll$/libeay32.dll
176		OUT2INC = inc32$/openssl$/*
177	.ENDIF
178.ENDIF
179
180#set INCLUDE=D:\sol_temp\n\msvc7net3\PlatformSDK\include;D:\sol_temp\n\msvc7net3\include\ && set path=%path%;D:\sol_temp\r\btw\SRC680\perl\bin &&
181
182# --- Targets ------------------------------------------------------
183
184.INCLUDE : set_ext.mk
185.INCLUDE : target.mk
186.INCLUDE : tg_ext.mk
187
188