auth: simplify result checking in checkCredentials
[remote/remote-ws.git] / Makefile
blob2af2ae02242707f56c36ac963de69010aa7d8325
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
53 CTAGS = ctags
55 LIBDIR = lib
56 WSDDDIR = wsdd
57 BUILDDIR = build
58 SERVERSRCDIR = src
59 CLIENTSRCDIR = $(BUILDDIR)/src
60 SERVERBINDIR = $(BUILDDIR)/server
61 CLIENTBINDIR = $(BUILDDIR)/client
62 WSDLDIR = $(BUILDDIR)/wsdl
64 CLASSPATH = $(shell find $(PWD)/$(LIBDIR) -name "*.jar" | tr '\n' ':')$(PWD)/$(SERVERJAR)
66 COMPILE = $(JAVAC)
67 JAVA2WSDL = $(JAVA) org.apache.axis.wsdl.Java2WSDL
68 WSDL2JAVA = $(JAVA) org.apache.axis.wsdl.WSDL2Java
69 ADMINCLIENT = $(JAVA) org.apache.axis.client.AdminClient
71 SERVERSRC = $(shell find $(SERVERSRCDIR) -name "*.java")
72 SERVERJAR = $(LIBDIR)/remote-ws-server.jar
74 WSDDFILES = $(shell find $(WSDDDIR) -name "*.wsdd")
75 SERVICES = $(patsubst $(WSDDDIR)/%.wsdd,%,$(WSDDFILES))
77 WSDLFILES = $(patsubst %,$(WSDLDIR)/%.wsdl,$(SERVICES))
78 CLIENTSRC = $(patsubst %,$(CLIENTSRCDIR)/%-stamp,$(SERVICES))
79 CLIENTJAR = $(LIBDIR)/remote-ws-client.jar
81 export CLASSPATH
83 all: client
85 clean:
86 $(RM) -r $(BUILDDIR) $(SERVERJAR) $(CLIENTJAR) tags
88 tags:
89 $(CTAGS) $(SERVERSRC)
91 strip-space:
92 perl -p -i -e 's/[ \t]*$$//' $(SERVERSRC) $(WSDDFILES)
94 ## Rules for building the server and client class files
96 # This requires the immediate step of building WSDL files from the
97 # server Java classes. The client Java classes is then generated from
98 # the WSDL files.
100 wsdl: $(WSDLFILES)
101 client-src: $(CLIENTSRC)
102 client: $(CLIENTJAR)
103 server: $(SERVERJAR)
105 $(SERVERJAR): $(SERVERSRC)
106 @$(RM) -r $(SERVERBINDIR)
107 @mkdir -p $(SERVERBINDIR)
108 $(COMPILE) -d $(SERVERBINDIR) $(SERVERSRC)
109 $(JAR) cf $@ -C $(SERVERBINDIR) .
111 $(CLIENTJAR): $(CLIENTSRC)
112 @$(RM) -r $(CLIENTBINDIR)
113 @mkdir -p $(CLIENTBINDIR)
114 $(COMPILE) -d $(CLIENTBINDIR) $(shell find $(CLIENTSRCDIR) -name "*.java")
115 $(JAR) cf $@ -C $(CLIENTBINDIR) .
117 $(CLIENTSRCDIR)/%-stamp: $(WSDLDIR)/%.wsdl
118 $(WSDL2JAVA) -o $(CLIENTSRCDIR) -pdiku.distlab.remote.$(*F) $<
119 touch $@
121 $(WSDLDIR)/%.wsdl: $(WSDDDIR)/%.wsdd $(SERVERJAR)
122 @mkdir -p $(WSDLDIR)
123 $(JAVA2WSDL) -l $(SERVICELOCATION)/$(*F) -o $(WSDLDIR)/$(*F).wsdl \
124 -p"$(*F)=$(*F).remote.distlab.diku" \
125 "$(*F).$$(sed -n 's/.*className.*value="[^.]*\.\(.*\)".*/\1/p' < $<)"
127 $(BUILDDIR)/undeploy.wsdd:
128 @mkdir -p $(CLIENTBINDIR)
129 { echo '<undeployment xmlns="http://xml.apache.org/axis/wsdd/">'; \
130 for i in $(SERVICES); do echo "<service name=\"$$i\"/>"; done; \
131 echo '</undeployment>'; } > $@
133 ## Deployment rules
135 # Rules for deploying the Re-Mote webservices and for testing the setup.
137 RUNADMINCLIENT = $(ADMINCLIENT) \
138 $(if $(ADMINHOST),-h $(ADMINHOST)) \
139 $(if $(ADMINPORT),-p $(ADMINPORT)) \
140 $(if $(ADMINUSER),-u $(ADMINUSER)) \
141 $(if $(ADMINPASS),-w $(ADMINPASS))
143 deploy-test:
144 $(RUNADMINCLIENT) list
146 deploy-wsdd:
147 $(RUNADMINCLIENT) $(WSDDFILES)
149 deploy-jar: $(SERVERJAR)
150 $(SCP) $< $(DEPLOYLOCATION)
152 deploy: deploy-jar deploy-wsdd
154 undeploy: $(BUILDDIR)/undeploy.wsdd
155 $(RUNADMINCLIENT) $<