GTK+ FAQ
<<< Previous | Development with GTK+: the begining | Next >>>

# What about using the make utility?

This is a sample makefile which compile a GTK+ based program:

    # basic GTK+ app makefile
    SOURCES = myprg.c foo.c bar.c
    OBJS    = ${SOURCES:.c=.o}
    CFLAGS  = `gtk-config --cflags`
    LDADD   = `gtk-config --libs`
    CC      = gcc
    PACKAGE = myprg

    all : ${OBJS}
      ${CC} -o ${PACKAGE} ${OBJS} ${LDADD}

    .c.o:
      ${CC} ${CFLAGS} -c $<

    # end of file

For more information about the make utility, you should read either the related man page or the relevant info file.

<<< Previous | Home | Next >>>
I tried to compile a small Hello World of mine, but it failed. Any clue? | Up | I use the backquote stuff in my makefiles, but my make process failed.