xref: /aoo4110/main/openssl/makefile.mk (revision b1cdbd2c)
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)" == "WNT"
114
115.IF "$(COM)"=="GCC"
116PATCH_FILES=opensslmingw.patch
117.IF "$(USE_MINGW)" == "cygwin"
118CONFIGURE_ACTION=$(PERL) configure
119CONFIGURE_FLAGS=mingw shared
120INSTALL_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
121OUT2LIB = libcrypto_static.*
122OUT2LIB += libssl_static.*
123OUT2LIB += libcrypto.*
124OUT2LIB += libssl.*
125OUT2BIN = ssleay32.dll
126OUT2BIN += libeay32.dll
127.ELSE
128CONFIGURE_ACTION=
129BUILD_ACTION=cmd /c "ms\mingw32"
130OUT2LIB = out/libcrypto_static.*
131OUT2LIB += out/libssl_static.*
132OUT2LIB += out/libcrypto.*
133OUT2LIB += out/libssl.*
134OUT2BIN = out/ssleay32.dll
135OUT2BIN += out/libeay32.dll
136.ENDIF
137.ELSE
138
139		PATCH_FILES=openssl.patch
140		.IF "$(MAKETARGETS)" == ""
141			# The env. vars CC and PERL are used by nmake, and nmake insists on '\'s
142			# If WRAPCMD is set it is prepended before the compiler, don't touch that.
143			.IF "$(WRAPCMD)"==""
144				CC!:=$(subst,/,\ $(normpath,1 $(CC)))
145				.EXPORT : CC
146			.ENDIF
147			PERL_bak:=$(PERL)
148			PERL!:=$(subst,/,\ $(normpath,1 $(PERL)))
149			.EXPORT : PERL
150			PERL!:=$(PERL_bak)
151		.ENDIF
152
153		#CONFIGURE_ACTION=cmd /c $(PERL:s!\!/!) configure
154		.IF "$(CPUNAME)"=="INTEL"
155			CONFIGURE_ACTION=$(PERL) configure $(NO_ASM)
156			CONFIGURE_FLAGS=VC-WIN32
157			.IF "$(NASM_PATH)"=="NO_NASM_HOME"
158			  BUILD_ACTION=cmd /c "ms$(EMQ)\do_ms.bat $(subst,/,\ $(normpath,1 $(PERL)))" && nmake -f ms/ntdll.mak
159			.ELSE
160			  BUILD_ACTION=cmd /c "ms$(EMQ)\do_nasm.bat $(subst,/,\ $(normpath,1 $(PERL)))" && nmake -f ms/ntdll.mak
161			.ENDIF
162		.ELIF "$(CPUNAME)"=="X86_64"
163			CONFIGURE_ACTION=$(PERL) configure $(NO_ASM)
164			CONFIGURE_FLAGS=VC-WIN64A
165			BUILD_ACTION=cmd /c "ms$(EMQ)\do_win64a.bat $(subst,/,\ $(normpath,1 $(PERL)))" && cmd /c "nmake -f ms/ntdll.mak"
166		.ENDIF
167
168		OUT2LIB = out32dll$/ssleay32.lib
169		OUT2LIB += out32dll$/libeay32.lib
170		OUT2BIN = out32dll$/ssleay32.dll
171		OUT2BIN += out32dll$/libeay32.dll
172		OUT2INC = inc32$/openssl$/*
173	.ENDIF
174.ENDIF
175
176#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 &&
177
178# --- Targets ------------------------------------------------------
179
180.INCLUDE : set_ext.mk
181.INCLUDE : target.mk
182.INCLUDE : tg_ext.mk
183
184