xref: /aoo41x/main/sal/util/makefile.mk (revision bd6bc7d0)
1*bd6bc7d0SJian Fang Zhang#**************************************************************
2*bd6bc7d0SJian Fang Zhang#
3*bd6bc7d0SJian Fang Zhang#  Licensed to the Apache Software Foundation (ASF) under one
4*bd6bc7d0SJian Fang Zhang#  or more contributor license agreements.  See the NOTICE file
5*bd6bc7d0SJian Fang Zhang#  distributed with this work for additional information
6*bd6bc7d0SJian Fang Zhang#  regarding copyright ownership.  The ASF licenses this file
7*bd6bc7d0SJian Fang Zhang#  to you under the Apache License, Version 2.0 (the
8*bd6bc7d0SJian Fang Zhang#  "License"); you may not use this file except in compliance
9*bd6bc7d0SJian Fang Zhang#  with the License.  You may obtain a copy of the License at
10*bd6bc7d0SJian Fang Zhang#
11*bd6bc7d0SJian Fang Zhang#    http://www.apache.org/licenses/LICENSE-2.0
12*bd6bc7d0SJian Fang Zhang#
13*bd6bc7d0SJian Fang Zhang#  Unless required by applicable law or agreed to in writing,
14*bd6bc7d0SJian Fang Zhang#  software distributed under the License is distributed on an
15*bd6bc7d0SJian Fang Zhang#  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16*bd6bc7d0SJian Fang Zhang#  KIND, either express or implied.  See the License for the
17*bd6bc7d0SJian Fang Zhang#  specific language governing permissions and limitations
18*bd6bc7d0SJian Fang Zhang#  under the License.
19*bd6bc7d0SJian Fang Zhang#
20*bd6bc7d0SJian Fang Zhang#**************************************************************
21*bd6bc7d0SJian Fang Zhang
22*bd6bc7d0SJian Fang Zhang
23*bd6bc7d0SJian Fang Zhang
24*bd6bc7d0SJian Fang ZhangPRJ=..
25*bd6bc7d0SJian Fang Zhang
26*bd6bc7d0SJian Fang ZhangPRJNAME=sal
27*bd6bc7d0SJian Fang ZhangTARGET=sal
28*bd6bc7d0SJian Fang Zhang
29*bd6bc7d0SJian Fang ZhangNO_BSYMBOLIC=TRUE
30*bd6bc7d0SJian Fang ZhangNO_DEFAULT_STL=TRUE
31*bd6bc7d0SJian Fang Zhang
32*bd6bc7d0SJian Fang ZhangUSE_LDUMP2=TRUE
33*bd6bc7d0SJian Fang ZhangUSE_DEFFILE=TRUE
34*bd6bc7d0SJian Fang Zhang
35*bd6bc7d0SJian Fang Zhang.IF "$(GUI)"=="UNX"
36*bd6bc7d0SJian Fang ZhangTARGETTYPE=CUI
37*bd6bc7d0SJian Fang Zhang.ENDIF # UNX
38*bd6bc7d0SJian Fang Zhang
39*bd6bc7d0SJian Fang ZhangUNIXVERSIONNAMES=UDK
40*bd6bc7d0SJian Fang Zhang
41*bd6bc7d0SJian Fang Zhang# --- Settings -----------------------------------------------------
42*bd6bc7d0SJian Fang Zhang
43*bd6bc7d0SJian Fang Zhang.INCLUDE :  settings.mk
44*bd6bc7d0SJian Fang Zhang
45*bd6bc7d0SJian Fang ZhangCFLAGS+= $(LFS_CFLAGS)
46*bd6bc7d0SJian Fang ZhangCXXFLAGS+= $(LFS_CFLAGS)
47*bd6bc7d0SJian Fang Zhang
48*bd6bc7d0SJian Fang Zhang.IF "$(depend)" == ""
49*bd6bc7d0SJian Fang Zhang
50*bd6bc7d0SJian Fang Zhang# --- Files --------------------------------------------------------
51*bd6bc7d0SJian Fang Zhang
52*bd6bc7d0SJian Fang Zhang# disable check for PIC code as it would complain about
53*bd6bc7d0SJian Fang Zhang# hand coded assembler
54*bd6bc7d0SJian Fang ZhangCHECKFORPIC=
55*bd6bc7d0SJian Fang Zhang
56*bd6bc7d0SJian Fang Zhang.IF "$(header)" == ""
57*bd6bc7d0SJian Fang Zhang
58*bd6bc7d0SJian Fang ZhangLIB1TARGET=$(SLB)$/$(TARGET).lib
59*bd6bc7d0SJian Fang ZhangLIB1FILES=	\
60*bd6bc7d0SJian Fang Zhang	$(SLB)$/oslall.lib	\
61*bd6bc7d0SJian Fang Zhang	$(SLB)$/cpposl.lib	\
62*bd6bc7d0SJian Fang Zhang	$(SLB)$/cpprtl.lib	\
63*bd6bc7d0SJian Fang Zhang	$(SLB)$/textenc.lib
64*bd6bc7d0SJian Fang Zhang
65*bd6bc7d0SJian Fang Zhang#.IF "$(GUI)"=="UNX"
66*bd6bc7d0SJian Fang Zhang#LIB1FILES+=$(SLB)$/systoolsunx.lib
67*bd6bc7d0SJian Fang Zhang#.ENDIF # UNX
68*bd6bc7d0SJian Fang Zhang
69*bd6bc7d0SJian Fang Zhang
70*bd6bc7d0SJian Fang ZhangLIB3TARGET=$(LB)$/a$(TARGET).lib
71*bd6bc7d0SJian Fang ZhangLIB3ARCHIV=$(LB)$/lib$(TARGET)$(DLLPOSTFIX).a
72*bd6bc7d0SJian Fang ZhangLIB3FILES=	\
73*bd6bc7d0SJian Fang Zhang	$(LB)$/oslall.lib	\
74*bd6bc7d0SJian Fang Zhang	$(LB)$/cpposl.lib	\
75*bd6bc7d0SJian Fang Zhang	$(LB)$/cpprtl.lib	\
76*bd6bc7d0SJian Fang Zhang	$(LB)$/textenc.lib
77*bd6bc7d0SJian Fang Zhang
78*bd6bc7d0SJian Fang Zhang#.IF "$(GUI)"=="UNX"
79*bd6bc7d0SJian Fang Zhang#LIB3FILES+=$(LB)$/systoolsunx.lib
80*bd6bc7d0SJian Fang Zhang#.ENDIF # UNX
81*bd6bc7d0SJian Fang Zhang
82*bd6bc7d0SJian Fang Zhang.IF "$(GUI)" == "WNT" || "$(GUI)"=="OS2"
83*bd6bc7d0SJian Fang ZhangSHL1TARGET= $(TARGET)
84*bd6bc7d0SJian Fang Zhang.ELSE
85*bd6bc7d0SJian Fang ZhangSHL1TARGET= uno_$(TARGET)
86*bd6bc7d0SJian Fang Zhang.ENDIF
87*bd6bc7d0SJian Fang ZhangSHL1IMPLIB= i$(TARGET)
88*bd6bc7d0SJian Fang ZhangSHL1VERSIONMAP=	$(TARGET).map
89*bd6bc7d0SJian Fang ZhangSHL1RPATH=URELIB
90*bd6bc7d0SJian Fang Zhang
91*bd6bc7d0SJian Fang Zhang.IF "$(GUI)"=="WNT"
92*bd6bc7d0SJian Fang Zhang
93*bd6bc7d0SJian Fang Zhang.IF "$(COM)"=="GCC"
94*bd6bc7d0SJian Fang ZhangUWINAPILIB=     -luwinapi
95*bd6bc7d0SJian Fang Zhang.ELSE
96*bd6bc7d0SJian Fang ZhangUWINAPILIB=     $(LB)$/uwinapi.lib
97*bd6bc7d0SJian Fang Zhang.ENDIF
98*bd6bc7d0SJian Fang Zhang
99*bd6bc7d0SJian Fang ZhangSHL1STDLIBS=	\
100*bd6bc7d0SJian Fang Zhang				$(UWINAPILIB)\
101*bd6bc7d0SJian Fang Zhang				$(ADVAPI32LIB)\
102*bd6bc7d0SJian Fang Zhang				$(WSOCK32LIB)\
103*bd6bc7d0SJian Fang Zhang				$(MPRLIB)\
104*bd6bc7d0SJian Fang Zhang				$(SHELL32LIB)\
105*bd6bc7d0SJian Fang Zhang				$(COMDLG32LIB)\
106*bd6bc7d0SJian Fang Zhang				$(USER32LIB)\
107*bd6bc7d0SJian Fang Zhang				$(OLE32LIB)
108*bd6bc7d0SJian Fang Zhang.IF "$(COM)"=="GCC"
109*bd6bc7d0SJian Fang ZhangMINGWSSTDOBJ=
110*bd6bc7d0SJian Fang ZhangMINGWSSTDENDOBJ=
111*bd6bc7d0SJian Fang Zhang.ENDIF
112*bd6bc7d0SJian Fang Zhang.ENDIF # WNT
113*bd6bc7d0SJian Fang Zhang
114*bd6bc7d0SJian Fang Zhang.IF "$(GUI)"=="UNX"
115*bd6bc7d0SJian Fang Zhang.IF "$(OS)"=="SOLARIS"
116*bd6bc7d0SJian Fang Zhang# libposix4.so (SunOS 5.6) <-> librt.so (SunOS >= 5.7)
117*bd6bc7d0SJian Fang ZhangSHL1STDLIBS= -Bdynamic -ldl -lpthread -lposix4 -lsocket -lnsl
118*bd6bc7d0SJian Fang Zhang.IF "$(COM)" == "C50"
119*bd6bc7d0SJian Fang ZhangSHL1STDLIBS+= -z allextract -staticlib=Crun -z defaultextract
120*bd6bc7d0SJian Fang Zhang.ENDIF # C50
121*bd6bc7d0SJian Fang Zhang.ENDIF # SOLARIS
122*bd6bc7d0SJian Fang Zhang.ENDIF # UNX
123*bd6bc7d0SJian Fang Zhang
124*bd6bc7d0SJian Fang Zhang.IF "$(GUI)"=="OS2"
125*bd6bc7d0SJian Fang ZhangSHL1STDLIBS=-lmmap -lpthread
126*bd6bc7d0SJian Fang Zhang.ENDIF # OS2
127*bd6bc7d0SJian Fang Zhang
128*bd6bc7d0SJian Fang Zhang# If we compile sal with STLport checking iterators
129*bd6bc7d0SJian Fang Zhang# we need to link against the STLport
130*bd6bc7d0SJian Fang Zhang.IF "$(USE_STLP_DEBUG)" != ""
131*bd6bc7d0SJian Fang ZhangSHL1STDLIBS+=$(LIBSTLPORT)
132*bd6bc7d0SJian Fang Zhang.ENDIF
133*bd6bc7d0SJian Fang Zhang
134*bd6bc7d0SJian Fang Zhang#The irony that using the system STL instead of
135*bd6bc7d0SJian Fang Zhang#stlport requires that we link libsal with the
136*bd6bc7d0SJian Fang Zhang#LIBSTLPORT alias which is not required when using
137*bd6bc7d0SJian Fang Zhang#stlport is not lost on me
138*bd6bc7d0SJian Fang Zhang.IF "$(USE_SYSTEM_STL)"=="YES"
139*bd6bc7d0SJian Fang ZhangSHL1STDLIBS+=$(LIBSTLPORT)
140*bd6bc7d0SJian Fang Zhang.ENDIF
141*bd6bc7d0SJian Fang Zhang
142*bd6bc7d0SJian Fang Zhang.IF "$(OS)"=="MACOSX"
143*bd6bc7d0SJian Fang ZhangSHL1STDLIBS+=-framework CoreFoundation -framework Carbon
144*bd6bc7d0SJian Fang Zhang.ENDIF
145*bd6bc7d0SJian Fang Zhang
146*bd6bc7d0SJian Fang Zhang.IF "$(OS)" == "LINUX"
147*bd6bc7d0SJian Fang Zhang.IF "$(PAM_LINK)" == "YES"
148*bd6bc7d0SJian Fang ZhangSHL1STDLIBS+=-lpam
149*bd6bc7d0SJian Fang Zhang.ENDIF
150*bd6bc7d0SJian Fang Zhang.IF "$(CRYPT_LINK)" == "YES"
151*bd6bc7d0SJian Fang ZhangSHL1STDLIBS+=-lcrypt
152*bd6bc7d0SJian Fang Zhang.ENDIF
153*bd6bc7d0SJian Fang Zhang.ENDIF
154*bd6bc7d0SJian Fang Zhang
155*bd6bc7d0SJian Fang Zhang# #i105898# required for LD_PRELOAD libsalalloc_malloc.so
156*bd6bc7d0SJian Fang Zhang#           if sal is linked with -Bsymbolic-functions
157*bd6bc7d0SJian Fang Zhang.IF "$(HAVE_LD_BSYMBOLIC_FUNCTIONS)" == "TRUE"
158*bd6bc7d0SJian Fang ZhangSHL1LINKFLAGS+=-Wl,--dynamic-list=salalloc.list
159*bd6bc7d0SJian Fang Zhang.ENDIF # .IF "$(HAVE_LD_BSYMBOLIC_FUNCTIONS)" == "TRUE"
160*bd6bc7d0SJian Fang Zhang
161*bd6bc7d0SJian Fang ZhangSHL1LIBS+=$(SLB)$/$(TARGET).lib
162*bd6bc7d0SJian Fang Zhang
163*bd6bc7d0SJian Fang Zhang.IF "$(linkinc)" != ""
164*bd6bc7d0SJian Fang ZhangSHL11FILE=$(MISC)$/sal.slo
165*bd6bc7d0SJian Fang Zhang.ELSE
166*bd6bc7d0SJian Fang Zhang.IF "$(GUI)"=="UNX"
167*bd6bc7d0SJian Fang ZhangSHL1OBJS=
168*bd6bc7d0SJian Fang Zhang.ELSE
169*bd6bc7d0SJian Fang Zhang.IF "$(GUI)$(COM)"!="WNTGCC"
170*bd6bc7d0SJian Fang ZhangSHL1OBJS= \
171*bd6bc7d0SJian Fang Zhang    $(SLO)$/dllentry.obj
172*bd6bc7d0SJian Fang Zhang.ENDIF # WNTGCC
173*bd6bc7d0SJian Fang Zhang.ENDIF # UNX
174*bd6bc7d0SJian Fang Zhang.ENDIF # lincinc
175*bd6bc7d0SJian Fang Zhang
176*bd6bc7d0SJian Fang ZhangSHL1DEPN=
177*bd6bc7d0SJian Fang ZhangSHL1DEF=    $(MISC)$/$(SHL1TARGET).def
178*bd6bc7d0SJian Fang Zhang
179*bd6bc7d0SJian Fang ZhangDEF1NAME= $(SHL1TARGET)
180*bd6bc7d0SJian Fang Zhang
181*bd6bc7d0SJian Fang Zhang#
182*bd6bc7d0SJian Fang Zhang# This part builds a tiny extra lib,
183*bd6bc7d0SJian Fang Zhang# containing an alloc.c which uses system
184*bd6bc7d0SJian Fang Zhang# heap instead of our own mem management.
185*bd6bc7d0SJian Fang Zhang# This is e.g. useful for proper valgrinding
186*bd6bc7d0SJian Fang Zhang# the office.
187*bd6bc7d0SJian Fang Zhang#
188*bd6bc7d0SJian Fang Zhang.IF "$(OS)"=="LINUX"
189*bd6bc7d0SJian Fang Zhang
190*bd6bc7d0SJian Fang ZhangTARGET2 = salalloc_malloc
191*bd6bc7d0SJian Fang ZhangSHL2TARGET= $(TARGET2)
192*bd6bc7d0SJian Fang ZhangSHL2IMPLIB= i$(TARGET2)
193*bd6bc7d0SJian Fang ZhangSHL2VERSIONMAP=	salalloc.map
194*bd6bc7d0SJian Fang Zhang
195*bd6bc7d0SJian Fang ZhangSHL2LIBS+=$(SLB)$/SYSALLOC_cpprtl.lib
196*bd6bc7d0SJian Fang Zhang
197*bd6bc7d0SJian Fang Zhang.ENDIF # .IF "$(OS)"=="LINUX"
198*bd6bc7d0SJian Fang Zhang
199*bd6bc7d0SJian Fang Zhang# --- Coverage -----------------------------------------------------
200*bd6bc7d0SJian Fang Zhang# LLA: 20040304 The follows lines are an additional which is only need if we run
201*bd6bc7d0SJian Fang Zhang#               coverage tests. For normal test runs this feature is not used.
202*bd6bc7d0SJian Fang Zhang#               For more information about coverage tests see:
203*bd6bc7d0SJian Fang Zhang#               http://gcc.gnu.org/onlinedocs/gcc-3.0/gcc_8.html
204*bd6bc7d0SJian Fang Zhang#
205*bd6bc7d0SJian Fang Zhang#               Why this additional?
206*bd6bc7d0SJian Fang Zhang#               Anybody has decide to link sal with g++ instead of gcc.
207*bd6bc7d0SJian Fang Zhang#
208*bd6bc7d0SJian Fang Zhang.IF "$(TESTCOVERAGE)"!=""
209*bd6bc7d0SJian Fang Zhang.IF "$(GUI)"=="UNX"
210*bd6bc7d0SJian Fang Zhang.IF "$(COM)"=="GCC"
211*bd6bc7d0SJian Fang Zhang.IF "$(OS)"=="LINUX"
212*bd6bc7d0SJian Fang ZhangSHL1STDLIBS+=-lgcc
213*bd6bc7d0SJian Fang Zhang.ENDIF
214*bd6bc7d0SJian Fang Zhang.ENDIF
215*bd6bc7d0SJian Fang Zhang.ENDIF
216*bd6bc7d0SJian Fang Zhang.ENDIF
217*bd6bc7d0SJian Fang Zhang
218*bd6bc7d0SJian Fang Zhang# --- Targets ------------------------------------------------------
219*bd6bc7d0SJian Fang Zhang
220*bd6bc7d0SJian Fang Zhang.ENDIF # $(header) != ""
221*bd6bc7d0SJian Fang Zhang.ENDIF # $(depend) != ""
222*bd6bc7d0SJian Fang Zhang
223*bd6bc7d0SJian Fang Zhang.INCLUDE :  target.mk
224*bd6bc7d0SJian Fang Zhang
225*bd6bc7d0SJian Fang Zhang.IF "$(SHL1TARGETN)" != ""
226*bd6bc7d0SJian Fang Zhang$(SHL1TARGETN) : $(OUT)$/inc$/udkversion.h
227*bd6bc7d0SJian Fang Zhang.ENDIF # "$(SHL1TARGETN)" != ""
228*bd6bc7d0SJian Fang Zhang
229*bd6bc7d0SJian Fang Zhang$(OUT)$/inc$/udkversion.h:
230*bd6bc7d0SJian Fang Zhang	echo '#ifndef _SAL_UDKVERSION_H_'           >  $@
231*bd6bc7d0SJian Fang Zhang	echo '#define _SAL_UDKVERSION_H_'           >> $@
232*bd6bc7d0SJian Fang Zhang	echo ''                                     >> $@
233*bd6bc7d0SJian Fang Zhang	echo '#define SAL_UDK_MAJOR "$(UDK_MAJOR)"' >> $@
234*bd6bc7d0SJian Fang Zhang	echo '#define SAL_UDK_MINOR "$(UDK_MINOR)"' >> $@
235*bd6bc7d0SJian Fang Zhang	echo '#define SAL_UDK_MICRO "$(UDK_MICRO)"' >> $@
236*bd6bc7d0SJian Fang Zhang	echo ''                                     >> $@
237*bd6bc7d0SJian Fang Zhang	echo '#endif'                               >> $@
238