Using Makefile
If you writing gtk application. You will have to use more than one source file to make the code more manage able. To compile the application you need to use make.
It is all you need to compile a c code with libgnomedb. This code will output an executable file with name ekoken. A more complicated makefiles using variable is like this
CC = gcc
LD = gcc
CFLAGS =
RM = rm -f
LDFLAGS = `pkg-config --libs gtk+-2.0`
PROG =
OBJS =
all : $(PROG)
%.o : %.c
$(CC) $(CFLAGS) -c $< -o $@
$(PROG) : $(OBJS)
$(LD) $(LDFLAGS) $(OBJS) -o $(PROG)
clean :
$(RM) $(OBJS) $(PROG)
Where PROG is the executable output and OBJS is the object file output with .o suffix.