xref: /trunk/main/sal/util/makefile.mk (revision 31bbceb0f9d64c0c2c3b22a794a1666c1f33396e)
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
39*d92161c4SJim Jagielski.IF "$(OS)" != "MACOSX"
40cdf0e10cSrcweirUNIXVERSIONNAMES=UDK
41*d92161c4SJim Jagielski.ENDIF
42cdf0e10cSrcweir
43cdf0e10cSrcweir# --- Settings -----------------------------------------------------
44cdf0e10cSrcweir
45cdf0e10cSrcweir.INCLUDE :  settings.mk
46cdf0e10cSrcweir
47cdf0e10cSrcweirCFLAGS+= $(LFS_CFLAGS)
48cdf0e10cSrcweirCXXFLAGS+= $(LFS_CFLAGS)
49cdf0e10cSrcweir
50cdf0e10cSrcweir.IF "$(depend)" == ""
51cdf0e10cSrcweir
52cdf0e10cSrcweir# --- Files --------------------------------------------------------
53cdf0e10cSrcweir
54cdf0e10cSrcweir# disable check for PIC code as it would complain about
55cdf0e10cSrcweir# hand coded assembler
56cdf0e10cSrcweirCHECKFORPIC=
57cdf0e10cSrcweir
58cdf0e10cSrcweir.IF "$(header)" == ""
59cdf0e10cSrcweir
60cdf0e10cSrcweirLIB1TARGET=$(SLB)$/$(TARGET).lib
61cdf0e10cSrcweirLIB1FILES=  \
62cdf0e10cSrcweir    $(SLB)$/oslall.lib  \
63cdf0e10cSrcweir    $(SLB)$/cpposl.lib  \
64cdf0e10cSrcweir    $(SLB)$/cpprtl.lib  \
65cdf0e10cSrcweir    $(SLB)$/textenc.lib
66cdf0e10cSrcweir
67cdf0e10cSrcweir#.IF "$(GUI)"=="UNX"
68cdf0e10cSrcweir#LIB1FILES+=$(SLB)$/systoolsunx.lib
69cdf0e10cSrcweir#.ENDIF # UNX
70cdf0e10cSrcweir
71cdf0e10cSrcweir
72cdf0e10cSrcweirLIB3TARGET=$(LB)$/a$(TARGET).lib
73cdf0e10cSrcweirLIB3ARCHIV=$(LB)$/lib$(TARGET)$(DLLPOSTFIX).a
74cdf0e10cSrcweirLIB3FILES=  \
75cdf0e10cSrcweir    $(LB)$/oslall.lib   \
76cdf0e10cSrcweir    $(LB)$/cpposl.lib   \
77cdf0e10cSrcweir    $(LB)$/cpprtl.lib   \
78cdf0e10cSrcweir    $(LB)$/textenc.lib
79cdf0e10cSrcweir
80cdf0e10cSrcweir#.IF "$(GUI)"=="UNX"
81cdf0e10cSrcweir#LIB3FILES+=$(LB)$/systoolsunx.lib
82cdf0e10cSrcweir#.ENDIF # UNX
83cdf0e10cSrcweir
84cdf0e10cSrcweir.IF "$(GUI)" == "WNT" || "$(GUI)"=="OS2"
85cdf0e10cSrcweirSHL1TARGET= $(TARGET)
86cdf0e10cSrcweir.ELSE
87cdf0e10cSrcweirSHL1TARGET= uno_$(TARGET)
88cdf0e10cSrcweir.ENDIF
89cdf0e10cSrcweirSHL1IMPLIB= i$(TARGET)
90cdf0e10cSrcweirSHL1VERSIONMAP= $(TARGET).map
91cdf0e10cSrcweirSHL1RPATH=URELIB
92cdf0e10cSrcweir
93cdf0e10cSrcweir.IF "$(GUI)"=="WNT"
94cdf0e10cSrcweir
95cdf0e10cSrcweir.IF "$(COM)"=="GCC"
96cdf0e10cSrcweirUWINAPILIB=     -luwinapi
97cdf0e10cSrcweir.ELSE
98cdf0e10cSrcweirUWINAPILIB=     $(LB)$/uwinapi.lib
99cdf0e10cSrcweir.ENDIF
100cdf0e10cSrcweir
101cdf0e10cSrcweirSHL1STDLIBS=    \
102cdf0e10cSrcweir                $(UWINAPILIB)\
103cdf0e10cSrcweir                $(ADVAPI32LIB)\
104cdf0e10cSrcweir                $(WSOCK32LIB)\
105cdf0e10cSrcweir                $(MPRLIB)\
106cdf0e10cSrcweir                $(SHELL32LIB)\
107cdf0e10cSrcweir                $(COMDLG32LIB)\
108cdf0e10cSrcweir                $(USER32LIB)\
109cdf0e10cSrcweir                $(OLE32LIB)
110cdf0e10cSrcweir.IF "$(COM)"=="GCC"
111cdf0e10cSrcweirMINGWSSTDOBJ=
112cdf0e10cSrcweirMINGWSSTDENDOBJ=
113cdf0e10cSrcweir.ENDIF
114cdf0e10cSrcweir.ENDIF # WNT
115cdf0e10cSrcweir
116cdf0e10cSrcweir.IF "$(GUI)"=="UNX"
117cdf0e10cSrcweir.IF "$(OS)"=="SOLARIS"
118cdf0e10cSrcweir# libposix4.so (SunOS 5.6) <-> librt.so (SunOS >= 5.7)
119cdf0e10cSrcweirSHL1STDLIBS= -Bdynamic -ldl -lpthread -lposix4 -lsocket -lnsl
120cdf0e10cSrcweir.IF "$(COM)" == "C50"
121cdf0e10cSrcweirSHL1STDLIBS+= -z allextract -staticlib=Crun -z defaultextract
122cdf0e10cSrcweir.ENDIF # C50
123cdf0e10cSrcweir.ENDIF # SOLARIS
124cdf0e10cSrcweir.ENDIF # UNX
125cdf0e10cSrcweir
126cdf0e10cSrcweir.IF "$(GUI)"=="OS2"
127685bfa88SYuri DarioSHL1STDLIBS=-lmmap -lpthread
128cdf0e10cSrcweir.ENDIF # OS2
129cdf0e10cSrcweir
130cdf0e10cSrcweir.IF "$(OS)"=="MACOSX"
131cdf0e10cSrcweirSHL1STDLIBS+=-framework CoreFoundation -framework Carbon
132cdf0e10cSrcweir.ENDIF
133cdf0e10cSrcweir
134cdf0e10cSrcweir.IF "$(OS)" == "LINUX"
135cdf0e10cSrcweir.IF "$(PAM_LINK)" == "YES"
136cdf0e10cSrcweirSHL1STDLIBS+=-lpam
137cdf0e10cSrcweir.ENDIF
138cdf0e10cSrcweir.IF "$(CRYPT_LINK)" == "YES"
139cdf0e10cSrcweirSHL1STDLIBS+=-lcrypt
140cdf0e10cSrcweir.ENDIF
141cdf0e10cSrcweir.ENDIF
142cdf0e10cSrcweir
143cdf0e10cSrcweir# #i105898# required for LD_PRELOAD libsalalloc_malloc.so
144cdf0e10cSrcweir#           if sal is linked with -Bsymbolic-functions
145cdf0e10cSrcweir.IF "$(HAVE_LD_BSYMBOLIC_FUNCTIONS)" == "TRUE"
146cdf0e10cSrcweirSHL1LINKFLAGS+=-Wl,--dynamic-list=salalloc.list
147cdf0e10cSrcweir.ENDIF # .IF "$(HAVE_LD_BSYMBOLIC_FUNCTIONS)" == "TRUE"
148cdf0e10cSrcweir
149cdf0e10cSrcweirSHL1LIBS+=$(SLB)$/$(TARGET).lib
150cdf0e10cSrcweir
151cdf0e10cSrcweir.IF "$(linkinc)" != ""
152cdf0e10cSrcweirSHL11FILE=$(MISC)$/sal.slo
153cdf0e10cSrcweir.ELSE
154cdf0e10cSrcweir.IF "$(GUI)"=="UNX"
155cdf0e10cSrcweirSHL1OBJS=
156cdf0e10cSrcweir.ELSE
157cdf0e10cSrcweir.IF "$(GUI)$(COM)"!="WNTGCC"
158cdf0e10cSrcweirSHL1OBJS= \
159cdf0e10cSrcweir    $(SLO)$/dllentry.obj
160cdf0e10cSrcweir.ENDIF # WNTGCC
161cdf0e10cSrcweir.ENDIF # UNX
162cdf0e10cSrcweir.ENDIF # lincinc
163cdf0e10cSrcweir
164cdf0e10cSrcweirSHL1DEPN=
165cdf0e10cSrcweirSHL1DEF=    $(MISC)$/$(SHL1TARGET).def
166cdf0e10cSrcweir
167cdf0e10cSrcweirDEF1NAME= $(SHL1TARGET)
168cdf0e10cSrcweir
169cdf0e10cSrcweir#
170cdf0e10cSrcweir# This part builds a tiny extra lib,
171cdf0e10cSrcweir# containing an alloc.c which uses system
172cdf0e10cSrcweir# heap instead of our own mem management.
173cdf0e10cSrcweir# This is e.g. useful for proper valgrinding
174cdf0e10cSrcweir# the office.
175cdf0e10cSrcweir#
176cdf0e10cSrcweir.IF "$(OS)"=="LINUX"
177cdf0e10cSrcweir
178cdf0e10cSrcweirTARGET2 = salalloc_malloc
179cdf0e10cSrcweirSHL2TARGET= $(TARGET2)
180cdf0e10cSrcweirSHL2IMPLIB= i$(TARGET2)
181cdf0e10cSrcweirSHL2VERSIONMAP= salalloc.map
182cdf0e10cSrcweir
183cdf0e10cSrcweirSHL2LIBS+=$(SLB)$/SYSALLOC_cpprtl.lib
184cdf0e10cSrcweir
185cdf0e10cSrcweir.ENDIF # .IF "$(OS)"=="LINUX"
186cdf0e10cSrcweir
187cdf0e10cSrcweir# --- Coverage -----------------------------------------------------
188cdf0e10cSrcweir# LLA: 20040304 The follows lines are an additional which is only need if we run
189cdf0e10cSrcweir#               coverage tests. For normal test runs this feature is not used.
190cdf0e10cSrcweir#               For more information about coverage tests see:
191cdf0e10cSrcweir#               http://gcc.gnu.org/onlinedocs/gcc-3.0/gcc_8.html
192cdf0e10cSrcweir#
193cdf0e10cSrcweir#               Why this additional?
194cdf0e10cSrcweir#               Anybody has decide to link sal with g++ instead of gcc.
195cdf0e10cSrcweir#
196cdf0e10cSrcweir.IF "$(TESTCOVERAGE)"!=""
197cdf0e10cSrcweir.IF "$(GUI)"=="UNX"
198cdf0e10cSrcweir.IF "$(COM)"=="GCC"
199cdf0e10cSrcweir.IF "$(OS)"=="LINUX"
200cdf0e10cSrcweirSHL1STDLIBS+=-lgcc
201cdf0e10cSrcweir.ENDIF
202cdf0e10cSrcweir.ENDIF
203cdf0e10cSrcweir.ENDIF
204cdf0e10cSrcweir.ENDIF
205cdf0e10cSrcweir
206cdf0e10cSrcweir# --- Targets ------------------------------------------------------
207cdf0e10cSrcweir
208cdf0e10cSrcweir.ENDIF # $(header) != ""
209cdf0e10cSrcweir.ENDIF # $(depend) != ""
210cdf0e10cSrcweir
211cdf0e10cSrcweir.INCLUDE :  target.mk
212cdf0e10cSrcweir
213cdf0e10cSrcweir.IF "$(SHL1TARGETN)" != ""
214cdf0e10cSrcweir$(SHL1TARGETN) : $(OUT)$/inc$/udkversion.h
215cdf0e10cSrcweir.ENDIF # "$(SHL1TARGETN)" != ""
216cdf0e10cSrcweir
217cdf0e10cSrcweir$(OUT)$/inc$/udkversion.h:
218cdf0e10cSrcweir    echo '#ifndef _SAL_UDKVERSION_H_'           >  $@
219cdf0e10cSrcweir    echo '#define _SAL_UDKVERSION_H_'           >> $@
220cdf0e10cSrcweir    echo ''                                     >> $@
221cdf0e10cSrcweir    echo '#define SAL_UDK_MAJOR "$(UDK_MAJOR)"' >> $@
222cdf0e10cSrcweir    echo '#define SAL_UDK_MINOR "$(UDK_MINOR)"' >> $@
223cdf0e10cSrcweir    echo '#define SAL_UDK_MICRO "$(UDK_MICRO)"' >> $@
224cdf0e10cSrcweir    echo ''                                     >> $@
225cdf0e10cSrcweir    echo '#endif'                               >> $@
226