add example for sync interface to probe for all local servers
[deb_libnfs.git] / Makefile.in
CommitLineData
84004dbf
RS
1prefix = @prefix@
2exec_prefix = @exec_prefix@
3libdir = @libdir@
310bb382 4includedir = @includedir@
84004dbf
RS
5bindir = @bindir@
6LIBS=@LIBS@
84004dbf 7INSTALLCMD = @install@ -c
fb109a12
M
8is_darwin=@is_darwin@
9ENABLE_EXAMPLES=@ENABLE_EXAMPLES@
84004dbf 10
fb109a12
M
11CC=@CC@
12CFLAGS=@CFLAGS@ -g -O0 -fPIC -Wall -W -I. -Iinclude -Imount -Infs -Iportmap -Irquota "-D_U_=__attribute__((unused))" -D_FILE_OFFSET_BITS=64
84004dbf
RS
13
14LIBNFS_A=lib/libnfs.a
84004dbf 15VERSION=1.0.0
fb109a12
M
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
84004dbf
RS
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 \
05a777d9
RS
34nfs/libnfs-raw-nfs.o nfs/nfs.o \
35rquota/libnfs-raw-rquota.o rquota/rquota.o
84004dbf 36
fb109a12 37ifeq ("$(ENABLE_EXAMPLES)","yes")
552c7665 38 EXAMPLES=bin/nfsclient-raw bin/nfsclient-async bin/nfsclient-sync bin/nfsclient-bcast bin/nfsclient-listservers
fb109a12 39endif
84004dbf
RS
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
28f7bd66
RS
55bin/nfsclient-bcast: examples/nfsclient-bcast.c $(LIBNFS_A)
56 mkdir -p bin
57 $(CC) $(CFLAGS) -o $@ examples/nfsclient-bcast.c $(LIBNFS_A) $(LIBS)
58
552c7665
RS
59bin/nfsclient-listservers: examples/nfsclient-listservers.c $(LIBNFS_A)
60 mkdir -p bin
61 $(CC) $(CFLAGS) -o $@ examples/nfsclient-listservers.c $(LIBNFS_A) $(LIBS)
62
84004dbf
RS
63$(LIBNFS_A): $(LIBNFS_OBJS) $(LIB_OBJS)
64 @echo Creating library $@
65 ar r $(LIBNFS_A) $(LIBNFS_OBJS) $(LIB_OBJS)
66 ranlib $(LIBNFS_A)
67
68$(LIBNFS_SO): $(LIBNFS_OBJS) $(LIB_OBJS)
69 @echo Creating shared library $@
fb109a12 70 $(CC) $(LDFLAGS) -o $@ $(LIBNFS_OBJS) $(LIB_OBJS)
84004dbf
RS
71
72portmap/libnfs-raw-portmap.h: portmap/portmap.x
73 @echo Generating $@
fb109a12 74 rpcgen $(RPCGEN_DEF) -h portmap/portmap.x > portmap/libnfs-raw-portmap.h
84004dbf
RS
75
76portmap/libnfs-raw-portmap.c: portmap/portmap.x
77 @echo Generating $@
fb109a12 78 rpcgen $(RPCGEN_DEF) -c portmap/portmap.x | sed -e "s/#include \".*portmap.h\"/#include \"libnfs-raw-portmap.h\"/" > portmap/libnfs-raw-portmap.c
84004dbf
RS
79
80portmap/libnfs-raw-portmap.o: portmap/libnfs-raw-portmap.c portmap/libnfs-raw-portmap.h
81 @echo Compiling $@
82 $(CC) $(CFLAGS) -c portmap/libnfs-raw-portmap.c -o $@
83
84mount/libnfs-raw-mount.h: mount/mount.x
85 @echo Generating $@
fb109a12 86 rpcgen $(RPCGEN_DEF) -h mount/mount.x > mount/libnfs-raw-mount.h
84004dbf
RS
87
88mount/libnfs-raw-mount.c: mount/mount.x
89 @echo Generating $@
fb109a12 90 rpcgen $(RPCGEN_DEF) -c mount/mount.x | sed -e "s/#include \".*mount.h\"/#include \"libnfs-raw-mount.h\"/" > mount/libnfs-raw-mount.c
84004dbf
RS
91
92mount/libnfs-raw-mount.o: mount/libnfs-raw-mount.c mount/libnfs-raw-mount.h
93 @echo Compiling $@
94 $(CC) $(CFLAGS) -c mount/libnfs-raw-mount.c -o $@
95
96nfs/libnfs-raw-nfs.h: nfs/nfs.x
97 @echo Generating $@
fb109a12 98 rpcgen $(RPCGEN_DEF) -h nfs/nfs.x > nfs/libnfs-raw-nfs.h
84004dbf
RS
99
100nfs/libnfs-raw-nfs.c: nfs/nfs.x
101 @echo Generating $@
fb109a12 102 rpcgen $(RPCGEN_DEF) -c nfs/nfs.x | sed -e "s/#include \".*nfs.h\"/#include \"libnfs-raw-nfs.h\"/" > nfs/libnfs-raw-nfs.c
84004dbf
RS
103
104nfs/libnfs-raw-nfs.o: nfs/libnfs-raw-nfs.c nfs/libnfs-raw-nfs.h
105 @echo Compiling $@
106 $(CC) $(CFLAGS) -c nfs/libnfs-raw-nfs.c -o $@
107
05a777d9
RS
108rquota/libnfs-raw-rquota.h: rquota/rquota.x
109 @echo Generating $@
fb109a12 110 rpcgen $(RPCGEN_DEF) -h rquota/rquota.x > rquota/libnfs-raw-rquota.h
05a777d9
RS
111
112rquota/libnfs-raw-rquota.c: rquota/rquota.x
113 @echo Generating $@
fb109a12 114 rpcgen $(RPCGEN_DEF) -c rquota/rquota.x | sed -e "s/#include \".*rquota.h\"/#include \"libnfs-raw-rquota.h\"/" > rquota/libnfs-raw-rquota.c
05a777d9
RS
115
116rquota/libnfs-raw-rquota.o: rquota/libnfs-raw-rquota.c rquota/libnfs-raw-rquota.h
117 @echo Compiling $@
118 $(CC) $(CFLAGS) -c rquota/libnfs-raw-rquota.c -o $@
119
84004dbf 120install: $(LIBNFS_A) $(LIBNFS_SO)
310bb382
SR
121 mkdir -p $(DESTDIR)$(libdir)
122 $(INSTALLCMD) -m 755 $(LIBNFS_SO) $(DESTDIR)$(libdir)
123 $(INSTALLCMD) -m 755 $(LIBNFS_A) $(DESTDIR)$(libdir)
84004dbf 124 @ldconfig@
310bb382
SR
125 mkdir -p $(DESTDIR)$(includedir)/nfsc
126 $(INSTALLCMD) -m 644 include/libnfs.h $(DESTDIR)$(includedir)/nfsc
127 $(INSTALLCMD) -m 644 include/libnfs-private.h $(DESTDIR)$(includedir)/nfsc
128 $(INSTALLCMD) -m 644 mount/libnfs-raw-mount.h $(DESTDIR)$(includedir)/nfsc
129 $(INSTALLCMD) -m 644 nfs/libnfs-raw-nfs.h $(DESTDIR)$(includedir)/nfsc
130 $(INSTALLCMD) -m 644 portmap/libnfs-raw-portmap.h $(DESTDIR)$(includedir)/nfsc
84004dbf
RS
131
132distclean: clean
133 rm -f config.h config.log config.status configure Makefile
134
135clean:
fb109a12
M
136 rm -rf bin/*
137 rm -f lib/*.o lib/*.a $(LIBNFS_SO)
84004dbf
RS
138 rm -f mount/*.o mount/libnfs-raw-mount.h mount/libnfs-raw-mount.c
139 rm -f nfs/*.o nfs/libnfs-raw-nfs.h nfs/libnfs-raw-nfs.c
140 rm -f portmap/*.o portmap/libnfs-raw-portmap.h portmap/libnfs-raw-portmap.c
05a777d9 141 rm -f rquota/*.o rquota/libnfs-raw-rquota.h rquota/libnfs-raw-rquota.c
84004dbf
RS
142 rm -f nfsclient-raw nfsclient-async nfsclient-sync
143