xref: /AOO41X/main/sal/util/makefile.mk (revision b597708ba18998e5b62934c916addb8de3415a8a)
17871dc3eSAndrew Rist#**************************************************************
2cdf0e10cSrcweir#
37871dc3eSAndrew Rist#  Licensed to the Apache Software Foundation (ASF) under one
47871dc3eSAndrew Rist#  or more contributor license agreements.  See the NOTICE file
57871dc3eSAndrew Rist#  distributed with this work for additional information
67871dc3eSAndrew Rist#  regarding copyright ownership.  The ASF licenses this file
77871dc3eSAndrew Rist#  to you under the Apache License, Version 2.0 (the
87871dc3eSAndrew Rist#  "License"); you may not use this file except in compliance
97871dc3eSAndrew Rist#  with the License.  You may obtain a copy of the License at
10cdf0e10cSrcweir#
117871dc3eSAndrew Rist#    http://www.apache.org/licenses/LICENSE-2.0
12cdf0e10cSrcweir#
137871dc3eSAndrew Rist#  Unless required by applicable law or agreed to in writing,
147871dc3eSAndrew Rist#  software distributed under the License is distributed on an
157871dc3eSAndrew Rist#  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
167871dc3eSAndrew Rist#  KIND, either express or implied.  See the License for the
177871dc3eSAndrew Rist#  specific language governing permissions and limitations
187871dc3eSAndrew Rist#  under the License.
19cdf0e10cSrcweir#
207871dc3eSAndrew Rist#**************************************************************
217871dc3eSAndrew Rist
227871dc3eSAndrew Rist
23cdf0e10cSrcweir
24cdf0e10cSrcweirPRJ=..
25cdf0e10cSrcweir
26cdf0e10cSrcweirPRJNAME=sal
27cdf0e10cSrcweirTARGET=sal
28cdf0e10cSrcweir
29cdf0e10cSrcweirNO_BSYMBOLIC=TRUE
30cdf0e10cSrcweirNO_DEFAULT_STL=TRUE
31cdf0e10cSrcweir
32cdf0e10cSrcweirUSE_LDUMP2=TRUE
33cdf0e10cSrcweirUSE_DEFFILE=TRUE
34cdf0e10cSrcweir
35cdf0e10cSrcweir.IF "$(GUI)"=="UNX"
36cdf0e10cSrcweirTARGETTYPE=CUI
37cdf0e10cSrcweir.ENDIF # UNX
38cdf0e10cSrcweir
39cdf0e10cSrcweirUNIXVERSIONNAMES=UDK
40cdf0e10cSrcweir
41cdf0e10cSrcweir# --- Settings -----------------------------------------------------
42cdf0e10cSrcweir
43cdf0e10cSrcweir.INCLUDE :  settings.mk
44cdf0e10cSrcweir
45cdf0e10cSrcweirCFLAGS+= $(LFS_CFLAGS)
46cdf0e10cSrcweirCXXFLAGS+= $(LFS_CFLAGS)
47cdf0e10cSrcweir
48cdf0e10cSrcweir.IF "$(depend)" == ""
49cdf0e10cSrcweir
50cdf0e10cSrcweir# --- Files --------------------------------------------------------
51cdf0e10cSrcweir
52cdf0e10cSrcweir# disable check for PIC code as it would complain about
53cdf0e10cSrcweir# hand coded assembler
54cdf0e10cSrcweirCHECKFORPIC=
55cdf0e10cSrcweir
56cdf0e10cSrcweir.IF "$(header)" == ""
57cdf0e10cSrcweir
58cdf0e10cSrcweirLIB1TARGET=$(SLB)$/$(TARGET).lib
59cdf0e10cSrcweirLIB1FILES=	\
60cdf0e10cSrcweir	$(SLB)$/oslall.lib	\
61cdf0e10cSrcweir	$(SLB)$/cpposl.lib	\
62cdf0e10cSrcweir	$(SLB)$/cpprtl.lib	\
63cdf0e10cSrcweir	$(SLB)$/textenc.lib
64cdf0e10cSrcweir
65cdf0e10cSrcweir#.IF "$(GUI)"=="UNX"
66cdf0e10cSrcweir#LIB1FILES+=$(SLB)$/systoolsunx.lib
67cdf0e10cSrcweir#.ENDIF # UNX
68cdf0e10cSrcweir
69cdf0e10cSrcweir
70cdf0e10cSrcweirLIB3TARGET=$(LB)$/a$(TARGET).lib
71cdf0e10cSrcweirLIB3ARCHIV=$(LB)$/lib$(TARGET)$(DLLPOSTFIX).a
72cdf0e10cSrcweirLIB3FILES=	\
73cdf0e10cSrcweir	$(LB)$/oslall.lib	\
74cdf0e10cSrcweir	$(LB)$/cpposl.lib	\
75cdf0e10cSrcweir	$(LB)$/cpprtl.lib	\
76cdf0e10cSrcweir	$(LB)$/textenc.lib
77cdf0e10cSrcweir
78cdf0e10cSrcweir#.IF "$(GUI)"=="UNX"
79cdf0e10cSrcweir#LIB3FILES+=$(LB)$/systoolsunx.lib
80cdf0e10cSrcweir#.ENDIF # UNX
81cdf0e10cSrcweir
82cdf0e10cSrcweir.IF "$(GUI)" == "WNT" || "$(GUI)"=="OS2"
83cdf0e10cSrcweirSHL1TARGET= $(TARGET)
84cdf0e10cSrcweir.ELSE
85cdf0e10cSrcweirSHL1TARGET= uno_$(TARGET)
86cdf0e10cSrcweir.ENDIF
87cdf0e10cSrcweirSHL1IMPLIB= i$(TARGET)
88cdf0e10cSrcweirSHL1VERSIONMAP=	$(TARGET).map
89cdf0e10cSrcweirSHL1RPATH=URELIB
90cdf0e10cSrcweir
91cdf0e10cSrcweir.IF "$(GUI)"=="WNT"
92cdf0e10cSrcweir
93cdf0e10cSrcweir.IF "$(COM)"=="GCC"
94cdf0e10cSrcweirUWINAPILIB=     -luwinapi
95cdf0e10cSrcweir.ELSE
96cdf0e10cSrcweirUWINAPILIB=     $(LB)$/uwinapi.lib
97cdf0e10cSrcweir.ENDIF
98cdf0e10cSrcweir
99cdf0e10cSrcweirSHL1STDLIBS=	\
100cdf0e10cSrcweir				$(UWINAPILIB)\
101cdf0e10cSrcweir				$(ADVAPI32LIB)\
102cdf0e10cSrcweir				$(WSOCK32LIB)\
103cdf0e10cSrcweir				$(MPRLIB)\
104cdf0e10cSrcweir				$(SHELL32LIB)\
105cdf0e10cSrcweir				$(COMDLG32LIB)\
106cdf0e10cSrcweir				$(USER32LIB)\
107cdf0e10cSrcweir				$(OLE32LIB)
108cdf0e10cSrcweir.IF "$(COM)"=="GCC"
109cdf0e10cSrcweirMINGWSSTDOBJ=
110cdf0e10cSrcweirMINGWSSTDENDOBJ=
111cdf0e10cSrcweir.ENDIF
112cdf0e10cSrcweir.ENDIF # WNT
113cdf0e10cSrcweir
114cdf0e10cSrcweir.IF "$(GUI)"=="UNX"
115cdf0e10cSrcweir.IF "$(OS)"=="SOLARIS"
116cdf0e10cSrcweir# libposix4.so (SunOS 5.6) <-> librt.so (SunOS >= 5.7)
117cdf0e10cSrcweirSHL1STDLIBS= -Bdynamic -ldl -lpthread -lposix4 -lsocket -lnsl
118cdf0e10cSrcweir.IF "$(COM)" == "C50"
119cdf0e10cSrcweirSHL1STDLIBS+= -z allextract -staticlib=Crun -z defaultextract
120cdf0e10cSrcweir.ENDIF # C50
121cdf0e10cSrcweir.ENDIF # SOLARIS
122cdf0e10cSrcweir.ENDIF # UNX
123cdf0e10cSrcweir
124cdf0e10cSrcweir.IF "$(GUI)"=="OS2"
125*685bfa88SYuri DarioSHL1STDLIBS=-lmmap -lpthread
126cdf0e10cSrcweir.ENDIF # OS2
127cdf0e10cSrcweir
128cdf0e10cSrcweir.IF "$(OS)"=="MACOSX"
129cdf0e10cSrcweirSHL1STDLIBS+=-framework CoreFoundation -framework Carbon
130cdf0e10cSrcweir.ENDIF
131cdf0e10cSrcweir
132cdf0e10cSrcweir.IF "$(OS)" == "LINUX"
133cdf0e10cSrcweir.IF "$(PAM_LINK)" == "YES"
134cdf0e10cSrcweirSHL1STDLIBS+=-lpam
135cdf0e10cSrcweir.ENDIF
136cdf0e10cSrcweir.IF "$(CRYPT_LINK)" == "YES"
137cdf0e10cSrcweirSHL1STDLIBS+=-lcrypt
138cdf0e10cSrcweir.ENDIF
139cdf0e10cSrcweir.ENDIF
140cdf0e10cSrcweir
141cdf0e10cSrcweir# #i105898# required for LD_PRELOAD libsalalloc_malloc.so
142cdf0e10cSrcweir#           if sal is linked with -Bsymbolic-functions
143cdf0e10cSrcweir.IF "$(HAVE_LD_BSYMBOLIC_FUNCTIONS)" == "TRUE"
144cdf0e10cSrcweirSHL1LINKFLAGS+=-Wl,--dynamic-list=salalloc.list
145cdf0e10cSrcweir.ENDIF # .IF "$(HAVE_LD_BSYMBOLIC_FUNCTIONS)" == "TRUE"
146cdf0e10cSrcweir
147cdf0e10cSrcweirSHL1LIBS+=$(SLB)$/$(TARGET).lib
148cdf0e10cSrcweir
149cdf0e10cSrcweir.IF "$(linkinc)" != ""
150cdf0e10cSrcweirSHL11FILE=$(MISC)$/sal.slo
151cdf0e10cSrcweir.ELSE
152cdf0e10cSrcweir.IF "$(GUI)"=="UNX"
153cdf0e10cSrcweirSHL1OBJS=
154cdf0e10cSrcweir.ELSE
155cdf0e10cSrcweir.IF "$(GUI)$(COM)"!="WNTGCC"
156cdf0e10cSrcweirSHL1OBJS= \
157cdf0e10cSrcweir    $(SLO)$/dllentry.obj
158cdf0e10cSrcweir.ENDIF # WNTGCC
159cdf0e10cSrcweir.ENDIF # UNX
160cdf0e10cSrcweir.ENDIF # lincinc
161cdf0e10cSrcweir
162cdf0e10cSrcweirSHL1DEPN=
163cdf0e10cSrcweirSHL1DEF=    $(MISC)$/$(SHL1TARGET).def
164cdf0e10cSrcweir
165cdf0e10cSrcweirDEF1NAME= $(SHL1TARGET)
166cdf0e10cSrcweir
167cdf0e10cSrcweir#
168cdf0e10cSrcweir# This part builds a tiny extra lib,
169cdf0e10cSrcweir# containing an alloc.c which uses system
170cdf0e10cSrcweir# heap instead of our own mem management.
171cdf0e10cSrcweir# This is e.g. useful for proper valgrinding
172cdf0e10cSrcweir# the office.
173cdf0e10cSrcweir#
174cdf0e10cSrcweir.IF "$(OS)"=="LINUX"
175cdf0e10cSrcweir
176cdf0e10cSrcweirTARGET2 = salalloc_malloc
177cdf0e10cSrcweirSHL2TARGET= $(TARGET2)
178cdf0e10cSrcweirSHL2IMPLIB= i$(TARGET2)
179cdf0e10cSrcweirSHL2VERSIONMAP=	salalloc.map
180cdf0e10cSrcweir
181cdf0e10cSrcweirSHL2LIBS+=$(SLB)$/SYSALLOC_cpprtl.lib
182cdf0e10cSrcweir
183cdf0e10cSrcweir.ENDIF # .IF "$(OS)"=="LINUX"
184cdf0e10cSrcweir
185cdf0e10cSrcweir# --- Coverage -----------------------------------------------------
186cdf0e10cSrcweir# LLA: 20040304 The follows lines are an additional which is only need if we run
187cdf0e10cSrcweir#               coverage tests. For normal test runs this feature is not used.
188cdf0e10cSrcweir#               For more information about coverage tests see:
189cdf0e10cSrcweir#               http://gcc.gnu.org/onlinedocs/gcc-3.0/gcc_8.html
190cdf0e10cSrcweir#
191cdf0e10cSrcweir#               Why this additional?
192cdf0e10cSrcweir#               Anybody has decide to link sal with g++ instead of gcc.
193cdf0e10cSrcweir#
194cdf0e10cSrcweir.IF "$(TESTCOVERAGE)"!=""
195cdf0e10cSrcweir.IF "$(GUI)"=="UNX"
196cdf0e10cSrcweir.IF "$(COM)"=="GCC"
197cdf0e10cSrcweir.IF "$(OS)"=="LINUX"
198cdf0e10cSrcweirSHL1STDLIBS+=-lgcc
199cdf0e10cSrcweir.ENDIF
200cdf0e10cSrcweir.ENDIF
201cdf0e10cSrcweir.ENDIF
202cdf0e10cSrcweir.ENDIF
203cdf0e10cSrcweir
204cdf0e10cSrcweir# --- Targets ------------------------------------------------------
205cdf0e10cSrcweir
206cdf0e10cSrcweir.ENDIF # $(header) != ""
207cdf0e10cSrcweir.ENDIF # $(depend) != ""
208cdf0e10cSrcweir
209cdf0e10cSrcweir.INCLUDE :  target.mk
210cdf0e10cSrcweir
211cdf0e10cSrcweir.IF "$(SHL1TARGETN)" != ""
212cdf0e10cSrcweir$(SHL1TARGETN) : $(OUT)$/inc$/udkversion.h
213cdf0e10cSrcweir.ENDIF # "$(SHL1TARGETN)" != ""
214cdf0e10cSrcweir
215cdf0e10cSrcweir$(OUT)$/inc$/udkversion.h:
216cdf0e10cSrcweir	echo '#ifndef _SAL_UDKVERSION_H_'           >  $@
217cdf0e10cSrcweir	echo '#define _SAL_UDKVERSION_H_'           >> $@
218cdf0e10cSrcweir	echo ''                                     >> $@
219cdf0e10cSrcweir	echo '#define SAL_UDK_MAJOR "$(UDK_MAJOR)"' >> $@
220cdf0e10cSrcweir	echo '#define SAL_UDK_MINOR "$(UDK_MINOR)"' >> $@
221cdf0e10cSrcweir	echo '#define SAL_UDK_MICRO "$(UDK_MICRO)"' >> $@
222cdf0e10cSrcweir	echo ''                                     >> $@
223cdf0e10cSrcweir	echo '#endif'                               >> $@
224