1 #*************************************************************************
3 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 # Copyright 2008 by Sun Microsystems, Inc.
7 # OpenOffice.org - a multi-platform office productivity suite
9 # $RCSfile: pstrules.mk,v $
13 # This file is part of OpenOffice.org.
15 # OpenOffice.org is free software: you can redistribute it and/or modify
16 # it under the terms of the GNU Lesser General Public License version 3
17 # only, as published by the Free Software Foundation.
19 # OpenOffice.org is distributed in the hope that it will be useful,
20 # but WITHOUT ANY WARRANTY; without even the implied warranty of
21 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
22 # GNU Lesser General Public License version 3 for more details
23 # (a copy is included in the LICENSE file that accompanied this code).
25 # You should have received a copy of the GNU Lesser General Public License
26 # version 3 along with OpenOffice.org. If not, see
27 # <http://www.openoffice.org/license.html>
28 # for a copy of the LGPLv3 License.
30 #*************************************************************************
32 #++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
33 #+++++++++++ second_build rules +++++++++++++++++++++++++++++++++++++
34 #++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
36 .IF
"$(SECOND_BUILD)"!=""
37 .IF
"$($(SECOND_BUILD)_OBJFILES)"!=""
39 $(OBJ
)/$(SECOND_BUILD
)_
%.obj
: %.
cxx
40 @echo
------------------------------
43 @
$(RM
) $@
$(@
:s
/.obj
/.o
/)
44 $(CXX
) $(CFLAGS
) $(INCLUDE
) $(CFLAGSCXX
) $(CFLAGSCXXOBJ
) $(CFLAGSOBJ
) $(CDEFS
) $($(SECOND_BUILD
)CDEFS
) $(CDEFSOBJ
) $(!eq
,$(EXCEPTIONSFILES
),$(subst,$@
, $(EXCEPTIONSFILES
)) $(LOCAL_EXCEPTIONS_FLAGS
) $(GLOBAL_EXCEPTIONS_FLAGS
)) $(CFLAGSAPPEND
) $(CFLAGSOUTOBJ
) $(OBJ
)/$(SECOND_BUILD
)_
$*.o
$(CFLAGSINCXX
)$(PWD
)/$*.
cxx
45 .IF
"$(OS)"=="SOLARIS" && "$(product)"=="full" && "$(debug)"==""
46 $(ADJUSTVISIBILITY
) -p
$(@
:s
/.obj
/.o
/)
47 .ENDIF
# "$(OS)"=="SOLARIS" && "$(product)"=="full" && "$(debug)"==""
48 $(IFEXIST
) $(@
:s
/.obj
/.o
/) $(THEN
) $(TOUCH
) $@
$(FI
)
50 @
$(IFEXIST
) $@
$(THEN
) $(RM
:s
/+//) $@
>& $(NULLDEV
) $(FI
)
51 $(CXX
) $(CFLAGS
) $(INCLUDE
) $(CFLAGSCXX
) $(CFLAGSOBJ
) $(CDEFS
) $($(SECOND_BUILD
)CDEFS
) $(CDEFSOBJ
) $(!eq
,$(EXCEPTIONSFILES
),$(subst,$@
, $(EXCEPTIONSFILES
)) $(LOCAL_EXCEPTIONS_FLAGS
) $(GLOBAL_EXCEPTIONS_FLAGS
)) $(CFLAGSAPPEND
) $(CFLAGSOUTOBJ
)$(OBJ
)/$(SECOND_BUILD
)_
$*.obj
$(CFLAGSINCXX
)$(PWD
)/$*.
cxx
54 $(OBJ
)/$(SECOND_BUILD
)_
%.obj
: %.c
55 @echo
------------------------------
59 $(CC
) $(CFLAGS
) $(INCLUDE_C
) $(CFLAGSCC
) $(CFLAGSOBJ
) $(CDEFS
) $($(SECOND_BUILD
)CDEFS
) $(CDEFSOBJ
) -E
$(CFLAGSAPPEND
) $(CFLAGSOUTOBJ
) $(OBJ
)/$(SECOND_BUILD
)_
$*.o
$*.c
61 @
$(RM
) $@
$(@
:s
/.obj
/.o
/)
62 $(CC
) $(CFLAGS
) $(INCLUDE_C
) $(CFLAGSCC
) $(CFLAGSOBJ
) $(CDEFS
) $($(SECOND_BUILD
)CDEFS
) $(CDEFSOBJ
) $(CFLAGSAPPEND
) $(CFLAGSOUTOBJ
) $(OBJ
)/$(SECOND_BUILD
)_
$*.o
$*.c
63 .IF
"$(OS)"=="SOLARIS" && "$(product)"=="full" && "$(debug)"==""
64 $(ADJUSTVISIBILITY
) -p
$(@
:s
/.obj
/.o
/)
65 .ENDIF
# "$(OS)"=="SOLARIS" && "$(product)"=="full" && "$(debug)"==""
66 $(IFEXIST
) $(@
:s
/.obj
/.o
/) $(THEN
) $(TOUCH
) $@
$(FI
)
69 @
$(TYPE
) $(mktmp
$(CC
) $(CFLAGS
) $(INCLUDE_C
) $(CFLAGSCC
) $(CFLAGSOBJ
) $(CDEFS
) $($(SECOND_BUILD
)CDEFS
) $(CDEFSOBJ
) $(CFLAGSAPPEND
) $(CFLAGSOUTOBJ
)$(OBJ
)\
$(SECOND_BUILD
)_
$*.obj
$*.c
)
72 $(CC
) $(CFLAGS
) $(INCLUDE_C
) $(CFLAGSCC
) $(CFLAGSOBJ
) $(CDEFS
) $($(SECOND_BUILD
)CDEFS
) $(CDEFSOBJ
) $(CFLAGSAPPEND
) $(CFLAGSOUTOBJ
)$(OBJ
)\
$(SECOND_BUILD
)_
$*.obj
$*.c
74 $(CC
) @
$(mktmp
$(CFLAGS
) $(INCLUDE_C
) $(CFLAGSCC
) $(CFLAGSOBJ
) $(CDEFS
) $($(SECOND_BUILD
)CDEFS
) $(CDEFSOBJ
) $(CFLAGSAPPEND
) $(CFLAGSOUTOBJ
)$(OBJ
)\
$(SECOND_BUILD
)_
$*.obj
$*.c
)
79 .ENDIF
# "$($(SECOND_BUILD)_OBJFILES)"!=""
81 .IF
"$($(SECOND_BUILD)_SLOFILES)"!=""
83 $(SLO
)/$(SECOND_BUILD
)_
%.obj
: %.
cxx
84 @echo
------------------------------
87 @
$(RM
) $@
$(@
:s
/.obj
/.o
/)
88 $(CXX
) $(CFLAGS
) $(INCLUDE
) $(CFLAGSCXX
) $(CFLAGSCXXSLO
) $(CFLAGSSLO
) $(CDEFS
) $($(SECOND_BUILD
)CDEFS
) $(CDEFSSLO
) $(CDEFSMT
) $(!eq
,$(EXCEPTIONSFILES
),$(subst,$@
, $(EXCEPTIONSFILES
)) $(LOCAL_EXCEPTIONS_FLAGS
) $(GLOBAL_EXCEPTIONS_FLAGS
)) $(CFLAGSAPPEND
) $(CFLAGSOUTOBJ
) $(SLO
)/$(SECOND_BUILD
)_
$*.o
$(CFLAGSINCXX
)$(PWD
)/$*.
cxx
89 .IF
"$(OS)"=="SOLARIS" && "$(product)"=="full" && "$(debug)"==""
90 $(ADJUSTVISIBILITY
) -p
$(@
:s
/.obj
/.o
/)
91 .ENDIF
# "$(OS)"=="SOLARIS" && "$(product)"=="full" && "$(debug)"==""
92 $(IFEXIST
) $(@
:s
/.obj
/.o
/) $(THEN
) $(TOUCH
) $@
$(FI
)
96 $(CXX
) $(CFLAGS
) $(INCLUDE
) $(CFLAGSCXX
) $(CFLAGSSLO
) $(CDEFS
) $($(SECOND_BUILD
)CDEFS
) $(CDEFSSLO
) $(CDEFSMT
) $(!eq
,$(EXCEPTIONSFILES
),$(subst,$@
, $(EXCEPTIONSFILES
)) $(LOCAL_EXCEPTIONS_FLAGS
) $(GLOBAL_EXCEPTIONS_FLAGS
)) $(CFLAGSAPPEND
) $(CFLAGSOUTOBJ
)$(SLO
)/$(SECOND_BUILD
)_
$*.obj
$(CFLAGSINCXX
)$(PWD
)/$*.
cxx
98 $(CXX
) @
$(mktmp
$(CFLAGS
) $(INCLUDE
) $(CFLAGSCXX
) $(CFLAGSSLO
) $(CDEFS
) $($(SECOND_BUILD
)CDEFS
) $(CDEFSSLO
) $(CDEFSMT
) $(!eq
,$(EXCEPTIONSFILES
),$(subst,$@
, $(EXCEPTIONSFILES
)) $(LOCAL_EXCEPTIONS_FLAGS
) $(GLOBAL_EXCEPTIONS_FLAGS
)) $(CFLAGSAPPEND
) $(CFLAGSOUTOBJ
)$(SLO
)/$(SECOND_BUILD
)_
$*.obj
$(CFLAGSINCXX
)$(PWD
)/$*.
cxx )
102 $(SLO
)/$(SECOND_BUILD
)_
%.obj
: %.c
103 @echo
------------------------------
106 @
$(RM
) $@
$(@
:s
/.obj
/.o
/)
107 $(CC
) $(CFLAGS
) $(INCLUDE_C
) $(CFLAGSCC
) $(CFLAGSSLO
) $(CDEFS
) $($(SECOND_BUILD
)CDEFS
) $(CDEFSSLO
) $(CDEFSMT
) $(CFLAGSAPPEND
) $(CFLAGSOUTOBJ
) $(SLO
)/$(SECOND_BUILD
)_
$*.o
$*.c
108 .IF
"$(OS)"=="SOLARIS" && "$(product)"=="full" && "$(debug)"==""
109 $(ADJUSTVISIBILITY
) -p
$(@
:s
/.obj
/.o
/)
110 .ENDIF
# "$(OS)"=="SOLARIS" && "$(product)"=="full" && "$(debug)"==""
111 $(IFEXIST
) $(@
:s
/.obj
/.o
/) $(THEN
) $(TOUCH
) $@
$(FI
)
115 $(CC
) $(CFLAGS
) $(INCLUDE_C
) $(CFLAGSCC
) $(CFLAGSSLO
) $(CDEFS
) $($(SECOND_BUILD
)CDEFS
) $(CDEFSSLO
) $(CDEFSMT
) $(CFLAGSAPPEND
) $(CFLAGSOUTOBJ
)$(SLO
)/$(SECOND_BUILD
)_
$*.obj
$*.c
117 $(TYPE
) $(mktmp
$(CFLAGS
) $(INCLUDE_C
) $(CFLAGSCC
) $(CFLAGSSLO
) $(CDEFS
) $($(SECOND_BUILD
)CDEFS
) $(CDEFSSLO
) $(CDEFSMT
) $(CFLAGSAPPEND
) $(CFLAGSOUTOBJ
)$(SLO
)/$(SECOND_BUILD
)_
$*.obj
$*.c
)
118 $(CC
) @
$(mktmp
$(CFLAGS
) $(INCLUDE_C
) $(CFLAGSCC
) $(CFLAGSSLO
) $(CDEFS
) $($(SECOND_BUILD
)CDEFS
) $(CDEFSSLO
) $(CDEFSMT
) $(CFLAGSAPPEND
) $(CFLAGSOUTOBJ
)$(SLO
)/$(SECOND_BUILD
)_
$*.obj
$*.c
)
122 .ENDIF
# "$($(SECOND_BUILD)_SLOFILES)"!=""
123 .ENDIF
# "$(SECOND_BUILD)"!=""
125 #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
126 #+++++++++++ srcipting rules ++++++++++++++++++++++++++++++++++++++++
127 #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
129 .IF
"$(PARFILES)"!=""
130 ULFPARFILES
=$(foreach,i
,$(ULFFILES
) $(foreach,j
,$(SCP_PRODUCT_TYPE
) $(PAR
)/$j/$(i
:b
).par
))
131 MOREPARFILES
=$(foreach,i
,$(PARFILES
) $(foreach,j
,$(SCP_PRODUCT_TYPE
) $(PAR
)/$j/$i ))
132 ALLPARFILES
=$(uniq
$(ULFPARFILES
) $(MOREPARFILES
))
134 SCP_PRODUCT_TYPE
*=FAT
136 .IF
"$(GUI)" == "WNT"
143 @echo
------------------------------
145 @@
-$(MKDIR
) $(MISC
)/{$(subst,$(@
:d
:d
:d
), $(@
:d
:d
))}
146 .IF
"$(GUI)"=="WNT" ||
"$(GUI)"=="OS2"
147 $(CPPLCC
) -+ -P
$(INCLUDE
) $(CDEFS
) $(SCPDEFS
) -DDLLPOSTFIX
=$(DLLPOSTFIX
) $(*:b
).scp
> $(MISC
)/{$(subst,$(@
:d
:d
:d
), $(@
:d
:d
))}/$(*:b
).pre
150 $(AUGMENT_LIBRARY_PATH
) $(SOLARBINDIR
)/cpp.lcc
-+ -P
$(CDEFS
) $(SCPDEFS
) -DDLLPOSTFIX
=$(DLLPOSTFIX
) -I.
-I
$(INC
) -I
$(INCLOCAL
) -I
$(INCGUI
) -I
$(INCCOM
) $(SOLARINC
) $(*:b
).scp
> $(MISC
)/{$(subst,$(@
:d
:d
:d
), $(@
:d
:d
))}/$(*:b
).pre
152 .IF
"$(common_build_srs)"!=""
153 $(SCPCOMP
) -l
{$(subst,$(OUTPATH
),$(COMMON_OUTDIR
) $(MISC
))/$(TARGET
)/$(@
:b
).
$(LANGFILEEXT
)} -s
$(MISC
)/{$(subst,$(@
:d
:d
:d
), $(@
:d
:d
))}/$(*:b
).pre
-o
$@
154 .ELSE
# "$(common_build_srs)"!=""
155 $(SCPCOMP
) -l
{$(MISC
)/$(TARGET
)/$(@
:b
).
$(LANGFILEEXT
)} -s
$(MISC
)/{$(subst,$(@
:d
:d
:d
), $(@
:d
:d
))}/$(*:b
).pre
-o
$@
156 .ENDIF
# "$(common_build_srs)"!=""
158 # $(SCPCOMP) -l $(@:b).$(LANGFILEEXT) -s $(MISC)/{$(subst,$(@:d:d:d), $(@:d:d))}/$(*:b).pre -o $@
160 .ENDIF
# "$(PARFILES)"!=""
164 # workaround for strange dmake bug:
165 # if the previous block was a rule or a target, "\#" isn't recognized
166 # as an escaped "#". if it was an assignment, escaping works...
167 some_unique_variable_name
:=1
170 REGEXP
:="s/^[\#].*//"
172 REGEXP
:='s/^[\#].*//'
175 $(MISC
)/%.exp
: sce
/%.sce
177 @@
-$(RM
) $(@
:d
)$(@
:b
).tst
178 $(TYPE
) $< | sed
$(REGEXP
) | sed
"s/^/test_/" > $(@
:d
)$(@
:b
).tst
179 $(TYPE
) $(@
:d
)$(@
:b
).tst | sed
"/test_./ w $@"
181 .ENDIF
# "$(TESTDIR)"!=""