1 ################################################################################
2 # Configuration section
3 ################################################################################
5 # Note, the following configuration settings can be put in a file called
6 # Makefile.local that is automatically sourced by this Makefile. See
7 # contrib/Makefile.local.* for examples.
9 ## Webservice address information
11 # Information about the location of the webservice. It will be used when
12 # generating the client stubs from the WSDL files.
14 SERVICEHOST
= localhost
16 SERVICEPATH
= axis
/services
18 ## Webservice admin service information
20 # Information about the location and credentials for accessing the
21 # webservice framework with the AdminClient. Test the information using
22 # the deploy-test rule, which will try to contact the server and list
23 # the available webservices.
25 # To use the AdminClient program's default values, leave the variables
33 ## Location of the server class files
35 # The host and path specifying where the web service application
36 # infrastructure jar files should be deployed. Note, that scp is used for
37 # this, so the DEPLOYLOCATION variable should hold a valid scp location.
39 # Leave DEPLOYHOST empty to deploy files locally.
42 DEPLOYPATH
= /path
/to
/tomcatX.X
/webapps
/axis
/WEB-INF
/lib
/
44 ################################################################################
46 ################################################################################
59 CLIENTSRCDIR
= $(BUILDDIR
)/src
60 SERVERBINDIR
= $(BUILDDIR
)/server
61 CLIENTBINDIR
= $(BUILDDIR
)/client
62 WSDLDIR
= $(BUILDDIR
)/wsdl
63 DOCDIR
= $(BUILDDIR
)/doc
65 CLASSPATH
= $(shell find
$(PWD
)/$(LIBDIR
) -name
"*.jar" | tr
'\n' ':')$(PWD
)/$(SERVERJAR
)
68 JAVA2WSDL
= $(JAVA
) org.apache.axis.wsdl.Java2WSDL
69 WSDL2JAVA
= $(JAVA
) org.apache.axis.wsdl.WSDL2Java
70 ADMINCLIENT
= $(JAVA
) org.apache.axis.client.AdminClient
72 SERVERSRC
= $(shell find
$(SERVERSRCDIR
) -name
"*.java")
73 SERVERJAR
= $(LIBDIR
)/remote-ws-server.jar
75 WSDDFILES
= $(shell find
$(WSDDDIR
) -name
"*.wsdd")
76 SERVICES
= $(patsubst $(WSDDDIR
)/%.wsdd
,%,$(WSDDFILES
))
78 WSDLFILES
= $(patsubst %,$(WSDLDIR
)/%.wsdl
,$(SERVICES
))
79 CLIENTSRC
= $(patsubst %,$(CLIENTSRCDIR
)/%-stamp
,$(SERVICES
))
80 CLIENTJAR
= $(LIBDIR
)/remote-ws-client.jar
82 DOCTITLE
= "Re-Mote Web Services"
84 ## Handle local configuration settings
86 # ... and assemble the location variables
88 -include Makefile.local
90 SERVICELOCATION
= http
://$(SERVICEHOST
):$(SERVICEPORT
)/$(SERVICEPATH
)
91 DEPLOYLOCATION
= $(DEPLOYHOST
)$(if
$(DEPLOYHOST
),:)$(DEPLOYPATH
)
93 ## Export the CLASSPATH to avoid setting it on the command line
95 # This can potentially overwrite local CLASSPATH configuration but as
96 # far as remote-ws is concerned it should be self contained.
105 $(RM
) -r
$(BUILDDIR
) $(SERVERJAR
) $(CLIENTJAR
) tags
108 $(CTAGS
) $(SERVERSRC
)
111 perl
-p
-i
-e
's/[ \t]*$$//' $(SERVERSRC
) $(WSDDFILES
)
114 $(JAVADOC
) -doctitle
$(DOCTITLE
) -windowtitle
$(DOCTITLE
) \
115 -d
$(DOCDIR
) $(SERVERSRC
)
117 .PHONY
: all doc
clean strip-space
119 ## Rules for building the server and client class files
121 # This requires the immediate step of building WSDL files from the
122 # server Java classes. The client Java classes is then generated from
126 client-src
: $(CLIENTSRC
)
130 $(SERVERJAR
): $(SERVERSRC
)
131 @
$(RM
) -r
$(SERVERBINDIR
)
132 @mkdir
-p
$(SERVERBINDIR
)
133 $(COMPILE
) -d
$(SERVERBINDIR
) $(SERVERSRC
)
134 $(JAR
) cf
$@
-C
$(SERVERBINDIR
) .
136 $(CLIENTJAR
): $(CLIENTSRC
)
137 @
$(RM
) -r
$(CLIENTBINDIR
)
138 @mkdir
-p
$(CLIENTBINDIR
)
139 $(COMPILE
) -d
$(CLIENTBINDIR
) $(shell find
$(CLIENTSRCDIR
) -name
"*.java")
140 $(JAR
) cf
$@
-C
$(CLIENTBINDIR
) .
142 $(CLIENTSRCDIR
)/%-stamp
: $(WSDLDIR
)/%.wsdl
143 $(WSDL2JAVA
) -o
$(CLIENTSRCDIR
) -pdiku.distlab.remote.
$(*F
) $<
146 $(WSDLDIR
)/%.wsdl
: $(WSDDDIR
)/%.wsdd
$(SERVERJAR
)
148 $(JAVA2WSDL
) -l
$(SERVICELOCATION
)/$(*F
) -o
$(WSDLDIR
)/$(*F
).wsdl \
149 -p
"$(*F)=$(*F).remote.distlab.diku" \
150 "$(*F).$$(sed -n 's/.*className.*value="[^.
]*\.\
(.
*\
)".*/\1/p' < $<)"
152 $(BUILDDIR
)/undeploy.wsdd
:
153 @mkdir
-p
$(CLIENTBINDIR
)
154 { echo
'<undeployment xmlns="http://xml.apache.org/axis/wsdd/">'; \
155 for i in
$(SERVICES
); do echo
"<service name=\"$$i\"/>"; done
; \
156 echo
'</undeployment>'; } > $@
160 # Rules for deploying the Re-Mote webservices and for testing the setup.
162 RUNADMINCLIENT
= $(ADMINCLIENT
) \
163 $(if
$(ADMINHOST
),-h
$(ADMINHOST
)) \
164 $(if
$(ADMINPORT
),-p
$(ADMINPORT
)) \
165 $(if
$(ADMINUSER
),-u
$(ADMINUSER
)) \
166 $(if
$(ADMINPASS
),-w
$(ADMINPASS
))
169 $(RUNADMINCLIENT
) list
172 $(RUNADMINCLIENT
) $(WSDDFILES
)
174 deploy-jar
: $(SERVERJAR
)
175 $(SCP
) $< $(DEPLOYLOCATION
)
177 deploy
: deploy-jar deploy-wsdd
179 undeploy
: $(BUILDDIR
)/undeploy.wsdd