fix build of the "utils" test drivers

This commit is contained in:
Jean-Francois Dockes 2011-05-05 18:30:02 +02:00
parent ab9107360b
commit fcc62bb73a
13 changed files with 53 additions and 32 deletions

View File

@ -1,11 +1,9 @@
depth = .. depth = ..
include $(depth)/mk/sysconf include $(depth)/mk/sysconf
PROGS = trnetcon trcopyfile trcircache trmd5 trreadfile trfileudi trconftree \ PROGS = trnetcon trcopyfile trcircache trmd5 trreadfile trfileudi \
wipedir smallut \ trconftree wipedir smallut trfstreewalk trpathut transcode trbase64 \
trfstreewalk trpathut \ trmimeparse trexecmd utf8iter idfile
transcode trbase64 \
trmimeparse trexecmd utf8iter idfile
all: $(PROGS) $(BIGLIB) all: $(PROGS) $(BIGLIB)
@ -15,38 +13,38 @@ force:
FSTREEWALK_OBJS= trfstreewalk.o fstreewalk.o $(BIGLIB) FSTREEWALK_OBJS= trfstreewalk.o fstreewalk.o $(BIGLIB)
trfstreewalk : $(FSTREEWALK_OBJS) trfstreewalk : $(FSTREEWALK_OBJS)
$(CXX) -o trfstreewalk $(FSTREEWALK_OBJS) $(LIBICONV) $(CXX) -o trfstreewalk $(FSTREEWALK_OBJS) $(LIBICONV) \
$(LIBSYS)
trfstreewalk.o : fstreewalk.cpp fstreewalk.h trfstreewalk.o : fstreewalk.cpp fstreewalk.h
$(CXX) -o trfstreewalk.o -c $(ALL_CXXFLAGS) \ $(CXX) -o trfstreewalk.o -c $(ALL_CXXFLAGS) \
-DTEST_FSTREEWALK fstreewalk.cpp -DTEST_FSTREEWALK fstreewalk.cpp
READFILE_OBJS= trreadfile.o readfile.o $(BIGLIB) READFILE_OBJS= trreadfile.o $(BIGLIB)
trreadfile : $(READFILE_OBJS) trreadfile : $(READFILE_OBJS)
$(CXX) -o trreadfile $(READFILE_OBJS) $(LIBICONV) $(LIBSYS) $(CXX) -o trreadfile $(READFILE_OBJS) $(LIBICONV) $(LIBSYS)
trreadfile.o : readfile.cpp readfile.h trreadfile.o : readfile.cpp readfile.h
$(CXX) -o trreadfile.o -c $(ALL_CXXFLAGS) \ $(CXX) -o trreadfile.o -c $(ALL_CXXFLAGS) \
-DTEST_READFILE readfile.cpp -DTEST_READFILE readfile.cpp
CIRCACHE_OBJS= trcircache.o circache.o $(BIGLIB) CIRCACHE_OBJS= trcircache.o $(BIGLIB)
trcircache : $(CIRCACHE_OBJS) trcircache : $(CIRCACHE_OBJS)
$(CXX) -o trcircache $(CIRCACHE_OBJS) $(LIBICONV) $(LIBSYS) $(CXX) -o trcircache $(CIRCACHE_OBJS) $(LIBICONV) $(LIBSYS) -lz
trcircache.o : circache.cpp circache.h trcircache.o : circache.cpp circache.h
$(CXX) -o trcircache.o -c $(ALL_CXXFLAGS) \ $(CXX) -o trcircache.o -c $(ALL_CXXFLAGS) \
-DTEST_CIRCACHE circache.cpp -DTEST_CIRCACHE circache.cpp
COPYFILE_OBJS= trcopyfile.o copyfile.o $(BIGLIB) COPYFILE_OBJS= trcopyfile.o $(BIGLIB)
trcopyfile : $(COPYFILE_OBJS) trcopyfile : $(COPYFILE_OBJS)
$(CXX) -o trcopyfile $(COPYFILE_OBJS) $(LIBICONV) $(LIBSYS) $(CXX) -o trcopyfile $(COPYFILE_OBJS) $(LIBICONV) $(LIBSYS)
trcopyfile.o : copyfile.cpp copyfile.h trcopyfile.o : copyfile.cpp copyfile.h
$(CXX) -o trcopyfile.o -c $(ALL_CXXFLAGS) \ $(CXX) -o trcopyfile.o -c $(ALL_CXXFLAGS) \
-DTEST_COPYFILE copyfile.cpp -DTEST_COPYFILE copyfile.cpp
MD5_OBJS= trmd5.o md5.o $(BIGLIB) MD5_OBJS= trmd5.o $(BIGLIB)
trmd5 : $(MD5_OBJS) trmd5 : $(MD5_OBJS)
$(CXX) -o trmd5 $(MD5_OBJS) $(LIBICONV) $(LIBSYS) $(CXX) -o trmd5 $(MD5_OBJS) $(LIBICONV) $(LIBSYS)
trmd5.o : md5.cpp md5.h trmd5.o : md5.cpp md5.h
$(CXX) -o trmd5.o -c $(ALL_CXXFLAGS) \ $(CXX) -o trmd5.o -c $(ALL_CXXFLAGS) -DTEST_MD5 md5.cpp
-DTEST_MD5 md5.cpp
PATHUT_OBJS= trpathut.o $(BIGLIB) PATHUT_OBJS= trpathut.o $(BIGLIB)
trpathut : $(PATHUT_OBJS) trpathut : $(PATHUT_OBJS)
@ -74,21 +72,24 @@ trexecmd.o : execmd.cpp execmd.h
TRANSCODE_OBJS= trtranscode.o $(BIGLIB) TRANSCODE_OBJS= trtranscode.o $(BIGLIB)
transcode : $(TRANSCODE_OBJS) transcode : $(TRANSCODE_OBJS)
$(CXX) $(ALL_CXXFLAGS) -o transcode $(TRANSCODE_OBJS) $(LIBICONV) $(CXX) $(ALL_CXXFLAGS) -o transcode $(TRANSCODE_OBJS) \
$(LIBICONV) $(LIBSYS)
trtranscode.o : transcode.cpp trtranscode.o : transcode.cpp
$(CXX) $(ALL_CXXFLAGS) -DTEST_TRANSCODE -c -o trtranscode.o \ $(CXX) $(ALL_CXXFLAGS) -DTEST_TRANSCODE -c -o trtranscode.o \
transcode.cpp transcode.cpp
IDFILE_OBJS= tridfile.o $(BIGLIB) IDFILE_OBJS= tridfile.o $(BIGLIB)
idfile : $(IDFILE_OBJS) idfile : $(IDFILE_OBJS)
$(CXX) $(ALL_CXXFLAGS) -o idfile $(IDFILE_OBJS) $(LIBICONV) $(CXX) $(ALL_CXXFLAGS) -o idfile $(IDFILE_OBJS) \
$(LIBICONV) $(LIBSYS)
tridfile.o : idfile.cpp tridfile.o : idfile.cpp
$(CXX) $(ALL_CXXFLAGS) -DTEST_IDFILE -c -o tridfile.o \ $(CXX) $(ALL_CXXFLAGS) -DTEST_IDFILE -c -o tridfile.o \
idfile.cpp idfile.cpp
MIMEPARSE_OBJS= trmimeparse.o $(BIGLIB) MIMEPARSE_OBJS= trmimeparse.o $(BIGLIB)
trmimeparse : $(MIMEPARSE_OBJS) trmimeparse : $(MIMEPARSE_OBJS)
$(CXX) $(ALL_CXXFLAGS) -o trmimeparse $(MIMEPARSE_OBJS) $(LIBICONV) $(CXX) $(ALL_CXXFLAGS) -o trmimeparse $(MIMEPARSE_OBJS) \
$(LIBICONV) $(LIBSYS)
trmimeparse.o : mimeparse.cpp trmimeparse.o : mimeparse.cpp
$(CXX) $(ALL_CXXFLAGS) -DTEST_MIMEPARSE -c -o trmimeparse.o \ $(CXX) $(ALL_CXXFLAGS) -DTEST_MIMEPARSE -c -o trmimeparse.o \
mimeparse.cpp mimeparse.cpp
@ -102,42 +103,40 @@ trsmallut.o : smallut.cpp smallut.h
../lib/smallut.o: smallut.cpp smallut.h ../lib/smallut.o: smallut.cpp smallut.h
cd ../lib;make smallut.o cd ../lib;make smallut.o
WIPEDIR_OBJS= trwipedir.o $(BIGLIB) WIPEDIR_OBJS= trwipedir.o $(BIGLIB)
wipedir : $(WIPEDIR_OBJS) wipedir : $(WIPEDIR_OBJS)
$(CXX) $(ALL_CXXFLAGS) -o wipedir $(WIPEDIR_OBJS) -L/opt/local/lib -liconv $(CXX) $(ALL_CXXFLAGS) -o wipedir $(WIPEDIR_OBJS) $(LIBICONV) $(LIBSYS)
trwipedir.o : wipedir.cpp trwipedir.o : wipedir.cpp
$(CXX) $(ALL_CXXFLAGS) -DTEST_WIPEDIR -c -o trwipedir.o \ $(CXX) $(ALL_CXXFLAGS) -DTEST_WIPEDIR -c -o trwipedir.o wipedir.cpp
wipedir.cpp
UTF8ITER_OBJS= trutf8iter.o UTF8ITER_OBJS= trutf8iter.o
utf8iter : $(UTF8ITER_OBJS) utf8iter : $(UTF8ITER_OBJS)
$(CXX) $(ALL_CXXFLAGS) -o utf8iter $(UTF8ITER_OBJS) $(BIGLIB) $(LIBICONV) $(CXX) $(ALL_CXXFLAGS) -o utf8iter $(UTF8ITER_OBJS) $(BIGLIB) \
$(LIBICONV) $(LIBSYS)
trutf8iter.o : utf8iter.cpp utf8iter.h trutf8iter.o : utf8iter.cpp utf8iter.h
$(CXX) $(ALL_CXXFLAGS) -DTEST_UTF8ITER -c -o trutf8iter.o \ $(CXX) $(ALL_CXXFLAGS) -DTEST_UTF8ITER -c -o trutf8iter.o utf8iter.cpp
utf8iter.cpp
CONFTREE_OBJS= trconftree.o $(BIGLIB) CONFTREE_OBJS= trconftree.o $(BIGLIB)
trconftree : $(CONFTREE_OBJS) trconftree : $(CONFTREE_OBJS)
$(CXX) $(ALL_CXXFLAGS) -o trconftree $(CONFTREE_OBJS) $(LIBICONV) $(CXX) $(ALL_CXXFLAGS) -o trconftree $(CONFTREE_OBJS) \
$(LIBICONV) $(LIBSYS)
trconftree.o : conftree.cpp trconftree.o : conftree.cpp
$(CXX) $(ALL_CXXFLAGS) -DTEST_CONFTREE -c -o trconftree.o \ $(CXX) $(ALL_CXXFLAGS) -DTEST_CONFTREE -c -o trconftree.o conftree.cpp
conftree.cpp
BASE64_OBJS= trbase64.o $(BIGLIB) BASE64_OBJS= trbase64.o $(BIGLIB)
trbase64 : $(BASE64_OBJS) trbase64 : $(BASE64_OBJS)
$(CXX) $(ALL_CXXFLAGS) -o trbase64 $(BASE64_OBJS) $(CXX) $(ALL_CXXFLAGS) -o trbase64 $(BASE64_OBJS)
trbase64.o : base64.cpp trbase64.o : base64.cpp
$(CXX) $(ALL_CXXFLAGS) -DTEST_BASE64 -c -o trbase64.o \ $(CXX) $(ALL_CXXFLAGS) -DTEST_BASE64 -c -o trbase64.o base64.cpp
base64.cpp
X11MON_OBJS= trx11mon.o x11mon.o X11MON_OBJS= trx11mon.o x11mon.o
trx11mon : $(X11MON_OBJS) trx11mon : $(X11MON_OBJS)
$(CXX) $(ALL_CXXFLAGS) -o trx11mon $(X11MON_OBJS) -L/usr/X11R6/lib -lX11 $(CXX) $(ALL_CXXFLAGS) -o trx11mon $(X11MON_OBJS) -L/usr/X11R6/lib -lX11
trx11mon.o : x11mon.cpp x11mon.h trx11mon.o : x11mon.cpp x11mon.h
$(CXX) -o trx11mon.o -c $(ALL_CXXFLAGS) -DTEST_X11MON x11mon.cpp $(CXX) -o trx11mon.o -c $(ALL_CXXFLAGS) -DTEST_X11MON x11mon.cpp
x11mon.o: x11mon.cpp x11mon.o: x11mon.cpp
$(CXX) -c -I/usr/X11R6/include $(ALL_CXXFLAGS) x11mon.cpp $(CXX) -c -I/usr/X11R6/include $(ALL_CXXFLAGS) x11mon.cpp
clean: clean:
rm -f *.o $(PROGS) rm -f *.o $(PROGS)

