Update the documentation in the configuration section
[remote/remote-ws.git] / Makefile
blob0d6d167af081c11276e9f911e2f4f5c42c984a46
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
11 SERVICEPORT = 8080
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
24 # empty.
26 ADMINHOST = amigos30.diku.dk
27 ADMINPORT = 8080
28 ADMINUSER =
29 ADMINPASS =
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 DEPLOYHOST = remote-server
38 DEPLOYPATH = /opt/apache-tomcat-5.5.12/webapps/axis/WEB-INF/classes/
40 DEPLOYLOCATION = $(DEPLOYHOST):$(DEPLOYPATH)
42 ################################################################################
43 # Build section
44 ################################################################################
46 JAVAC = javac
47 JAVA = java
48 JAR = jar
49 SCP = scp
51 LIBDIR = lib
52 WSDDDIR = wsdd
53 BUILDDIR = build
54 SERVERSRCDIR = src
55 CLIENTSRCDIR = $(BUILDDIR)/src
56 SERVERBINDIR = $(BUILDDIR)/server
57 CLIENTBINDIR = $(BUILDDIR)/client
58 WSDLDIR = $(BUILDDIR)/wsdl
60 CLASSPATH = $(shell find $(PWD)/$(LIBDIR) -name "*.jar" | tr '\n' ':')$(PWD)/$(SERVERJAR)
62 COMPILE = $(JAVAC)
63 JAVA2WSDL = $(JAVA) org.apache.axis.wsdl.Java2WSDL
64 WSDL2JAVA = $(JAVA) org.apache.axis.wsdl.WSDL2Java
65 ADMINCLIENT = $(JAVA) org.apache.axis.client.AdminClient
67 SERVERSRC = $(shell find $(SERVERSRCDIR) -name "*.java")
68 SERVERJAR = $(LIBDIR)/remote-ws-server.jar
70 WSDDFILES = $(shell find $(WSDDDIR) -name "*.wsdd")
71 SERVICES = $(patsubst $(WSDDDIR)/%.wsdd,%,$(WSDDFILES))
73 WSDLFILES = $(patsubst %,$(WSDLDIR)/%.wsdl,$(SERVICES))
74 CLIENTSRC = $(patsubst %,$(CLIENTSRCDIR)/%-stamp,$(SERVICES))
75 CLIENTJAR = $(LIBDIR)/remote-ws-client.jar
77 export CLASSPATH
79 all: client
81 clean:
82 $(RM) -r $(BUILDDIR) $(SERVERJAR) $(CLIENTJAR)
84 ## Rules for building the server and client class files
86 # This requires the immediate step of building WSDL files from the
87 # server Java classes. The client Java classes is then generated from
88 # the WSDL files.
90 wsdl: $(WSDLFILES)
91 client-src: $(CLIENTSRC)
92 client: $(CLIENTJAR)
93 server: $(SERVERJAR)
95 $(SERVERJAR): $(SERVERSRC)
96 @$(RM) -r $(SERVERBINDIR)
97 @mkdir -p $(SERVERBINDIR)
98 $(COMPILE) -d $(SERVERBINDIR) $(SERVERSRC)
99 $(JAR) cf $@ -C $(SERVERBINDIR) .
101 $(CLIENTJAR): $(CLIENTSRC)
102 @$(RM) -r $(CLIENTBINDIR)
103 @mkdir -p $(CLIENTBINDIR)
104 $(COMPILE) -d $(CLIENTBINDIR) $(shell find $(CLIENTSRCDIR) -name "*.java")
105 $(JAR) cf $@ -C $(CLIENTBINDIR) .
107 $(CLIENTSRCDIR)/%-stamp: $(WSDLDIR)/%.wsdl
108 $(WSDL2JAVA) -o $(CLIENTSRCDIR) -pdiku.distlab.remote.$(*F) $<
109 touch $@
111 $(WSDLDIR)/%.wsdl: $(WSDDDIR)/%.wsdd $(SERVERJAR)
112 @mkdir -p $(WSDLDIR)
113 $(JAVA2WSDL) -l $(SERVICELOCATION)/$(*F) -o $(WSDLDIR)/$(*F).wsdl \
114 -p"$(*F)=$(*F).remote.distlab.diku" \
115 "$(*F).$$(sed -n 's/.*className.*value="[^.]*\.\(.*\)".*/\1/p' < $<)"
117 $(BUILDDIR)/undeploy.wsdd:
118 @mkdir -p $(CLIENTBINDIR)
119 { echo '<undeployment xmlns="http://xml.apache.org/axis/wsdd/">'; \
120 for i in $(SERVICES); do echo "<service name=\"$$i\"/>"; done; \
121 echo '</undeployment>'; } > $@
123 ## Deployment rules
125 # Rules for deploying the Re-Mote webservices and for testing the setup.
127 RUNADMINCLIENT = $(ADMINCLIENT) \
128 $(if $(ADMINHOST),-h $(ADMINHOST)) \
129 $(if $(ADMINPORT),-p $(ADMINPORT)) \
130 $(if $(ADMINUSER),-u $(ADMINUSER)) \
131 $(if $(ADMINPASS),-w $(ADMINPASS))
133 deploy-test:
134 $(RUNADMINCLIENT) list
136 deploy-wsdd:
137 $(RUNADMINCLIENT) $(WSDDFILES)
139 deploy-classes: $(SERVERJAR)
140 $(SCP) -r $(SERVERBINDIR)/* $(WSDDDIR) $(DEPLOYLOCATION)
142 deploy: deploy-classes deploy-wsdd
144 undeploy: $(BUILDDIR)/undeploy.wsdd
145 $(RUNADMINCLIENT) $<