update dev300-m58
[ooovba.git] / solenv / inc / pstrules.mk
blob39579437f20bb7ec6ed3aec4f5882e7ffa3d225e
1 #*************************************************************************
3 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 #
5 # Copyright 2008 by Sun Microsystems, Inc.
7 # OpenOffice.org - a multi-platform office productivity suite
9 # $RCSfile: pstrules.mk,v $
11 # $Revision: 1.50 $
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 ------------------------------
41 @echo Making: $@
42 .IF "$(GUI)"=="UNX"
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)
49 .ELSE
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
52 .ENDIF
54 $(OBJ)/$(SECOND_BUILD)_%.obj : %.c
55 @echo ------------------------------
56 @echo Making: $@
57 .IF "$(GUI)"=="UNX"
58 .IF "$(TEST)"!=""
59 $(CC) $(CFLAGS) $(INCLUDE_C) $(CFLAGSCC) $(CFLAGSOBJ) $(CDEFS) $($(SECOND_BUILD)CDEFS) $(CDEFSOBJ) -E $(CFLAGSAPPEND) $(CFLAGSOUTOBJ) $(OBJ)/$(SECOND_BUILD)_$*.o $*.c
60 .ELSE
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)
67 .ENDIF
68 .ELSE
69 @$(TYPE) $(mktmp $(CC) $(CFLAGS) $(INCLUDE_C) $(CFLAGSCC) $(CFLAGSOBJ) $(CDEFS) $($(SECOND_BUILD)CDEFS) $(CDEFSOBJ) $(CFLAGSAPPEND) $(CFLAGSOUTOBJ)$(OBJ)\$(SECOND_BUILD)_$*.obj $*.c )
70 @echo.
71 .IF "$(COM)"=="GCC"
72 $(CC) $(CFLAGS) $(INCLUDE_C) $(CFLAGSCC) $(CFLAGSOBJ) $(CDEFS) $($(SECOND_BUILD)CDEFS) $(CDEFSOBJ) $(CFLAGSAPPEND) $(CFLAGSOUTOBJ)$(OBJ)\$(SECOND_BUILD)_$*.obj $*.c
73 .ELSE
74 $(CC) @$(mktmp $(CFLAGS) $(INCLUDE_C) $(CFLAGSCC) $(CFLAGSOBJ) $(CDEFS) $($(SECOND_BUILD)CDEFS) $(CDEFSOBJ) $(CFLAGSAPPEND) $(CFLAGSOUTOBJ)$(OBJ)\$(SECOND_BUILD)_$*.obj $*.c )
75 .ENDIF
76 $(SEMADEBUG)
77 .ENDIF
79 .ENDIF # "$($(SECOND_BUILD)_OBJFILES)"!=""
81 .IF "$($(SECOND_BUILD)_SLOFILES)"!=""
83 $(SLO)/$(SECOND_BUILD)_%.obj : %.cxx
84 @echo ------------------------------
85 @echo Making: $@
86 .IF "$(GUI)"=="UNX"
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)
93 .ELSE
94 @-$(RM) $@
95 .IF "$(COM)"=="GCC"
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
97 .ELSE
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 )
99 .ENDIF
100 .ENDIF
102 $(SLO)/$(SECOND_BUILD)_%.obj : %.c
103 @echo ------------------------------
104 @echo Making: $@
105 .IF "$(GUI)"=="UNX"
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)
112 .ELSE
113 @-$(RM) $@
114 .IF "$(COM)"=="GCC"
115 $(CC) $(CFLAGS) $(INCLUDE_C) $(CFLAGSCC) $(CFLAGSSLO) $(CDEFS) $($(SECOND_BUILD)CDEFS) $(CDEFSSLO) $(CDEFSMT) $(CFLAGSAPPEND) $(CFLAGSOUTOBJ)$(SLO)/$(SECOND_BUILD)_$*.obj $*.c
116 .ELSE
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 )
119 .ENDIF
120 .ENDIF
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"
137 LANGFILEEXT=mlf
138 .ELSE
139 LANGFILEEXT=jlf
140 .ENDIF
142 $(PAR)/%.par :
143 @echo ------------------------------
144 @echo Making: $@
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
148 .ENDIF
149 .IF "$(GUI)"=="UNX"
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
151 .ENDIF
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)"!=""
157 # hacked version
158 # $(SCPCOMP) -l $(@:b).$(LANGFILEEXT) -s $(MISC)/{$(subst,$(@:d:d:d), $(@:d:d))}/$(*:b).pre -o $@
160 .ENDIF # "$(PARFILES)"!=""
162 .IF "$(TESTDIR)"!=""
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
169 .IF "$(OS)" == "WNT"
170 REGEXP:="s/^[\#].*//"
171 .ELSE
172 REGEXP:='s/^[\#].*//'
173 .ENDIF
175 $(MISC)/%.exp : sce/%.sce
176 @@-$(RM) $@
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)"!=""