xref: /aoo42x/main/cppuhelper/test/makefile.mk (revision cdf0e10c)
1#*************************************************************************
2#
3# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4#
5# Copyright 2000, 2010 Oracle and/or its affiliates.
6#
7# OpenOffice.org - a multi-platform office productivity suite
8#
9# This file is part of OpenOffice.org.
10#
11# OpenOffice.org is free software: you can redistribute it and/or modify
12# it under the terms of the GNU Lesser General Public License version 3
13# only, as published by the Free Software Foundation.
14#
15# OpenOffice.org is distributed in the hope that it will be useful,
16# but WITHOUT ANY WARRANTY; without even the implied warranty of
17# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18# GNU Lesser General Public License version 3 for more details
19# (a copy is included in the LICENSE file that accompanied this code).
20#
21# You should have received a copy of the GNU Lesser General Public License
22# version 3 along with OpenOffice.org.  If not, see
23# <http://www.openoffice.org/license.html>
24# for a copy of the LGPLv3 License.
25#
26#*************************************************************************
27PRJ=..
28
29PRJNAME=cppuhelper
30TARGET=testhelper
31ENABLE_EXCEPTIONS=TRUE
32USE_DEFFILE=TRUE
33
34# --- Settings -----------------------------------------------------
35
36.INCLUDE :  settings.mk
37
38# --- Files --------------------------------------------------------
39
40UNOUCRDEP=	$(SOLARBINDIR)$/udkapi.rdb
41UNOUCRRDB=	$(SOLARBINDIR)$/udkapi.rdb
42UNOUCROUT=	$(OUT)$/inc$/test
43INCPRE+=	$(OUT)$/inc$/test
44
45OBJFILES=	\
46		$(OBJ)$/testhelper.obj		\
47		$(OBJ)$/testpropshlp.obj 	\
48		$(OBJ)$/testidlclass.obj 	\
49		$(OBJ)$/testproptyphlp.obj	\
50		$(OBJ)$/testimplhelper.obj \
51		$(OBJ)$/testcontainer.obj
52
53APP1TARGET=$(TARGET)
54APP1OBJS=$(OBJFILES)
55
56APP1STDLIBS+=	\
57		$(CPPULIB)	\
58		$(CPPUHELPERLIB) \
59		$(SALLIB)
60
61APP1DEF=	$(MISC)$/$(APP1TARGET).def
62
63#############################################
64
65APP2OBJS = $(OBJ)$/testdefaultbootstrapping.obj
66APP2STDLIBS += $(CPPUHELPERLIB) $(CPPULIB) $(SALLIB)
67APP2TARGET = testdefaultbootstrapping
68
69#############################################
70
71SLOFILES= \
72		$(SLO)$/cfg_test.obj
73LIB1TARGET=$(SLB)$/cfg_test.lib
74LIB1OBJFILES=$(SLOFILES)
75
76
77APP3OBJS = $(OBJ)$/cfg_test.obj
78APP3STDLIBS += $(CPPUHELPERLIB) $(CPPULIB) $(SALLIB)
79APP3TARGET = test_cfg
80
81#############################################
82
83ALLIDLFILES:=	helpertest.idl
84
85# --- Targets ------------------------------------------------------
86
87.IF "$(depend)" == ""
88ALL: $(BIN)$/cpputest.rdb				\
89	 unoheader 					\
90	 $(BIN)$/testrc 				\
91	 $(BIN)$/testdefaultbootstrapping.pl		\
92	ALLTAR 						\
93	 $(BIN)$/$(APP2TARGET).bin  			\
94	 $(BIN)$/$(APP2TARGET).Bin  			\
95	 $(BIN)$/$(APP2TARGET).Exe
96
97.IF "$(GUI)"=="UNX"
98ALL:  $(BIN)$/$(APP2TARGET).exe
99
100$(BIN)$/$(APP2TARGET).exe : $(APP2TARGETN)
101	cp $(APP2TARGETN) $@
102
103.ENDIF
104
105
106$(BIN)$/$(APP2TARGET).bin : $(APP2TARGETN)
107	cp $(APP2TARGETN) $@
108
109$(BIN)$/$(APP2TARGET).Bin : $(APP2TARGETN)
110	cp $(APP2TARGETN) $@
111
112$(BIN)$/$(APP2TARGET).Exe : $(APP2TARGETN)
113	cp $(APP2TARGETN) $@
114
115.ELSE
116ALL: 	ALLDEP
117.ENDIF
118
119.INCLUDE :  target.mk
120
121CPPUMAKERFLAGS =
122.IF "$(COM)" == "MSC"
123CPPUMAKERFLAGS = -L
124.ENDIF
125
126TYPES:=test.A;test.BA;test.CA;test.DBA;test.E;test.FE;test.G;test.H;test.I
127HELPERTYPES:=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
128FACTORYTYPES:=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
129
130.IF "$(OS)" == "WNT" || "$(OS)" == "OS2"
131UNO_PATH := $(SOLARBINDIR)
132UNO_OUT := $(OUT)$/bin
133EXT_SO  := .dll
134.ELSE
135UNO_PATH := $(SOLARLIBDIR)
136UNO_OUT  := $(OUT)$/lib
137EXT_SO   := .so
138.ENDIF
139
140$(UNO_OUT)$/%$(EXT_SO): $(UNO_PATH)$/%$(EXT_SO)
141	$(COPY) $^ $@
142
143$(BIN)$/cpputest.rdb: $(ALLIDLFILES) $(UNO_OUT)$/invocadapt.uno$(EXT_SO) $(UNO_OUT)$/bootstrap.uno$(EXT_SO)
144	idlc -I$(PRJ) -I$(SOLARIDLDIR) -O$(BIN) $(ALLIDLFILES)
145	regmerge $@ /UCR $(BIN)$/{$(?:f:s/.idl/.urd/)}
146	regmerge $@ / $(UNOUCRRDB)
147	regcomp -register -r $@ -c reflection.uno$(DLLPOST)
148	touch $@
149
150unoheader: $(BIN)$/cpputest.rdb
151	cppumaker $(CPPUMAKERFLAGS) -BUCR -O$(UNOUCROUT) -T"$(TYPES);$(HELPERTYPES)" $(BIN)$/cpputest.rdb
152	cppumaker $(CPPUMAKERFLAGS) -BUCR -O$(UNOUCROUT) -T"$(FACTORYTYPES)" $(BIN)$/cpputest.rdb
153
154
155$(BIN)$/testdefaultbootstrapping.pl: testdefaultbootstrapping.pl
156	cp testdefaultbootstrapping.pl $@
157
158$(BIN)$/testrc: makefile.mk
159.IF "$(GUI)"=="WNT"
160	echo [Tests] > $@
161	echo TestKey1=com.sun.star.uno.NamingService.rdb >> $@
162.ELSE
163	echo '[Tests]' > $@
164	echo 'TestKey1=file:///'$(PWD)/$(BIN)'/com.sun.star.uno.NamingService.rdb' >> $@
165.ENDIF
166
167
168
169