2008-08-21 12:48:44 +04:00
# Makefile.internal.in for building the libsmbclient examples
# from within a samba build.
#
# Use Makfile for building the examples with a libsmbclient
# installed to /usr/local/samba
CC = @CC@
2008-09-17 19:45:50 +04:00
SAMBA_DIR = ../../source3
2008-08-21 12:48:44 +04:00
SAMBA_INCLUDES = -I$( SAMBA_DIR) /include
SAMBA_LIBPATH = -L$( SAMBA_DIR) /bin
GTK_CFLAGS = ` gtk-config --cflags`
GTK_LIBS = ` gtk-config --libs`
#GTK_CFLAGS = `pkg-config gtk+-2.0 --cflags`
#GTK_LIBS = `pkg-config gtk+-2.0 --libs`
2008-09-17 19:49:16 +04:00
CCFLAGS = @CPPFLAGS@ @CFLAGS@ $( GTK_CFLAGS) $( SAMBA_INCLUDES)
2008-08-21 12:48:44 +04:00
PICFLAG = @PICFLAG@
LDFLAGS = $( SAMBA_LIBPATH) @PIE_LDFLAGS@ @LDFLAGS@
EXTERNAL_LIBS = @LIBS@ @LDAP_LIBS@ @KRB5_LIBS@ @NSCD_LIBS@
LIBSMBCLIENT_LIBS = -lwbclient -lsmbclient -ltalloc -ltdb -ldl -lresolv
CMDLINE_LIBS = @POPTLIBS@
LIBS = $( EXTERNAL_LIBS) $( LIBSMBCLIENT_LIBS)
# Compile a source file. (.c --> .o)
2008-09-17 19:49:16 +04:00
COMPILE_CC = $( CC) -I. $( CCFLAGS) $( PICFLAG) -c $< -o $@
2008-08-21 12:48:44 +04:00
COMPILE = $( COMPILE_CC)
MAKEDIR = || exec false; \
if test -d " $$ dir " ; then :; else \
echo mkdir " $$ dir " ; \
mkdir -p " $$ dir " >/dev/null 2>& 1 || \
test -d " $$ dir " || \
mkdir " $$ dir " || \
exec false; fi || exec false
TESTS = testsmbc \
testacl \
testacl2 \
testacl3 \
testbrowse \
testbrowse2 \
teststat \
teststat2 \
teststat3 \
testtruncate \
testchmod \
testutime \
testread \
testwrite
# tree \
all : $( TESTS ) smbsh
.c.o :
@if ( : >> $@ || : > $@ ) >/dev/null 2>& 1; then rm -f $@ ; else \
dir = ` echo $@ | sed 's,/[^/]*$$,,;s,^$$,.,' ` $( MAKEDIR) ; fi
@echo Compiling $* .c
@$( COMPILE) && exit 0; \
echo "The following command failed:" 1>& 2; \
echo " $( COMPILE_CC) " 1>& 2; \
$( COMPILE_CC) >/dev/null 2>& 1
testsmbc : testsmbc .o
@echo Linking testsmbc
2008-09-17 19:49:16 +04:00
@$( CC) $( CCFLAGS) $( LDFLAGS) -o $@ $< $( LIBS)
2008-08-21 12:48:44 +04:00
tree : tree .o
@echo Linking tree
2008-09-17 19:49:16 +04:00
@$( CC) $( GTK_CFLAGS) $( CCFLAGS) $( LDFLAGS) -o $@ $< $( GTK_LIBS) $( LIBS)
2008-08-21 12:48:44 +04:00
testacl : testacl .o
@echo Linking testacl
2008-09-17 19:49:16 +04:00
@$( CC) $( CCFLAGS) $( LDFLAGS) -o $@ $< $( LIBS) $( CMDLINE_LIBS)
2008-08-21 12:48:44 +04:00
testacl2 : testacl 2.o
@echo Linking testacl2
2008-09-17 19:49:16 +04:00
@$( CC) $( CCFLAGS) $( LDFLAGS) -o $@ $< $( LIBS) $( CMDLINE_LIBS)
2008-08-21 12:48:44 +04:00
testacl3 : testacl 3.o
@echo Linking testacl3
2008-09-17 19:49:16 +04:00
@$( CC) $( CCFLAGS) $( LDFLAGS) -o $@ $< $( LIBS) $( CMDLINE_LIBS)
2008-08-21 12:48:44 +04:00
testbrowse : testbrowse .o
@echo Linking testbrowse
2008-09-17 19:49:16 +04:00
@$( CC) $( CCFLAGS) $( LDFLAGS) -o $@ $< $( LIBS) $( CMDLINE_LIBS)
2008-08-21 12:48:44 +04:00
testbrowse2 : testbrowse 2.o
@echo Linking testbrowse2
2008-09-17 19:49:16 +04:00
@$( CC) $( CCFLAGS) $( LDFLAGS) -o $@ $< $( LIBS) $( CMDLINE_LIBS)
2008-08-21 12:48:44 +04:00
teststat : teststat .o
@echo Linking teststat
2008-09-17 19:49:16 +04:00
@$( CC) $( CCFLAGS) $( LDFLAGS) -o $@ $< $( LIBS) $( CMDLINE_LIBS)
2008-08-21 12:48:44 +04:00
teststat2 : teststat 2.o
@echo Linking teststat2
2008-09-17 19:49:16 +04:00
@$( CC) $( CCFLAGS) $( LDFLAGS) -o $@ $< $( LIBS) $( CMDLINE_LIBS)
2008-08-21 12:48:44 +04:00
teststat3 : teststat 3.o
@echo Linking teststat3
2008-09-17 19:49:16 +04:00
@$( CC) $( CCFLAGS) $( LDFLAGS) -o $@ $< $( LIBS) $( CMDLINE_LIBS)
2008-08-21 12:48:44 +04:00
testtruncate : testtruncate .o
@echo Linking testtruncate
2008-09-17 19:49:16 +04:00
@$( CC) $( CCFLAGS) $( LDFLAGS) -o $@ $< $( LIBS) $( CMDLINE_LIBS)
2008-08-21 12:48:44 +04:00
testchmod : testchmod .o
@echo Linking testchmod
2008-09-17 19:49:16 +04:00
@$( CC) $( CCFLAGS) $( LDFLAGS) -o $@ $< $( LIBS) $( CMDLINE_LIBS)
2008-08-21 12:48:44 +04:00
testutime : testutime .o
@echo Linking testutime
2008-09-17 19:49:16 +04:00
@$( CC) $( CCFLAGS) $( LDFLAGS) -o $@ $< $( LIBS) $( CMDLINE_LIBS)
2008-08-21 12:48:44 +04:00
testread : testread .o
@echo Linking testread
2008-09-17 19:49:16 +04:00
@$( CC) $( CCFLAGS) $( LDFLAGS) -o $@ $< $( LIBS) $( CMDLINE_LIBS)
2008-08-21 12:48:44 +04:00
testwrite : testwrite .o
@echo Linking testwrite
2008-09-17 19:49:16 +04:00
@$( CC) $( CCFLAGS) $( LDFLAGS) -o $@ $< $( LIBS) $( CMDLINE_LIBS)
2008-08-21 12:48:44 +04:00
testctx : testctx .o
@echo Linking testctx
2008-09-17 19:49:16 +04:00
@$( CC) $( CCFLAGS) $( LDFLAGS) -o $@ $< $( LIBS) $( CMDLINE_LIBS)
2008-08-21 12:48:44 +04:00
smbsh :
make -C smbwrapper
clean :
@rm -f *.o *~ $( TESTS)
@make -C smbwrapper clean