View File

@ -218,6 +218,7 @@ void base64_encode(const string &in, string &out)
#ifdef TEST_BASE64 #ifdef TEST_BASE64
#include <stdio.h> #include <stdio.h>
#include <stdlib.h>
#include "readfile.h" #include "readfile.h"

View File

@ -1189,6 +1189,7 @@ static bool inflateToDynBuf(void* inp, UINT inlen, void **outpp, UINT *outlenp)
} }
#else // TEST -> #else // TEST ->
#include "autoconfig.h"
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>

View File

@ -133,6 +133,7 @@ bool renameormove(const char *src, const char *dst, string &reason)
#else #else
#include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
#include <unistd.h> #include <unistd.h>

View File

@ -405,6 +405,9 @@ FsTreeWalker::Status FsTreeWalker::iwalk(const string &top,
} }
#else // TEST_FSTREEWALK #else // TEST_FSTREEWALK
#include <stdio.h>
#include <stdlib.h>
#include <sys/stat.h> #include <sys/stat.h>
#include <iostream> #include <iostream>

View File

@ -172,6 +172,9 @@ string idFileMem(const string& data)
#else #else
#include <stdio.h>
#include <stdlib.h>
#include <string> #include <string>
#include <iostream> #include <iostream>

View File

@ -393,6 +393,7 @@ bool MD5File(const string& filename, string &digest, string *reason)
#else #else
// Test driver // Test driver
#include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
#include <string> #include <string>

