Patterns in static

Apophenia

Makefile

Instead of giving lengthy GCC commands at the command prompt, you can use a Makefile to do most of the work. How to:

PROGNAME = your_program_name_here
objects =$(PROGNAME).o
CFLAGS = -g -Wall 
LINKFLAGS = -lapophenia -lgsl -lgslcblas -lsqlite3
c: $(objects)
     gcc $(CFLAGS) $(objects) $(LINKFLAGS) -o $(PROGNAME)
$(objects): %.o: %.c 
     gcc $(CFLAGS) -c $< -o $@

By the way, if your system has pkg-config, then you can use it for a slightly more robust and readable makefile. Replace the above C and link flags with:

CFLAGS = -g -Wall `pkg-config --cflags apophenia`
LINKFLAGS = `pkg-config --libs apophenia`

The pkg-config program will then fill in the appropriate directories and libraries. Pkg-config knows Apophenia depends on the GSL and (if applicable) sqlite3, so you need only list the most-dependent library.

SourceForge.net Logo

Autogenerated by doxygen on 23 Nov 2009.