9.3.4 `sic.c' & `sic.h'
Since the application binary has no installed header files, there is
little point in maintaining a corresponding header file for every
source, all of the structures shared by these files, and non-static
functions in these files are declared in `sic.h':
To hold together everything you have seen so far, the main
function creates a Sic parser and initialises it by adding syntax
handler functions and builtin functions from the two tables defined
earlier, before handing control to evalstream which will
eventually exit when the input stream is exhausted.
Now, the shell can be built and used:
|
$ bootstrap
...
$ ./configure --with-readline
...
$ make
...
make[2]: Entering directory `/tmp/sic/src'
gcc -DHAVE_CONFIG_H -I. -I.. -I../sic -I.. -I../sic -g -c sic.c
gcc -DHAVE_CONFIG_H -I. -I.. -I../sic -I.. -I../sic -g -c sic_builtin.c
gcc -DHAVE_CONFIG_H -I. -I.. -I../sic -I.. -I../sic -g -c sic_repl.c
gcc -DHAVE_CONFIG_H -I. -I.. -I../sic -I.. -I../sic -g -c sic_syntax.c
gcc -g -O2 -o sic sic.o sic_builtin.o sic_repl.o sic_syntax.o \
../sic/libsic.a ../replace/libreplace.a -lreadline
make[2]: Leaving directory `/tmp/sic/src'
...
$ ./src/sic
] pwd
/tmp/sic
] ls -F
Makefile aclocal.m4 config.cache configure* sic/
Makefile.am bootstrap* config.log configure.in src/
Makefile.in config/ config.status* replace/
] exit
$
|
This chapter has developed a solid foundation of code, which I will
return to in 12. A Large GNU Autotools Project, when Libtool will join
the fray. The chapters leading up to that explain what Libtool is for,
how to use it and integrate it into your own projects, and the
advantages it offers over building shared libraries with Automake (or
even just Make) alone.
|