c94ef8fa6afdd47674ab6d7956a7ab822fbd0a28
[ira/wip.git] / examples / libsmbclient / smbwrapper / Makefile
1 LIBS = -lsmbclient -ldl
2 DEFS = -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE
3
4 CFLAGS = -I$(SAMBA_INCL) $(EXTLIB_INCL)
5
6 LDFLAGS = -L/usr/local/samba/lib
7
8 SMBINCLUDE = -I../../../source/include
9 CFLAGS= -fpic -g -O0 $(DEFS) $(SMBINCLUDE)
10
11 BIN     = .
12
13 STRFUNC = bsd-strlcat.o bsd-strlcpy.o
14
15
16 SMBWRAPPER_OBJS = smbw.o smbw_dir.o smbw_stat.o wrapper.o select.o $(STRFUNC)
17 SMBSH_OBJS      = smbsh.o $(STRFUNC)
18
19 all:    $(BIN)/smbwrapper.so $(BIN)/smbsh
20
21 $(BIN)/smbwrapper.so:   $(SMBWRAPPER_OBJS)
22         $(CC) -g \
23                 -Wl,-init=smbw_initialize \
24                 -shared \
25                 --export-all-symbols \
26                 -o $(BIN)/smbwrapper.so \
27                 $(SMBWRAPPER_OBJS) \
28                 $(LDFLAGS) \
29                 $(LIBS) \
30                 -Wl,-soname=`basename $@`
31
32 $(BIN)/smbsh: $(SMBSH_OBJS)
33         $(CC) -g -o $(BIN)/smbsh $(SMBSH_OBJS) $(LIBS) $(LDFLAGS)
34
35 opendir_smbsh:  opendir_smbsh.o
36         $(CC) -g -o opendir_smbsh opendir_smbsh.o $(LIBS) $(DMALLOC)
37
38 clean:
39         rm -f *.o *~ opendir_smbsh smbsh smbwrapper.so