Add a very subtle bug in nfs_set_error()
[deb_libnfs.git] / Makefile.in
... / ...
CommitLineData
1prefix = @prefix@
2exec_prefix = @exec_prefix@
3libdir = @libdir@
4includedir = @includedir@
5bindir = @bindir@
6LIBS=@LIBS@
7INSTALLCMD = @install@ -c
8is_darwin=@is_darwin@
9ENABLE_EXAMPLES=@ENABLE_EXAMPLES@
10
11CC=@CC@
12CFLAGS=@CFLAGS@ -g -O0 -fPIC -Wall -W -I. -Iinclude -Imount -Infs -Iportmap -Irquota "-D_U_=__attribute__((unused))" -D_FILE_OFFSET_BITS=64
13
14LIBNFS_A=lib/libnfs.a
15VERSION=1.0.0
16
17ifeq ("$(is_darwin)","yes")
18 LIBNFS_SO_NAME=libnfs.1.dylib
19 LIBNFS_SO=lib/libnfs.$(VERSION).dylib
20 LDFLAGS+=@CFLAGS@ -dynamiclib
21 RPCGEN_DEF=-DU_INT64_PLATTFORM_TYPE="u_int64_t"
22else
23 LIBNFS_SO_NAME=libnfs.so.1
24 LIBNFS_SO=lib/libnfs.so.$(VERSION)
25 LDFLAGS+=@CFLAGS@ -shared -Wl,-soname=$(LIBNFS_SO_NAME)
26endif
27
28LIB_OBJS = lib/pdu.o lib/init.o lib/socket.o \
29lib/libnfs.o lib/libnfs-sync.o
30
31LIBNFS_OBJS = \
32mount/libnfs-raw-mount.o mount/mount.o \
33portmap/libnfs-raw-portmap.o portmap/portmap.o \
34nfs/libnfs-raw-nfs.o nfs/nfs.o \
35rquota/libnfs-raw-rquota.o rquota/rquota.o
36
37ifeq ("$(ENABLE_EXAMPLES)","yes")
38 EXAMPLES=bin/nfsclient-raw bin/nfsclient-async bin/nfsclient-sync
39endif
40
41all: $(LIBNFS_SO) $(EXAMPLES)
42
43bin/nfsclient-async: examples/nfsclient-async.c $(LIBNFS_A)
44 mkdir -p bin
45 $(CC) $(CFLAGS) -o $@ examples/nfsclient-async.c $(LIBNFS_A) $(LIBS)
46
47bin/nfsclient-sync: examples/nfsclient-sync.c $(LIBNFS_A)
48 mkdir -p bin
49 $(CC) $(CFLAGS) -o $@ examples/nfsclient-sync.c $(LIBNFS_A) $(LIBS)
50
51bin/nfsclient-raw: examples/nfsclient-raw.c $(LIBNFS_A)
52 mkdir -p bin
53 $(CC) $(CFLAGS) -o $@ examples/nfsclient-raw.c $(LIBNFS_A) $(LIBS)
54
55$(LIBNFS_A): $(LIBNFS_OBJS) $(LIB_OBJS)
56 @echo Creating library $@
57 ar r $(LIBNFS_A) $(LIBNFS_OBJS) $(LIB_OBJS)
58 ranlib $(LIBNFS_A)
59
60$(LIBNFS_SO): $(LIBNFS_OBJS) $(LIB_OBJS)
61 @echo Creating shared library $@
62 $(CC) $(LDFLAGS) -o $@ $(LIBNFS_OBJS) $(LIB_OBJS)
63
64portmap/libnfs-raw-portmap.h: portmap/portmap.x
65 @echo Generating $@
66 rpcgen $(RPCGEN_DEF) -h portmap/portmap.x > portmap/libnfs-raw-portmap.h
67
68portmap/libnfs-raw-portmap.c: portmap/portmap.x
69 @echo Generating $@
70 rpcgen $(RPCGEN_DEF) -c portmap/portmap.x | sed -e "s/#include \".*portmap.h\"/#include \"libnfs-raw-portmap.h\"/" > portmap/libnfs-raw-portmap.c
71
72portmap/libnfs-raw-portmap.o: portmap/libnfs-raw-portmap.c portmap/libnfs-raw-portmap.h
73 @echo Compiling $@
74 $(CC) $(CFLAGS) -c portmap/libnfs-raw-portmap.c -o $@
75
76mount/libnfs-raw-mount.h: mount/mount.x
77 @echo Generating $@
78 rpcgen $(RPCGEN_DEF) -h mount/mount.x > mount/libnfs-raw-mount.h
79
80mount/libnfs-raw-mount.c: mount/mount.x
81 @echo Generating $@
82 rpcgen $(RPCGEN_DEF) -c mount/mount.x | sed -e "s/#include \".*mount.h\"/#include \"libnfs-raw-mount.h\"/" > mount/libnfs-raw-mount.c
83
84mount/libnfs-raw-mount.o: mount/libnfs-raw-mount.c mount/libnfs-raw-mount.h
85 @echo Compiling $@
86 $(CC) $(CFLAGS) -c mount/libnfs-raw-mount.c -o $@
87
88nfs/libnfs-raw-nfs.h: nfs/nfs.x
89 @echo Generating $@
90 rpcgen $(RPCGEN_DEF) -h nfs/nfs.x > nfs/libnfs-raw-nfs.h
91
92nfs/libnfs-raw-nfs.c: nfs/nfs.x
93 @echo Generating $@
94 rpcgen $(RPCGEN_DEF) -c nfs/nfs.x | sed -e "s/#include \".*nfs.h\"/#include \"libnfs-raw-nfs.h\"/" > nfs/libnfs-raw-nfs.c
95
96nfs/libnfs-raw-nfs.o: nfs/libnfs-raw-nfs.c nfs/libnfs-raw-nfs.h
97 @echo Compiling $@
98 $(CC) $(CFLAGS) -c nfs/libnfs-raw-nfs.c -o $@
99
100rquota/libnfs-raw-rquota.h: rquota/rquota.x
101 @echo Generating $@
102 rpcgen $(RPCGEN_DEF) -h rquota/rquota.x > rquota/libnfs-raw-rquota.h
103
104rquota/libnfs-raw-rquota.c: rquota/rquota.x
105 @echo Generating $@
106 rpcgen $(RPCGEN_DEF) -c rquota/rquota.x | sed -e "s/#include \".*rquota.h\"/#include \"libnfs-raw-rquota.h\"/" > rquota/libnfs-raw-rquota.c
107
108rquota/libnfs-raw-rquota.o: rquota/libnfs-raw-rquota.c rquota/libnfs-raw-rquota.h
109 @echo Compiling $@
110 $(CC) $(CFLAGS) -c rquota/libnfs-raw-rquota.c -o $@
111
112install: $(LIBNFS_A) $(LIBNFS_SO)
113 mkdir -p $(DESTDIR)$(libdir)
114 $(INSTALLCMD) -m 755 $(LIBNFS_SO) $(DESTDIR)$(libdir)
115 $(INSTALLCMD) -m 755 $(LIBNFS_A) $(DESTDIR)$(libdir)
116 @ldconfig@
117 mkdir -p $(DESTDIR)$(includedir)/nfsc
118 $(INSTALLCMD) -m 644 include/libnfs.h $(DESTDIR)$(includedir)/nfsc
119 $(INSTALLCMD) -m 644 include/libnfs-private.h $(DESTDIR)$(includedir)/nfsc
120 $(INSTALLCMD) -m 644 mount/libnfs-raw-mount.h $(DESTDIR)$(includedir)/nfsc
121 $(INSTALLCMD) -m 644 nfs/libnfs-raw-nfs.h $(DESTDIR)$(includedir)/nfsc
122 $(INSTALLCMD) -m 644 portmap/libnfs-raw-portmap.h $(DESTDIR)$(includedir)/nfsc
123
124distclean: clean
125 rm -f config.h config.log config.status configure Makefile
126
127clean:
128 rm -rf bin/*
129 rm -f lib/*.o lib/*.a $(LIBNFS_SO)
130 rm -f mount/*.o mount/libnfs-raw-mount.h mount/libnfs-raw-mount.c
131 rm -f nfs/*.o nfs/libnfs-raw-nfs.h nfs/libnfs-raw-nfs.c
132 rm -f portmap/*.o portmap/libnfs-raw-portmap.h portmap/libnfs-raw-portmap.c
133 rm -f rquota/*.o rquota/libnfs-raw-rquota.h rquota/libnfs-raw-rquota.c
134 rm -f nfsclient-raw nfsclient-async nfsclient-sync
135