Commit efad8b22 authored by 's avatar
Browse files

fixed some problems with mapi_errors.c


git-svn-id: file:///home/svn/mapi/trunk@551 8d5bb341-7cf1-0310-8cf6-ba355fef3186
parent 3008eaea
......@@ -87,24 +87,21 @@ mstring.o: mstring.c mstring.h
mapipktdecoder.o: mapipktdecoder.c mapipktdecoder.h
$(CC) $(CFLAGS) -fPIC -c $<
create_error_files: errors.mapi
# cat errors.mapi|grep -v "#" > mapi_errors.dat
# cat errors.mapi|grep "#" > mapi_errors.h
mapi.so: mapi.o mapiipc.o mapilibhandler.o fhelp.o flist.o parseconf.o mapipktdecoder.o priorities.o printfstring.o mapi_errors.o
$(CC) -shared -o $@ $^ -ldl $(KEYNOTE_LDADD) -lpthread
mapi_errors.c: errors.mapi
echo -e "#ifndef _MAPI_ERRORS_H_ \n#define _MAPI_ERRORS_H_\n" > mapi_errors.h
cat errors.mapi|grep "^#" >> mapi_errors.h
echo -e "\ntypedef struct foobar{ \nint err_no; \nchar *desc; \n} errorstruct; \n" >> mapi_errors.h
echo -e "\ntypedef struct errstrct{ \nint err_no; \nchar *desc; \n} errorstruct; \n" >> mapi_errors.h
echo -e "#endif\n" >> mapi_errors.h
echo -e "#include \"mapi_errors.h\"\n\n const errorstruct Errors[] =\n{" > mapi_errors.c
cat errors.mapi|grep -v "#"| awk -F= '{print "{" $$1 "," $$2 "},"}' >> mapi_errors.c
echo -e "{0,0} };\n\n" >> mapi_errors.c
mapi.so: mapi.o mapiipc.o mapilibhandler.o fhelp.o flist.o parseconf.o mapipktdecoder.o priorities.o printfstring.o mapi_errors.o
$(CC) -shared -o $@ $^ -ldl $(KEYNOTE_LDADD) -lpthread
mapi_errors.o: create_error_files
mapi_errors.o: mapi_errors.c mapi_errors.h
$(CC) $(CFLAGS) -c mapi_errors.c
#mapierror.o: mapierror.c mapi.h
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment