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 "$(OS)"=="MACOSX" 129*bd6bc7d0SJian Fang ZhangSHL1STDLIBS+=-framework CoreFoundation -framework Carbon 130*bd6bc7d0SJian Fang Zhang.ENDIF 131*bd6bc7d0SJian Fang Zhang 132*bd6bc7d0SJian Fang Zhang.IF "$(OS)" == "LINUX" 133*bd6bc7d0SJian Fang Zhang.IF "$(PAM_LINK)" == "YES" 134*bd6bc7d0SJian Fang ZhangSHL1STDLIBS+=-lpam 135*bd6bc7d0SJian Fang Zhang.ENDIF 136*bd6bc7d0SJian Fang Zhang.IF "$(CRYPT_LINK)" == "YES" 137*bd6bc7d0SJian Fang ZhangSHL1STDLIBS+=-lcrypt 138*bd6bc7d0SJian Fang Zhang.ENDIF 139*bd6bc7d0SJian Fang Zhang.ENDIF 140*bd6bc7d0SJian Fang Zhang 141*bd6bc7d0SJian Fang Zhang# #i105898# required for LD_PRELOAD libsalalloc_malloc.so 142*bd6bc7d0SJian Fang Zhang# if sal is linked with -Bsymbolic-functions 143*bd6bc7d0SJian Fang Zhang.IF "$(HAVE_LD_BSYMBOLIC_FUNCTIONS)" == "TRUE" 144*bd6bc7d0SJian Fang ZhangSHL1LINKFLAGS+=-Wl,--dynamic-list=salalloc.list 145*bd6bc7d0SJian Fang Zhang.ENDIF # .IF "$(HAVE_LD_BSYMBOLIC_FUNCTIONS)" == "TRUE" 146*bd6bc7d0SJian Fang Zhang 147*bd6bc7d0SJian Fang ZhangSHL1LIBS+=$(SLB)$/$(TARGET).lib 148*bd6bc7d0SJian Fang Zhang 149*bd6bc7d0SJian Fang Zhang.IF "$(linkinc)" != "" 150*bd6bc7d0SJian Fang ZhangSHL11FILE=$(MISC)$/sal.slo 151*bd6bc7d0SJian Fang Zhang.ELSE 152*bd6bc7d0SJian Fang Zhang.IF "$(GUI)"=="UNX" 153*bd6bc7d0SJian Fang ZhangSHL1OBJS= 154*bd6bc7d0SJian Fang Zhang.ELSE 155*bd6bc7d0SJian Fang Zhang.IF "$(GUI)$(COM)"!="WNTGCC" 156*bd6bc7d0SJian Fang ZhangSHL1OBJS= \ 157*bd6bc7d0SJian Fang Zhang $(SLO)$/dllentry.obj 158*bd6bc7d0SJian Fang Zhang.ENDIF # WNTGCC 159*bd6bc7d0SJian Fang Zhang.ENDIF # UNX 160*bd6bc7d0SJian Fang Zhang.ENDIF # lincinc 161*bd6bc7d0SJian Fang Zhang 162*bd6bc7d0SJian Fang ZhangSHL1DEPN= 163*bd6bc7d0SJian Fang ZhangSHL1DEF= $(MISC)$/$(SHL1TARGET).def 164*bd6bc7d0SJian Fang Zhang 165*bd6bc7d0SJian Fang ZhangDEF1NAME= $(SHL1TARGET) 166*bd6bc7d0SJian Fang Zhang 167*bd6bc7d0SJian Fang Zhang# 168*bd6bc7d0SJian Fang Zhang# This part builds a tiny extra lib, 169*bd6bc7d0SJian Fang Zhang# containing an alloc.c which uses system 170*bd6bc7d0SJian Fang Zhang# heap instead of our own mem management. 171*bd6bc7d0SJian Fang Zhang# This is e.g. useful for proper valgrinding 172*bd6bc7d0SJian Fang Zhang# the office. 173*bd6bc7d0SJian Fang Zhang# 174*bd6bc7d0SJian Fang Zhang.IF "$(OS)"=="LINUX" 175*bd6bc7d0SJian Fang Zhang 176*bd6bc7d0SJian Fang ZhangTARGET2 = salalloc_malloc 177*bd6bc7d0SJian Fang ZhangSHL2TARGET= $(TARGET2) 178*bd6bc7d0SJian Fang ZhangSHL2IMPLIB= i$(TARGET2) 179*bd6bc7d0SJian Fang ZhangSHL2VERSIONMAP= salalloc.map 180*bd6bc7d0SJian Fang Zhang 181*bd6bc7d0SJian Fang ZhangSHL2LIBS+=$(SLB)$/SYSALLOC_cpprtl.lib 182*bd6bc7d0SJian Fang Zhang 183*bd6bc7d0SJian Fang Zhang.ENDIF # .IF "$(OS)"=="LINUX" 184*bd6bc7d0SJian Fang Zhang 185*bd6bc7d0SJian Fang Zhang# --- Coverage ----------------------------------------------------- 186*bd6bc7d0SJian Fang Zhang# LLA: 20040304 The follows lines are an additional which is only need if we run 187*bd6bc7d0SJian Fang Zhang# coverage tests. For normal test runs this feature is not used. 188*bd6bc7d0SJian Fang Zhang# For more information about coverage tests see: 189*bd6bc7d0SJian Fang Zhang# http://gcc.gnu.org/onlinedocs/gcc-3.0/gcc_8.html 190*bd6bc7d0SJian Fang Zhang# 191*bd6bc7d0SJian Fang Zhang# Why this additional? 192*bd6bc7d0SJian Fang Zhang# Anybody has decide to link sal with g++ instead of gcc. 193*bd6bc7d0SJian Fang Zhang# 194*bd6bc7d0SJian Fang Zhang.IF "$(TESTCOVERAGE)"!="" 195*bd6bc7d0SJian Fang Zhang.IF "$(GUI)"=="UNX" 196*bd6bc7d0SJian Fang Zhang.IF "$(COM)"=="GCC" 197*bd6bc7d0SJian Fang Zhang.IF "$(OS)"=="LINUX" 198*bd6bc7d0SJian Fang ZhangSHL1STDLIBS+=-lgcc 199*bd6bc7d0SJian Fang Zhang.ENDIF 200*bd6bc7d0SJian Fang Zhang.ENDIF 201*bd6bc7d0SJian Fang Zhang.ENDIF 202*bd6bc7d0SJian Fang Zhang.ENDIF 203*bd6bc7d0SJian Fang Zhang 204*bd6bc7d0SJian Fang Zhang# --- Targets ------------------------------------------------------ 205*bd6bc7d0SJian Fang Zhang 206*bd6bc7d0SJian Fang Zhang.ENDIF # $(header) != "" 207*bd6bc7d0SJian Fang Zhang.ENDIF # $(depend) != "" 208*bd6bc7d0SJian Fang Zhang 209*bd6bc7d0SJian Fang Zhang.INCLUDE : target.mk 210*bd6bc7d0SJian Fang Zhang 211*bd6bc7d0SJian Fang Zhang.IF "$(SHL1TARGETN)" != "" 212*bd6bc7d0SJian Fang Zhang$(SHL1TARGETN) : $(OUT)$/inc$/udkversion.h 213*bd6bc7d0SJian Fang Zhang.ENDIF # "$(SHL1TARGETN)" != "" 214*bd6bc7d0SJian Fang Zhang 215*bd6bc7d0SJian Fang Zhang$(OUT)$/inc$/udkversion.h: 216*bd6bc7d0SJian Fang Zhang echo '#ifndef _SAL_UDKVERSION_H_' > $@ 217*bd6bc7d0SJian Fang Zhang echo '#define _SAL_UDKVERSION_H_' >> $@ 218*bd6bc7d0SJian Fang Zhang echo '' >> $@ 219*bd6bc7d0SJian Fang Zhang echo '#define SAL_UDK_MAJOR "$(UDK_MAJOR)"' >> $@ 220*bd6bc7d0SJian Fang Zhang echo '#define SAL_UDK_MINOR "$(UDK_MINOR)"' >> $@ 221*bd6bc7d0SJian Fang Zhang echo '#define SAL_UDK_MICRO "$(UDK_MICRO)"' >> $@ 222*bd6bc7d0SJian Fang Zhang echo '' >> $@ 223*bd6bc7d0SJian Fang Zhang echo '#endif' >> $@ 224