1 ################################################################################
2 # Configuration section
3 ################################################################################
5 ## Location of the server class files
7 # The host and path specifying where the web service application
8 # infrastructure classes should be deployed. Note, that scp is used for
9 # this, so the DEPLOYLOCATION variable should hold a valid scp location.
11 DEPLOYHOST
= remote-server
12 DEPLOYPATH
= /opt
/apache-tomcat-5.5
.12/webapps
/axis
/WEB-INF
/classes
/
14 DEPLOYLOCATION
= $(DEPLOYHOST
):$(DEPLOYPATH
)
16 ## Webservice address information
18 # Information about the location of the webservice.
20 SERVICEHOST
= amigos30.diku.dk
22 SERVICEPATH
= axis
/services
24 SERVICELOCATION
= http
://$(SERVICEHOST
):$(SERVICEPORT
)/$(SERVICEPATH
)
26 ## Webservice admin service information
28 # Information about the location and credentials for accessing the
29 # webservice framework with the AdminClient. Test the information using
30 # the deploy-test rule.
32 # To use default values, set them to the empty string.
34 ADMINHOST
= amigos30.diku.dk
39 ################################################################################
41 ################################################################################
52 CLIENTSRCDIR
= $(BUILDDIR
)/src
53 SERVERBINDIR
= $(BUILDDIR
)/server
54 CLIENTBINDIR
= $(BUILDDIR
)/client
55 WSDLDIR
= $(BUILDDIR
)/wsdl
57 CLASSPATH
= $(shell find
$(PWD
)/$(LIBDIR
) -name
"*.jar" | tr
'\n' ':')$(PWD
)/$(SERVERJAR
)
60 JAVA2WSDL
= $(JAVA
) org.apache.axis.wsdl.Java2WSDL
61 WSDL2JAVA
= $(JAVA
) org.apache.axis.wsdl.WSDL2Java
62 ADMINCLIENT
= $(JAVA
) org.apache.axis.client.AdminClient
64 SERVERSRC
= $(shell find
$(SERVERSRCDIR
) -name
"*.java")
65 SERVERJAR
= $(LIBDIR
)/remote-ws-server.jar
67 WSDDFILES
= $(shell find
$(WSDDDIR
) -name
"*.wsdd")
68 SERVICES
= $(patsubst $(WSDDDIR
)/%.wsdd
,%,$(WSDDFILES
))
70 WSDLFILES
= $(patsubst %,$(WSDLDIR
)/%.wsdl
,$(SERVICES
))
71 CLIENTSRC
= $(patsubst %,$(CLIENTSRCDIR
)/%-stamp
,$(SERVICES
))
72 CLIENTJAR
= $(LIBDIR
)/remote-ws-client.jar
79 $(RM
) -r
$(BUILDDIR
) $(SERVERJAR
) $(CLIENTJAR
)
81 ## Rules for building the server and client class files
83 # This requires the immediate step of building WSDL files from the
84 # server Java classes. The client Java classes is then generated from
88 client-src
: $(CLIENTSRC
)
92 $(SERVERJAR
): $(SERVERSRC
)
93 @
$(RM
) -r
$(SERVERBINDIR
)
94 @mkdir
-p
$(SERVERBINDIR
)
95 $(COMPILE
) -d
$(SERVERBINDIR
) $(SERVERSRC
)
96 $(JAR
) cf
$@
-C
$(SERVERBINDIR
) .
98 $(CLIENTJAR
): $(CLIENTSRC
)
99 @
$(RM
) -r
$(CLIENTBINDIR
)
100 @mkdir
-p
$(CLIENTBINDIR
)
101 $(COMPILE
) -d
$(CLIENTBINDIR
) $(shell find
$(CLIENTSRCDIR
) -name
"*.java")
102 $(JAR
) cf
$@
-C
$(CLIENTBINDIR
) .
104 $(CLIENTSRCDIR
)/%-stamp
: $(WSDLDIR
)/%.wsdl
105 $(WSDL2JAVA
) -o
$(CLIENTSRCDIR
) -pdiku.distlab.remote.
$(*F
) $<
108 $(WSDLDIR
)/%.wsdl
: $(WSDDDIR
)/%.wsdd
$(SERVERJAR
)
110 $(JAVA2WSDL
) -l
$(SERVICELOCATION
)/$(*F
) -o
$(WSDLDIR
)/$(*F
).wsdl \
111 -p
"$(*F)=$(*F).remote.distlab.diku" \
112 "$(*F).$$(sed -n 's/.*className.*value="[^.
]*\.\
(.
*\
)".*/\1/p' < $<)"
116 # Rules for deploying the Re-Mote webservices and for testing the setup.
118 RUNADMINCLIENT
= $(ADMINCLIENT
) \
119 $(if
$(ADMINHOST
),-h
$(ADMINHOST
)) \
120 $(if
$(ADMINPORT
),-p
$(ADMINPORT
)) \
121 $(if
$(ADMINUSER
),-u
$(ADMINUSER
)) \
122 $(if
$(ADMINPASS
),-w
$(ADMINPASS
))
125 $(RUNADMINCLIENT
) list
127 deploy-wsdd
: $(SERVERJAR
)
128 $(RUNADMINCLIENT
) $(WSDDFILES
)
130 deploy-classes
: $(SERVERJAR
)
131 $(SCP
) -r
$(SERVERBINDIR
)/* $(WSDDDIR
) $(DEPLOYLOCATION
)
133 deploy
: deploy-classes deploy-wsdd