View File

@ -778,6 +778,9 @@ time_t rfc2822DateToUxTime(const string& dt)
#else #else
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <time.h> #include <time.h>
#include <string> #include <string>

View File

@ -888,6 +888,7 @@ NetconServLis::checkperms(void *cl, int)
#include <stdlib.h> #include <stdlib.h>
#include <unistd.h> #include <unistd.h>
#include <signal.h> #include <signal.h>
#include <string.h>
#include "debuglog.h" #include "debuglog.h"
#include "netcon.h" #include "netcon.h"

View File

@ -191,7 +191,9 @@ bool file_scan(const string &fn, FileScanDo* doer, off_t startoffs,
} }
#else // Test #else // Test
#include "autoconfig.h"
#include <stdio.h>
#include <sys/stat.h> #include <sys/stat.h>
#include <stdlib.h> #include <stdlib.h>
#include <unistd.h> #include <unistd.h>

View File

@ -132,13 +132,15 @@ bool transcode(const string &in, string &out, const string &icode,
#else #else
#include <stdio.h>
#include <stdlib.h>
#include <errno.h> #include <errno.h>
#include <unistd.h>
#include <fcntl.h>
#include <string> #include <string>
#include <iostream> #include <iostream>
#include <unistd.h>
#include <fcntl.h>
using namespace std; using namespace std;

View File

@ -15,6 +15,8 @@
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/ */
#include <stdio.h> #include <stdio.h>
#include <stdlib.h>
#include <string> #include <string>
#include <iostream> #include <iostream>
#include <list> #include <list>

View File

@ -112,6 +112,8 @@ int wipedir(const string& dir, bool selfalso, bool recurse)
#else // FILEUT_TEST #else // FILEUT_TEST
#include <stdio.h>
#include <stdlib.h>
#include <sys/stat.h> #include <sys/stat.h>
#include "wipedir.h" #include "wipedir.h"