Reindent WSDD files
[remote/remote-ws.git] / Makefile
blobbaebe6168636e232f739756331f300af8a914c23
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 # 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 ################################################################################
46 # Build section
47 ################################################################################
49 JAVAC = javac
50 JAVA = java
51 JAR = jar
52 SCP = scp
54 LIBDIR = lib
55 WSDDDIR = wsdd
56 BUILDDIR = build
57 SERVERSRCDIR = src
58 CLIENTSRCDIR = $(BUILDDIR)/src
59 SERVERBINDIR = $(BUILDDIR)/server
60 CLIENTBINDIR = $(BUILDDIR)/client
61 WSDLDIR = $(BUILDDIR)/wsdl
63 CLASSPATH = $(shell find $(PWD)/$(LIBDIR) -name "*.jar" | tr '\n' ':')$(PWD)/$(SERVERJAR)
65 COMPILE = $(JAVAC)
66 JAVA2WSDL = $(JAVA) org.apache.axis.wsdl.Java2WSDL
67 WSDL2JAVA = $(JAVA) org.apache.axis.wsdl.WSDL2Java
68 ADMINCLIENT = $(JAVA) org.apache.axis.client.AdminClient
70 SERVERSRC = $(shell find $(SERVERSRCDIR) -name "*.java")
71 SERVERJAR = $(LIBDIR)/remote-ws-server.jar
73 WSDDFILES = $(shell find $(WSDDDIR) -name "*.wsdd")
74 SERVICES = $(patsubst $(WSDDDIR)/%.wsdd,%,$(WSDDFILES))
76 WSDLFILES = $(patsubst %,$(WSDLDIR)/%.wsdl,$(SERVICES))
77 CLIENTSRC = $(patsubst %,$(CLIENTSRCDIR)/%-stamp,$(SERVICES))
78 CLIENTJAR = $(LIBDIR)/remote-ws-client.jar
80 export CLASSPATH
82 all: client
84 clean:
85 $(RM) -r $(BUILDDIR) $(SERVERJAR) $(CLIENTJAR)
87 ## Rules for building the server and client class files
89 # This requires the immediate step of building WSDL files from the
90 # server Java classes. The client Java classes is then generated from
91 # the WSDL files.
93 wsdl: $(WSDLFILES)
94 client-src: $(CLIENTSRC)
95 client: $(CLIENTJAR)
96 server: $(SERVERJAR)
98 $(SERVERJAR): $(SERVERSRC)
99 @$(RM) -r $(SERVERBINDIR)
100 @mkdir -p $(SERVERBINDIR)
101 $(COMPILE) -d $(SERVERBINDIR) $(SERVERSRC)
102 $(JAR) cf $@ -C $(SERVERBINDIR) .
104 $(CLIENTJAR): $(CLIENTSRC)
105 @$(RM) -r $(CLIENTBINDIR)
106 @mkdir -p $(CLIENTBINDIR)
107 $(COMPILE) -d $(CLIENTBINDIR) $(shell find $(CLIENTSRCDIR) -name "*.java")
108 $(JAR) cf $@ -C $(CLIENTBINDIR) .
110 $(CLIENTSRCDIR)/%-stamp: $(WSDLDIR)/%.wsdl
111 $(WSDL2JAVA) -o $(CLIENTSRCDIR) -pdiku.distlab.remote.$(*F) $<
112 touch $@
114 $(WSDLDIR)/%.wsdl: $(WSDDDIR)/%.wsdd $(SERVERJAR)
115 @mkdir -p $(WSDLDIR)
116 $(JAVA2WSDL) -l $(SERVICELOCATION)/$(*F) -o $(WSDLDIR)/$(*F).wsdl \
117 -p"$(*F)=$(*F).remote.distlab.diku" \
118 "$(*F).$$(sed -n 's/.*className.*value="[^.]*\.\(.*\)".*/\1/p' < $<)"
120 $(BUILDDIR)/undeploy.wsdd:
121 @mkdir -p $(CLIENTBINDIR)
122 { echo '<undeployment xmlns="http://xml.apache.org/axis/wsdd/">'; \
123 for i in $(SERVICES); do echo "<service name=\"$$i\"/>"; done; \
124 echo '</undeployment>'; } > $@
126 ## Deployment rules
128 # Rules for deploying the Re-Mote webservices and for testing the setup.
130 RUNADMINCLIENT = $(ADMINCLIENT) \
131 $(if $(ADMINHOST),-h $(ADMINHOST)) \
132 $(if $(ADMINPORT),-p $(ADMINPORT)) \
133 $(if $(ADMINUSER),-u $(ADMINUSER)) \
134 $(if $(ADMINPASS),-w $(ADMINPASS))
136 deploy-test:
137 $(RUNADMINCLIENT) list
139 deploy-wsdd:
140 $(RUNADMINCLIENT) $(WSDDFILES)
142 deploy-jar: $(SERVERJAR)
143 $(SCP) $< $(DEPLOYLOCATION)
145 deploy: deploy-jar deploy-wsdd
147 undeploy: $(BUILDDIR)/undeploy.wsdd
148 $(RUNADMINCLIENT) $<