您的位置:首页 > 其它

用C实现WebService[2]

2014-03-28 09:30 218 查看
原文出自:http://blog.chinaunix.net/uid-20314256-id-1967289.html

 

用C实现WebService[2]
2009-08-05 17:52:56

分类: LINUX

上一篇文章我说过原文的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

 
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: