1 | #
|
---|
2 | # Copyright (C) 2016 Oracle Corporation
|
---|
3 | #
|
---|
4 | # This file is part of VirtualBox Open Source Edition (OSE), as
|
---|
5 | # available from http://www.virtualbox.org. This file is free software;
|
---|
6 | # you can redistribute it and/or modify it under the terms of the GNU
|
---|
7 | # General Public License (GPL) as published by the Free Software
|
---|
8 | # Foundation, in version 2 as it comes in the "COPYING" file of the
|
---|
9 | # VirtualBox OSE distribution. VirtualBox OSE is distributed in the
|
---|
10 | # hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
|
---|
11 | #
|
---|
12 |
|
---|
13 | XSLTPROC = xsltproc
|
---|
14 | ifeq ($(PATH_GSOAP),)
|
---|
15 | PATH_GSOAP = $(lastword $(sort $(wildcard $(KBUILD_DEVTOOLS)/common/gsoap/*)))
|
---|
16 | endif
|
---|
17 | PATH_GSOAP_BIN := $(strip $(PATH_GSOAP))
|
---|
18 | ifeq ($(PATH_GSOAP_BIN),)
|
---|
19 | PATH_GSOAP_BIN = /usr/bin
|
---|
20 | endif
|
---|
21 | SOAPCPP2 = $(PATH_GSOAP_BIN)/soapcpp2
|
---|
22 |
|
---|
23 | ifneq ($(MAKECMDGOALS),clean)
|
---|
24 | ifeq ($(wildcard $(PATH_GSOAP)/stdsoap2.cpp),)
|
---|
25 | $(error Fix PATH_GSOAP!)
|
---|
26 | endif
|
---|
27 | endif
|
---|
28 |
|
---|
29 | WEBSRVWSDL2GSOAPH = ../../../xsl/websrv-wsdl2gsoapH.xsl
|
---|
30 | WEBSRVNSMAPXSL = ../../../xsl/websrv-nsmap.xsl
|
---|
31 | VBOXWEBIDLSRC = ../../../../VirtualBox.xidl
|
---|
32 | VBOXWEBWSDL = ../../../vboxweb.wsdl
|
---|
33 | SPLITSOAPCCPP = ../../../tools/split-soapC.cpp
|
---|
34 | SOAPCCPP = $(foreach num,1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20,soapC-$(num).cpp)
|
---|
35 | SOAPCO = $(patsubst %.cpp,%.o,$(SOAPCCPP))
|
---|
36 |
|
---|
37 | webtest: webtest.o soapClient.o $(SOAPCO) stdsoap2.o
|
---|
38 | $(CXX) -O2 -o $@ $^ -lssl -lcrypto
|
---|
39 |
|
---|
40 | webtest.o: webtest.cpp soapC.cpp vboxwebsrv.nsmap
|
---|
41 | $(CXX) -O2 -DWITH_OPENSSL -c -o $@ $< -I$(PATH_GSOAP)
|
---|
42 |
|
---|
43 | soapClient.o: soapC.cpp
|
---|
44 | $(CXX) -O2 -c -o $@ soapClient.cpp -I$(PATH_GSOAP)
|
---|
45 |
|
---|
46 | $(SOAPCO): soapC-%.o: soapC-%.cpp
|
---|
47 | $(CXX) -O0 -c -o $@ $< -I$(PATH_GSOAP)
|
---|
48 |
|
---|
49 | soapC.cpp: gsoapH_from_xslt.h
|
---|
50 | $(SOAPCPP2) -x -L -2 -w -I$(PATH_GSOAP)/import $^
|
---|
51 |
|
---|
52 | stdsoap2.o: $(PATH_GSOAP)/stdsoap2.cpp
|
---|
53 | $(CXX) -O2 -DWITH_OPENSSL -c -o $@ $<
|
---|
54 |
|
---|
55 | gsoapH_from_xslt.h:
|
---|
56 | $(XSLTPROC) -o $@ $(WEBSRVWSDL2GSOAPH) $(VBOXWEBWSDL)
|
---|
57 |
|
---|
58 | vboxwebsrv.nsmap:
|
---|
59 | $(XSLTPROC) -o $@ $(WEBSRVNSMAPXSL) $(VBOXWEBIDLSRC)
|
---|
60 |
|
---|
61 | $(subst soapC,%,$(SOAPCCPP)): split-soapC %.cpp
|
---|
62 | ./split-soapC soapC.cpp . 20
|
---|
63 |
|
---|
64 | split-soapC: $(SPLITSOAPCCPP)
|
---|
65 | $(CXX) -O2 -o $@ $<
|
---|
66 |
|
---|
67 | .PHONY: clean
|
---|
68 | clean:
|
---|
69 | rm -f gsoapH_from_xslt.h
|
---|
70 | rm -f soapStub.h soapServer.cpp soapC.cpp soapClient.cpp
|
---|
71 | rm -f soapH.h soapvboxBindingObject.h soapvboxBindingProxy.h
|
---|
72 | rm -f vboxBinding.nsmap
|
---|
73 | rm -f vboxwebsrv.nsmap
|
---|
74 | rm -f split-soapC
|
---|
75 | rm -f $(SOAPCCPP) $(SOAPCO)
|
---|
76 | rm -f soapClient.o stdsoap2.o
|
---|
77 | rm -f webtest.o webtest
|
---|
78 | rm -f soapC-split-done
|
---|