1 ################################################################################
2 # Configuration section
3 ################################################################################
5 ## Webservice address information
7 # Information about the location of the webservice. It will be used when
8 # generating the client stubs from the WSDL files.
10 SERVICEHOST
= amigos30.diku.dk
12 SERVICEPATH
= axis
/services
14 SERVICELOCATION
= http
://$(SERVICEHOST
):$(SERVICEPORT
)/$(SERVICEPATH
)
16 ## Webservice admin service information
18 # Information about the location and credentials for accessing the
19 # webservice framework with the AdminClient. Test the information using
20 # the deploy-test rule, which will try to contact the server and list
21 # the available webservices.
23 # To use the AdminClient program's default values, leave the variables
26 ADMINHOST
= amigos30.diku.dk
31 ## Location of the server class files
33 # The host and path specifying where the web service application
34 # infrastructure classes should be deployed. Note, that scp is used for
35 # this, so the DEPLOYLOCATION variable should hold a valid scp location.
37 # Leave DEPLOYHOST empty to deploy files locally.
39 DEPLOYHOST
= remote-server
40 DEPLOYPATH
= /opt
/apache-tomcat-5.5
.12/webapps
/axis
/WEB-INF
/classes
/
43 DEPLOYLOCATION
= $(DEPLOYHOST
)$(if
$(DEPLOYHOST
),:)$(DEPLOYPATH
)
45 ################################################################################
47 ################################################################################
60 CLIENTSRCDIR
= $(BUILDDIR
)/src
61 SERVERBINDIR
= $(BUILDDIR
)/server
62 CLIENTBINDIR
= $(BUILDDIR
)/client
63 WSDLDIR
= $(BUILDDIR
)/wsdl
64 DOCDIR
= $(BUILDDIR
)/doc
66 CLASSPATH
= $(shell find
$(PWD
)/$(LIBDIR
) -name
"*.jar" | tr
'\n' ':')$(PWD
)/$(SERVERJAR
)
69 JAVA2WSDL
= $(JAVA
) org.apache.axis.wsdl.Java2WSDL
70 WSDL2JAVA
= $(JAVA
) org.apache.axis.wsdl.WSDL2Java
71 ADMINCLIENT
= $(JAVA
) org.apache.axis.client.AdminClient
73 SERVERSRC
= $(shell find
$(SERVERSRCDIR
) -name
"*.java")
74 SERVERJAR
= $(LIBDIR
)/remote-ws-server.jar
76 WSDDFILES
= $(shell find
$(WSDDDIR
) -name
"*.wsdd")
77 SERVICES
= $(patsubst $(WSDDDIR
)/%.wsdd
,%,$(WSDDFILES
))
79 WSDLFILES
= $(patsubst %,$(WSDLDIR
)/%.wsdl
,$(SERVICES
))
80 CLIENTSRC
= $(patsubst %,$(CLIENTSRCDIR
)/%-stamp
,$(SERVICES
))
81 CLIENTJAR
= $(LIBDIR
)/remote-ws-client.jar
88 $(RM
) -r
$(BUILDDIR
) $(SERVERJAR
) $(CLIENTJAR
) tags
94 perl
-p
-i
-e
's/[ \t]*$$//' $(SERVERSRC
) $(WSDDFILES
)
97 $(JAVADOC
) -d
$(DOCDIR
) $(SERVERSRC
)
101 ## Rules for building the server and client class files
103 # This requires the immediate step of building WSDL files from the
104 # server Java classes. The client Java classes is then generated from
108 client-src
: $(CLIENTSRC
)
112 $(SERVERJAR
): $(SERVERSRC
)
113 @
$(RM
) -r
$(SERVERBINDIR
)
114 @mkdir
-p
$(SERVERBINDIR
)
115 $(COMPILE
) -d
$(SERVERBINDIR
) $(SERVERSRC
)
116 $(JAR
) cf
$@
-C
$(SERVERBINDIR
) .
118 $(CLIENTJAR
): $(CLIENTSRC
)
119 @
$(RM
) -r
$(CLIENTBINDIR
)
120 @mkdir
-p
$(CLIENTBINDIR
)
121 $(COMPILE
) -d
$(CLIENTBINDIR
) $(shell find
$(CLIENTSRCDIR
) -name
"*.java")
122 $(JAR
) cf
$@
-C
$(CLIENTBINDIR
) .
124 $(CLIENTSRCDIR
)/%-stamp
: $(WSDLDIR
)/%.wsdl
125 $(WSDL2JAVA
) -o
$(CLIENTSRCDIR
) -pdiku.distlab.remote.
$(*F
) $<
128 $(WSDLDIR
)/%.wsdl
: $(WSDDDIR
)/%.wsdd
$(SERVERJAR
)
130 $(JAVA2WSDL
) -l
$(SERVICELOCATION
)/$(*F
) -o
$(WSDLDIR
)/$(*F
).wsdl \
131 -p
"$(*F)=$(*F).remote.distlab.diku" \
132 "$(*F).$$(sed -n 's/.*className.*value="[^.
]*\.\
(.
*\
)".*/\1/p' < $<)"
134 $(BUILDDIR
)/undeploy.wsdd
:
135 @mkdir
-p
$(CLIENTBINDIR
)
136 { echo
'<undeployment xmlns="http://xml.apache.org/axis/wsdd/">'; \
137 for i in
$(SERVICES
); do echo
"<service name=\"$$i\"/>"; done
; \
138 echo
'</undeployment>'; } > $@
142 # Rules for deploying the Re-Mote webservices and for testing the setup.
144 RUNADMINCLIENT
= $(ADMINCLIENT
) \
145 $(if
$(ADMINHOST
),-h
$(ADMINHOST
)) \
146 $(if
$(ADMINPORT
),-p
$(ADMINPORT
)) \
147 $(if
$(ADMINUSER
),-u
$(ADMINUSER
)) \
148 $(if
$(ADMINPASS
),-w
$(ADMINPASS
))
151 $(RUNADMINCLIENT
) list
154 $(RUNADMINCLIENT
) $(WSDDFILES
)
156 deploy-jar
: $(SERVERJAR
)
157 $(SCP
) $< $(DEPLOYLOCATION
)
159 deploy
: deploy-jar deploy-wsdd
161 undeploy
: $(BUILDDIR
)/undeploy.wsdd