cflow
ctags
cscope
and 4th is vim:
vim
Connected together (through vim with refactor , taglist and cscope_maps) they can be combined into IDE.
Saturday, May 16, 2009
3 unix tools for working with legacy code
Posted by
Roman G.
at
5:04 PM
0
comments
Labels: development, performance, Unix, usability
chmod list of dirs (or files)
I have list of dirs (generated by some find statement) that we want to grant rights to execute (go inside dir).
the problem with
# cat list | xargs chmodintuitive one-line script is that it is not working.
Directories names in list contain spaces and ' " symbols and we have errors in directories processing doing that way.
Added slashes to get working script to grant rights to the files:
# cat list | sed 's/[\ '"'"'"]/\\&/g' | xargs chmod a+x
Posted by
Roman G.
at
12:16 PM
0
comments
Tuesday, March 10, 2009
reading:
UNIX Network Programming (Paperback)
by W. Richard Stevens (Author)
Posted by
Roman G.
at
9:30 AM
0
comments
Monday, March 9, 2009
DB Performance testing framework.
Example of architecture of testing framework for database:
Compilation-based:
1) get definition of database:
2) get (f)lex rules on database statements.
3) define testing profile (confioguration)
4) Write interpreter and tests builder (flex + yacc) based.
+-----------------------+ +---------------+
| DB statements syntax | | test profile |
+-----------------------+ +---------------+
|| ||
|| ||
\/ \/
+---------+ +-----------+
| flex | | yacc |
+---------+ +-----------+
\\ //
\\ //
\\ //
\\ //
\| |/
+----+ +-------------------------+ +---------------+
| DB |==>| test framework |===>| test results |
+----+ +-------------------------+ +---------------+
//
//
//
|/
+--------+
| Graphs |
+--------+
Interpretable:
+-----------------------+ +------------------------+
| DB statements syntax | | test processing rules |
+-----------------------+ +------------------------+
|| ||
|| +---------+ ||
\/ | profile | \/
+---------+ +---------+ +-----------+
| flex | || | yacc |
+---------+ \/ +-----------+
\\ +---------+ //
\\ | dotconf | //
\\ +---------+ //
\\ || //
\| \/ |/
+----+ +-------------------------+ +---------------+
| DB |==>| test framework |===>| test results |
+----+ +-------------------------+ +---------------+
//
//
//
|/
+--------+
| Graphs |
+--------+
Posted by
Roman G.
at
4:51 PM
0
comments
Labels: database, performance, SQL, Unix
Sunday, January 25, 2009
Simple plotting with gnuplot
from 1 column data of sequential var's:
gnuplot> plot 'data.dat' axes x1y2 with lines
from 2d (x and y)
gnuplot> plot 'data.dat' with lines
to output in external file:
ex1:
set terminal svg size 800 600
set out "test.svg"
plot sin(x)
ex2:
set terminal png size 800 600
set out "test.png"
plot 'c.dat' with lines
Posted by
Roman G.
at
2:38 AM
0
comments
Saturday, January 24, 2009
SVN: Load dump in
create dump:
$ svnadmin dump OLD_REPO_PATH > dumpfile
restore on another machine:
$ svnadmin create ~/SVN_REPO
$ svnadmin load ~/SVN_REPO/ < dumpfile
make first checkout
$ svn co file:///home/bugmaker/SVN_REPO/ .
Posted by
Roman G.
at
10:09 PM
0
comments
Sunday, December 14, 2008
current notes on net-snmp MIBs
Go watch them online there:
http://www.net-snmp.org/docs/mibs/
Or simply snmptranslate through shell after installing snmp-tools:
# snmptranslate -Tp SNMPv2-MIB::snmpMIB
+--snmpMIB(1)
|
+--snmpMIBObjects(1)
| |
| +--snmpTrap(4)
| | |
| | +-- ---N ObjID snmpTrapOID(1)
| | +-- ---N ObjID snmpTrapEnterprise(3)
| |
| +--snmpTraps(5)
| | |
| | +--coldStart(1)
| | +--warmStart(2)
| | +--linkDown(3)
| | +--linkUp(4)
| | +--authenticationFailure(5)
| |
| +--snmpSet(6)
| |
| +-- -RW- INTEGER snmpSetSerialNo(1)
| Textual Convention: TestAndIncr
| Range: 0..2147483647
|
+--snmpMIBConformance(2)
|
+--snmpMIBCompliances(1)
| |
| +--snmpBasicCompliance(2)
| +--snmpBasicComplianceRev2(3)
|
+--snmpMIBGroups(2)
|
+--snmpSetGroup(5)
+--systemGroup(6)
+--snmpBasicNotificationsGroup(7)
+--snmpGroup(8)
+--snmpCommunityGroup(9)
+--snmpObsoleteGroup(10)
+--snmpWarmStartNotificationGroup(11)
+--snmpNotificationGroup(12)
http://www.net-snmp.org/wiki/index.php/TUT:Writing_a_MIB_Module
Saturday, December 13, 2008
nftw command line version
POSIX C function nftw(p) walks directory tree and reports data on files.
Its just do something like piping of output of following line:
find| xargs stat
Below is 100+ lines C++ version of previous line.
g++ exnftw.cpp -o nftw
------------%<---------------
#include <ftw.h>
#include <stdio.h>
#include <map>
#include <string>
/* 2008, Author: R.Gritsulyak
* public domain;
* g++ exnftw.cpp -o nftw
* no warranty for this utility.
* patch sendto: roman.gritsulyak@gmail.com
*
* example for:
int nftw(const char *path, int (*fn)(const char *,
const struct stat *, int, struct FTW *), int depth, int flags);
*/
int fnfn(const char *path, const struct stat *ptr,int type, struct FTW *pft)
{
const char *sflag;
switch (type)
{
case FTW_NS:
sflag="FTW_NS: no permission: exit by error;";
break;
case FTW_DNR:
sflag="FTW_DNR: can not read dir; no further reads in;";
break;
case FTW_SLN:
sflag="FTW_SLN: symbolic link on unknown path;";
break;
case FTW_SL:
sflag="FTW_SL: should detect if only FTW_SL set;";
break;
case FTW_DP:
sflag="FTW_DP: directory; we have been in subdirs;";
break;
case FTW_D:
sflag="FTW_D: directory;";
break;
case FTW_F:
sflag="FTW_F: file;";
break;
default:
sflag="unknown:";
}
printf("path=%s\ntype=%s\n",path,sflag);
printf("stat.st_ino=%d\n",ptr->st_ino);
printf("stat.st_mode=%o\n",ptr->st_mode);
printf("stat.st_nlink=%d\n",ptr->st_nlink);
printf("stat.st_uid=0%o\n",ptr->st_dev);
printf("stat.st_gid=0%o\n",ptr->st_gid);
printf("stat.st_rdev=%d\n",ptr->st_rdev);
printf("stat.st_size=%d\n",ptr->st_size);
printf("stat.st_blksize=%u\n",ptr->st_blksize);
printf("stat.st_blocks=%u\n",ptr->st_blocks);
printf("stat.st_atime=%d\n",ptr->st_atime);
printf("stat.st_mtime=%d\n",ptr->st_mtime);
printf("stat.st_ctime=%d\n",ptr->st_ctime);
printf("FTW.base=%d\nFTW.level=%d\n",pft->base,pft->level);
return 0;
}
struct chvali
{
std::string ch;
int vali;
};
const int FLAGS=4;
chvali stra[] = {
{"FTW_CHDIR",FTW_CHDIR},
{"FTW_DEPTH",FTW_DEPTH},
{"FTW_MOUNT",FTW_MOUNT},
{"FTW_PHYS",FTW_PHYS}
};
int usage()
{
fprintf(stderr,"Usage: nftw FLAG1 FLAG2 .. FLAGn depth path\n");
fprintf(stderr,"FLAGx is FTW_CHDIR, FTW_DEPTH, FTW_MOUNT, FTW_PHYS\n");
fprintf(stderr,"depth # number of file descriptors to use\n");
fprintf(stderr,"man p nftw # for further details on args\n");
return 0;
}
int main(int argc, char ** argv)
{
char * inipath;
int i;
int idepth;
int iflags;
int curflag;
std::map<std::string,int> chv;
for(i=0;i<FLAGS;i++)
chv[stra[i].ch]=stra[i].vali;
if (argc < 3)
{
exit(1);
}
iflags = 0;
std::map<std::string,int> iter;
for(i=1; i<argc-2; i++)
{
if( chv.find(argv[i]) != chv.end() )
iflags = iflags | chv[argv[i]];
else
{
fprintf(stderr, "Wrong argument type:%s\n",argv[i]);
usage();
exit(-1);
}
}
inipath = argv[argc-1];
char *dum;
idepth = strtol(argv[argc-2], &dum, 0);
if(nftw(inipath,fnfn,idepth,iflags) != 0)
{
perror("nftw");
exit(2);
}
exit(0);
}
related ftw example
Posted by
Roman G.
at
9:32 AM
0
comments
Labels: GNU/Linux, performance, Unix, usability
Thursday, December 11, 2008
When minimalism is bad
I like Unix's for Unix's philosophy of building utilities, each of them makes just one job, but does this job perfectly.
This perfect minimalism make you extremely powerful in solving complex tasks with minimal effort.
However, I found myself completely frustrated by minimalism of some Unix's GUI applications.
For example Orage, XFCE organizer doesn't have feature of displaying full list of items (events, todo's journaled items).
There is search field there, but you can not search by glob or regexp :)
Normally, empty field should mean "display all", but not "display nothing".
Posted by
Roman G.
at
8:58 AM
0
comments
Sunday, December 7, 2008
Long "which" command form
To display not only where is location of which argument,
but also attributes, and if it is symlink, on what binary this symlink points.
example of usage:
rtg@kubic-roman:~$ lwhich mine
error:no such
rtg@kubic-roman:~$ lwhich which
lrwxrwxrwx 1 root root 10 2008-05-01 01:30 /usr/bin/which -> /bin/which
rtg@kubic-roman:~$ lwhich nawk
lrwxrwxrwx 1 root root 22 2007-10-20 04:33 /usr/bin/nawk -> /etc/alternatives/nawk
rtg@kubic-roman:~$ ls -la /etc/alternatives/nawk
lrwxrwxrwx 1 root root 13 2008-05-01 16:49 /etc/alternatives/nawk -> /usr/bin/gawk
To use:
add in your .bashrc :
function lwhich
{
awhich=`which $1`
if [ "a$awhich" != "a" ] # or just if [ $awhich ]
then
ls -l $awhich
else
echo "error:no such"
fi
}
(re)start bash shell.
My Ubuntu installation config variables:
Linux kubic-roman 2.6.24-22-generic #1 SMP Mon Nov 24 18:32:42 UTC 2008 i686 GNU/Linux
generated by APUE2 book chapter 2 program:
opt.txt
_POSIX_ADVISORY_INFO is defined (val is 200112)
sysconf says _POSIX_ADVISORY_INFO = 200112
_POSIX_ASYNCHRONOUS_IO is defined (val is 200112)
sysconf says _POSIX_ASYNCHRONOUS_IO = 200112
_POSIX_BARRIERS is defined (val is 200112)
sysconf says _POSIX_BARRIERS = 200112
_POSIX_CPUTIME is defined (val is 0)
sysconf says _POSIX_CPUTIME = 200112
_POSIX_CLOCK_SELECTION is defined (val is 200112)
sysconf says _POSIX_CLOCK_SELECTION = 200112
_POSIX_FSYNC is defined (val is 200112)
sysconf says _POSIX_FSYNC = 200112
_POSIX_IPV6 is defined (val is 200112)
sysconf says _POSIX_IPV6 = 200112
_POSIX_MAPPED_FILES is defined (val is 200112)
sysconf says _POSIX_MAPPED_FILES = 200112
_POSIX_MEMLOCK is defined (val is 200112)
sysconf says _POSIX_MEMLOCK = 200112
_POSIX_MEMLOCK_RANGE is defined (val is 200112)
sysconf says _POSIX_MEMLOCK_RANGE = 200112
_POSIX_MONOTONIC_CLOCK is defined (val is 0)
sysconf says _POSIX_MONOTONIC_CLOCK = 200112
_POSIX_MEMORY_PROTECTION is defined (val is 200112)
sysconf says _POSIX_MEMORY_PROTECTION = 200112
_POSIX_MESSAGE_PASSING is defined (val is 200112)
sysconf says _POSIX_MESSAGE_PASSING = 200112
_POSIX_PRIORITIZED_IO is defined (val is 200112)
sysconf says _POSIX_PRIORITIZED_IO = 200112
_POSIX_PRIORITIZED_SCHEDULING is undefined
no symbol for _POSIX_PRIORITIZED_SCHEDULING
_POSIX_RAW_SOCKETS is defined (val is 200112)
sysconf says _POSIX_RAW_SOCKETS = 200112
_POSIX_REALTIME_SIGNALS is defined (val is 200112)
sysconf says _POSIX_REALTIME_SIGNALS = 200112
_POSIX_SEMAPHORES is defined (val is 200112)
sysconf says _POSIX_SEMAPHORES = 200112
_POSIX_SHARED_MEMORY_OBJECTS is defined (val is 200112)
sysconf says _POSIX_SHARED_MEMORY_OBJECTS = 200112
_POSIX_SYNCHRONIZED_IO is defined (val is 200112)
sysconf says _POSIX_SYNCHRONIZED_IO = 200112
_POSIX_SPIN_LOCKS is defined (val is 200112)
sysconf says _POSIX_SPIN_LOCKS = 200112
_POSIX_SPAWN is defined (val is 200112)
sysconf says _POSIX_SPAWN = 200112
_POSIX_SPORADIC_SERVER is defined (val is -1)
sysconf says _POSIX_SPORADIC_SERVER = (no limit)
_POSIX_THREAD_CPUTIME is defined (val is 0)
sysconf says _POSIX_THREAD_CPUTIME = 200112
_POSIX_TRACE_EVENT_FILTER is defined (val is -1)
sysconf says _POSIX_TRACE_EVENT_FILTER = (no limit)
_POSIX_TIMEOUTS is defined (val is 200112)
sysconf says _POSIX_TIMEOUTS = 200112
_POSIX_TIMERS is defined (val is 200112)
sysconf says _POSIX_TIMERS = 200112
_POSIX_THREAD_PRIO_INHERIT is defined (val is 200112)
sysconf says _POSIX_THREAD_PRIO_INHERIT = 200112
_POSIX_THREAD_PRIO_PROTECT is defined (val is 200112)
sysconf says _POSIX_THREAD_PRIO_PROTECT = 200112
_POSIX_THREAD_PRIORITY_SCHEDULING is defined (val is 200112)
sysconf says _POSIX_THREAD_PRIORITY_SCHEDULING = 200112
_POSIX_TRACE is defined (val is -1)
sysconf says _POSIX_TRACE = (no limit)
_POSIX_TRACE_INHERIT is defined (val is -1)
sysconf says _POSIX_TRACE_INHERIT = (no limit)
_POSIX_TRACE_LOG is defined (val is -1)
sysconf says _POSIX_TRACE_LOG = (no limit)
_POSIX_THREAD_ATTR_STACKADDR is defined (val is 200112)
sysconf says _POSIX_THREAD_ATTR_STACKADDR = 200112
_POSIX_THREAD_SAFE_FUNCTIONS is defined (val is 200112)
sysconf says _POSIX_THREAD_SAFE_FUNCTIONS = 200112
_POSIX_THREAD_PROCESS_SHARED is defined (val is 200112)
sysconf says _POSIX_THREAD_PROCESS_SHARED = 200112
_POSIX_THREAD_SPORADIC_SERVER is defined (val is -1)
sysconf says _POSIX_THREAD_SPORADIC_SERVER = (no limit)
_POSIX_THREAD_ATTR_STACKSIZE is defined (val is 200112)
sysconf says _POSIX_THREAD_ATTR_STACKSIZE = 200112
_POSIX_THREADS is defined (val is 200112)
sysconf says _POSIX_THREADS = 200112
_POSIX_TYPED_MEMORY_OBJECTS is defined (val is -1)
sysconf says _POSIX_TYPED_MEMORY_OBJECTS = (no limit)
_XOPEN_UNIX is defined (val is 1)
sysconf says _XOPEN_UNIX = 1
_XOPEN_STREAMS is undefined
no symbol for _XOPEN_STREAMS
_XOPEN_CRYPT is defined (val is 1)
sysconf says _XOPEN_CRYPT = 1
_XOPEN_LEGACY is defined (val is 1)
sysconf says _XOPEN_LEGACY = 1
_XOPEN_REALTIME is defined (val is 1)
sysconf says _XOPEN_REALTIME = 1
_XOPEN_REALTIME_THREADS is defined (val is 1)
sysconf says _XOPEN_REALTIME_THREADS = 1
_POSIX_JOB_CONTROL is defined (val is 1)
sysconf says _POSIX_JOB_CONTROL = 1
_POSIX_READER_WRITER_LOCKS is defined (val is 200112)
sysconf says _POSIX_READER_WRITER_LOCKS = 200112
_POSIX_REGEXP is defined (val is 1)
sysconf says _POSIX_REGEXP = 1
_POSIX_SAVED_IDS is defined (val is 1)
sysconf says _POSIX_SAVED_IDS = 1
_POSIX_SHELL is defined (val is 1)
sysconf says _POSIX_SHELL = 1
_XOPEN_ENH_I18N is defined (val is 1)
sysconf says _XOPEN_ENH_I18N = 1
_XOPEN_SHM is defined (val is 1)
sysconf says _XOPEN_SHM = 1
_POSIX_VERSION is defined (val is 200112)
sysconf says _POSIX_VERSION = 200112
_XOPEN_VERSION is defined (val is 600)
sysconf says _XOPEN_VERSION = 600
_POSIX_CHOWN_RESTRICTED is defined (val is 1)
pathconf says _POSIX_CHOWN_RESTRICTED = 1
_POSIX_NO_TRUNC is defined (val is 1)
pathconf says _POSIX_NO_TRUNC = 1
_POSIX_VDISABLE is defined (val is 0)
pathconf says _POSIX_VDISABLE = 0
POSIX_ASYNC_IO is undefined
pathconf says POSIX_ASYNC_IO = (no limit)
POSIX_PRIO_IO is undefined
pathconf says POSIX_PRIO_IO = (no limit)
POSIX_SYNC_IO is undefined
pathconf says POSIX_SYNC_IO = (no limit)
----%<----
ARG_MAX defined to be 131072
ARG_MAX = 131072
no symbol for ATEXIT_MAX
ATEXIT_MAX = 2147483647
CHARCLASS_NAME_MAX defined to be 2048
CHARCLASS_NAME_MAX = 2048
no symbol for CHILD_MAX
CHILD_MAX = 8125
no symbol for CLOCKTICKSPERSECOND /*clock ticks/second*/
CLOCKTICKSPERSECOND /*clock ticks/second*/ = 100
COLL_WEIGHTS_MAX defined to be 255
COLL_WEIGHTS_MAX = 255
HOST_NAME_MAX defined to be 64
HOST_NAME_MAX = 64
IOV_MAX defined to be 1024
IOV_MAX = 1024
LINE_MAX defined to be 2048
LINE_MAX = 2048
LOGIN_NAME_MAX defined to be 256
LOGIN_NAME_MAX = 256
NGROUPS_MAX defined to be 65536
NGROUPS_MAX = 65536
no symbol for OPEN_MAX
OPEN_MAX = 1024
no symbol for PAGESIZE
PAGESIZE = 4096
no symbol for PAGE_SIZE
PAGE_SIZE = 4096
RE_DUP_MAX defined to be 32767
RE_DUP_MAX = 32767
no symbol for STREAM_MAX
STREAM_MAX = 16
no symbol for SYMLOOP_MAX
SYMLOOP_MAX = (no limit)
TTY_NAME_MAX defined to be 32
TTY_NAME_MAX = 32
no symbol for TZNAME_MAX
TZNAME_MAX = 6
MAX_CANON defined to be 255
MAX_CANON = 255
MAX_INPUT defined to be 255
MAX_INPUT = 255
no symbol for FILESIZEBITS
FILESIZEBITS = 64
no symbol for LINK_MAX
LINK_MAX = 32000
NAME_MAX defined to be 255
NAME_MAX = 255
PATH_MAX defined to be 4096
PATH_MAX = 4096
PIPE_BUF defined to be 4096
PIPE_BUF = 4096
no symbol for SYMLINK_MAX
SYMLINK_MAX = (no limit)
Posted by
Roman G.
at
10:32 PM
0
comments
Labels: analysis, C, GNU/Linux, Language comparison, performance, Ubuntu, Unix
Wednesday, November 26, 2008
bookmarks on books been read in different time and steel having value:
http://samizdat.mines.edu/howto/HowToBeAProgrammer.html?p=1#id2854043: How to be a programmer. good and short.
http://www.yendor.com/programming/unix/apue/apue.html - classical book by Stevens. Very good one.
http://www.advancedlinuxprogramming.com/ not such a good as AUP book by Stevens, but worth to see.
http://www.cs.fsu.edu/~xyuan/cop5570/ - another advanced source, .ppt with examples.
http://catb.org/~esr/writings/taoup/html/ Art of unix programming - very good for understanding architectural principles of Unixes.
http://www.khmere.com/freebsd_book/index.html
HOT:
http://www.tldp.org/HOWTO/Linux+FreeBSD.html
Posted by
Roman G.
at
11:51 PM
0
comments
Tuesday, November 25, 2008
Signal delivery failed under FreeBSD.
Some unexpected staff from system well known for stability:
http://www.freebsd.org/cgi/query-pr.cgi?pr=129172
Strange, thу code cited under the link works fine under (Ubuntu 8.04) GNU/Linux.
Monday, November 24, 2008
freebsd biord in top
It is state, like deadlock, when kernel is waiting for disk.
wdrain is like this.
These both are undocumented states of kernel.
If you catched biord or wdrain (or ffsfsn, or some other strange status (that is not kserel, CPU, select or other statuses normally displayed in top), most probably you have serious problems with i/o of your application.
Posted by
Roman G.
at
11:32 PM
0
comments
Labels: FreeBSD, performance, reading, Unix, usability
Last 3 monthes events
FreeBSD 6.3 installed and configured (and reconfigured a lot of times).
Very different from stable production one's.
ipfw, pf, and semaphores are in separate kernel modules that is strange.
Very different administration utilities from Linux.
However, it is much more friendly to developer than AIX (if do not consider commercial tools).
Mysql actively used. Moved completely to open-source tools.
Moved to group work ( from stand-slone mode ).
Posted by
Roman G.
at
11:07 PM
0
comments
Thursday, November 13, 2008
SVN commands + vim
in .bashrc:
function svnvim
{
# 9 params will be enogh
svn $1 $2 $3 $4 $5 $6 $7 $8 $9 > /tmp/svnvim.$1 ; vim /tmp/svnvim.$1
}
example of usage:
svnvim diff [param]
then is colourized
(if colours are set in vim).
another usage:
svnvim log
svnvim info
svnvim stat
(just remembered vi command inside sybase isql :) )
Posted by
Roman G.
at
11:16 PM
0
comments
Sunday, September 28, 2008
Using autotools HOWTO
Following is autotools buildsystem example/introduction that can be used to create build system that:
- creates libraries
- creates binaries
- creates tests
- executes tests
It is intended for C/C++ project.
Following directory structure used:
project/ +-- reconfig.sh
+-- configure.ac
+-- Makefile.am
+-- src +
tests+
lib/libname/
project/reconfig.sh :
#!/bin/sh
# after editing configure.ac and|or Makefile.am
aclocal
autoheader
autoconf
automake -a
./configure
project/Automake.am :
SUBDIRS = lib/libname src tests
project_pre = 1.0
project/configure.ac :
AC_PREREQ(2.59)
AC_INIT(src/project.h)
AM_INIT_AUTOMAKE(project,1.0)
AC_CONFIG_HEADER([config.h])
# Checks for programs.
AC_PROG_CXX
AC_PROG_CC
# Checks for libraries.
AC_PROG_RANLIB
# Checks for header files.
# Checks for typedefs, structures, and compiler characteristics.
AC_C_CONST
# Checks for library functions.
AC_HEADER_STDC
AC_CHECK_FUNCS([memset])
AC_OUTPUT([Makefile src/Makefile
lib/libname/Makefile
tests/Makefile])
project/src/Makefile.am
bin_PROGRAMS = project
clones_SOURCES = main.cpp
clones_LDADD = ../lib/libname/libname.a
#clones_LIBADD = ../lib/libname/libname.a
AM_CPPFLAGS = -I$(top_srcdir)/lib/libname/ -I$(top_builddir)/lib/libname/
project/src/libname/Makefile.am:
noinst_LIBRARIES = libname.a
libname_a_SOURCES = libname.c
project/tests/Makefile.am:
bin_PROGRAMS = libname_test test_test
libname_test_SOURCES = libname_test.c
test_test_SOURCES = test_test.c
critbit_test_LDADD = ../lib/libname/libname.a
check_PROGRAMS = libname_test test_test
TESTS = $(check_PROGRAMS)
AM_CPPFLAGS = -I$(top_srcdir)/lib/libname/ -I$(top_builddir)/lib/libname/
To try this example:
- create directory structure;
- create .sh , .in and .ac files described above
- Create .c files with names defined in .am files above in corresponding dirs.
reconfig.sh should create makefiles that could be used.
make - creates binaries
make check - performs tests
another introduction could be found there:
http://www.gnu.org/software/automake/manual/html_node/Creating-amhello.html#Creating-amhello