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