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