上一篇文章我说过原文的Makefile错误很多,现在我把它修改了一下,基本上能用了,但还有一点警告信息。
#cat Makefile
GSOAP_ROOT=/usr/local/gsoap
SOAPNAME=soap
WSNAME=add
CC=g++ -g -DWITH_NONAMESPACES
SERVER_OBJS=$(SOAPNAME)C.o $(SOAPNAME)Server.o stdsoap2.o
CLIENT_OBJS=$(SOAPNAME)C.o $(SOAPNAME)Client.o stdsoap2.o
#总的目标
all:server client
$(WSNAME).wsdl:$(WSNAME).h
$(GSOAP_ROOT)/bin/soapcpp2 -c $(WSNAME).h
stdsoap2.o:stdsoap2.c
$(CC) -c $?
#编译一样生成规则的.o文件
$(SERVER_OBJS):%.o:%.c
$(CC) -c $?
$(CLIENT_OBJS):%.o:%.c
$(CC) -c $?
#编译服务器端
server:Makefile $(WSNAME).wsdl $(WSNAME)server.o $(SERVER_OBJS)
$(CC) -o $(WSNAME)server $(SERVER_OBJS) $(WSNAME)server.o
#编译客户端
client:Makefile $(WSNAME).wsdl $(WSNAME)client.o $(CLIENT_OBJS)
$(CC) -o $(WSNAME)client $(CLIENT_OBJS) $(WSNAME)client.o
clean:
rm -f *.o *.xml *.a *.wsdl *.nsmap $(SOAPNAME)H.h $(SOAPNAME)C.c $(SOAPNAME)Server.c $(SOAPNAME)Client.c $(SOAPNAME)Stub.* $(SOAPNAEM)$(WSNAME)Proxy.* $(SOAPNAME)$(WSNAME)Object.* $(SOAPNAME)ServerLib.c $(SOAPNAME)ClientLib.c $(WSNAME)server ns.xsd $(WSNAME)client
阅读(950) | 评论(0) | 转发(0) |