xref: /aoo42x/main/cppuhelper/test/makefile.mk (revision 7871dc3e)
1#**************************************************************
2#
3#  Licensed to the Apache Software Foundation (ASF) under one
4#  or more contributor license agreements.  See the NOTICE file
5#  distributed with this work for additional information
6#  regarding copyright ownership.  The ASF licenses this file
7#  to you under the Apache License, Version 2.0 (the
8#  "License"); you may not use this file except in compliance
9#  with the License.  You may obtain a copy of the License at
10#
11#    http://www.apache.org/licenses/LICENSE-2.0
12#
13#  Unless required by applicable law or agreed to in writing,
14#  software distributed under the License is distributed on an
15#  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16#  KIND, either express or implied.  See the License for the
17#  specific language governing permissions and limitations
18#  under the License.
19#
20#**************************************************************
21
22
23PRJ=..
24
25PRJNAME=cppuhelper
26TARGET=testhelper
27ENABLE_EXCEPTIONS=TRUE
28USE_DEFFILE=TRUE
29
30# --- Settings -----------------------------------------------------
31
32.INCLUDE :  settings.mk
33
34# --- Files --------------------------------------------------------
35
36UNOUCRDEP=	$(SOLARBINDIR)$/udkapi.rdb
37UNOUCRRDB=	$(SOLARBINDIR)$/udkapi.rdb
38UNOUCROUT=	$(OUT)$/inc$/test
39INCPRE+=	$(OUT)$/inc$/test
40
41OBJFILES=	\
42		$(OBJ)$/testhelper.obj		\
43		$(OBJ)$/testpropshlp.obj 	\
44		$(OBJ)$/testidlclass.obj 	\
45		$(OBJ)$/testproptyphlp.obj	\
46		$(OBJ)$/testimplhelper.obj \
47		$(OBJ)$/testcontainer.obj
48
49APP1TARGET=$(TARGET)
50APP1OBJS=$(OBJFILES)
51
52APP1STDLIBS+=	\
53		$(CPPULIB)	\
54		$(CPPUHELPERLIB) \
55		$(SALLIB)
56
57APP1DEF=	$(MISC)$/$(APP1TARGET).def
58
59#############################################
60
61APP2OBJS = $(OBJ)$/testdefaultbootstrapping.obj
62APP2STDLIBS += $(CPPUHELPERLIB) $(CPPULIB) $(SALLIB)
63APP2TARGET = testdefaultbootstrapping
64
65#############################################
66
67SLOFILES= \
68		$(SLO)$/cfg_test.obj
69LIB1TARGET=$(SLB)$/cfg_test.lib
70LIB1OBJFILES=$(SLOFILES)
71
72
73APP3OBJS = $(OBJ)$/cfg_test.obj
74APP3STDLIBS += $(CPPUHELPERLIB) $(CPPULIB) $(SALLIB)
75APP3TARGET = test_cfg
76
77#############################################
78
79ALLIDLFILES:=	helpertest.idl
80
81# --- Targets ------------------------------------------------------
82
83.IF "$(depend)" == ""
84ALL: $(BIN)$/cpputest.rdb				\
85	 unoheader 					\
86	 $(BIN)$/testrc 				\
87	 $(BIN)$/testdefaultbootstrapping.pl		\
88	ALLTAR 						\
89	 $(BIN)$/$(APP2TARGET).bin  			\
90	 $(BIN)$/$(APP2TARGET).Bin  			\
91	 $(BIN)$/$(APP2TARGET).Exe
92
93.IF "$(GUI)"=="UNX"
94ALL:  $(BIN)$/$(APP2TARGET).exe
95
96$(BIN)$/$(APP2TARGET).exe : $(APP2TARGETN)
97	cp $(APP2TARGETN) $@
98
99.ENDIF
100
101
102$(BIN)$/$(APP2TARGET).bin : $(APP2TARGETN)
103	cp $(APP2TARGETN) $@
104
105$(BIN)$/$(APP2TARGET).Bin : $(APP2TARGETN)
106	cp $(APP2TARGETN) $@
107
108$(BIN)$/$(APP2TARGET).Exe : $(APP2TARGETN)
109	cp $(APP2TARGETN) $@
110
111.ELSE
112ALL: 	ALLDEP
113.ENDIF
114
115.INCLUDE :  target.mk
116
117CPPUMAKERFLAGS =
118.IF "$(COM)" == "MSC"
119CPPUMAKERFLAGS = -L
120.ENDIF
121
122TYPES:=test.A;test.BA;test.CA;test.DBA;test.E;test.FE;test.G;test.H;test.I
123HELPERTYPES:=com.sun.star.uno.XReference;com.sun.star.uno.XAdapter;com.sun.star.uno.XAggregation;com.sun.star.uno.XWeak;com.sun.star.lang.XComponent;com.sun.star.lang.XTypeProvider;com.sun.star.lang.XEventListener;com.sun.star.lang.XSingleServiceFactory;com.sun.star.lang.XMultiServiceFactory;com.sun.star.registry.XRegistryKey;com.sun.star.lang.XInitialization;com.sun.star.lang.XServiceInfo;com.sun.star.loader.XImplementationLoader;com.sun.star.lang.IllegalAccessException;com.sun.star.beans.XVetoableChangeListener;com.sun.star.beans.XPropertySet;com.sun.star.uno.XComponentContext
124FACTORYTYPES:=com.sun.star.lang.XComponent;com.sun.star.registry.XSimpleRegistry;com.sun.star.lang.XInitialization;com.sun.star.lang.XMultiServiceFactory;com.sun.star.loader.XImplementationLoader;com.sun.star.registry.XImplementationRegistration;com.sun.star.container.XSet;com.sun.star.lang.XSingleServiceFactory;com.sun.star.lang.XSingleComponentFactory;com.sun.star.lang.XMultiComponentFactory
125
126.IF "$(OS)" == "WNT" || "$(OS)" == "OS2"
127UNO_PATH := $(SOLARBINDIR)
128UNO_OUT := $(OUT)$/bin
129EXT_SO  := .dll
130.ELSE
131UNO_PATH := $(SOLARLIBDIR)
132UNO_OUT  := $(OUT)$/lib
133EXT_SO   := .so
134.ENDIF
135
136$(UNO_OUT)$/%$(EXT_SO): $(UNO_PATH)$/%$(EXT_SO)
137	$(COPY) $^ $@
138
139$(BIN)$/cpputest.rdb: $(ALLIDLFILES) $(UNO_OUT)$/invocadapt.uno$(EXT_SO) $(UNO_OUT)$/bootstrap.uno$(EXT_SO)
140	idlc -I$(PRJ) -I$(SOLARIDLDIR) -O$(BIN) $(ALLIDLFILES)
141	regmerge $@ /UCR $(BIN)$/{$(?:f:s/.idl/.urd/)}
142	regmerge $@ / $(UNOUCRRDB)
143	regcomp -register -r $@ -c reflection.uno$(DLLPOST)
144	touch $@
145
146unoheader: $(BIN)$/cpputest.rdb
147	cppumaker $(CPPUMAKERFLAGS) -BUCR -O$(UNOUCROUT) -T"$(TYPES);$(HELPERTYPES)" $(BIN)$/cpputest.rdb
148	cppumaker $(CPPUMAKERFLAGS) -BUCR -O$(UNOUCROUT) -T"$(FACTORYTYPES)" $(BIN)$/cpputest.rdb
149
150
151$(BIN)$/testdefaultbootstrapping.pl: testdefaultbootstrapping.pl
152	cp testdefaultbootstrapping.pl $@
153
154$(BIN)$/testrc: makefile.mk
155.IF "$(GUI)"=="WNT"
156	echo [Tests] > $@
157	echo TestKey1=com.sun.star.uno.NamingService.rdb >> $@
158.ELSE
159	echo '[Tests]' > $@
160	echo 'TestKey1=file:///'$(PWD)/$(BIN)'/com.sun.star.uno.NamingService.rdb' >> $@
161.ENDIF
162
163
164
165