I have been learning c++ for some time but i want to try learning by applying what little i know to using the classes in clanlib. I would like some help with setting up a basic makefile that i can use for any program that uses the classes. I have never used a makefile before so i'm a bit fuzzy on what should go into one.

Ideally it would be cool if i had a working one that contained all the clanlib modules - that i could easily comment out those that i dont need. Could anyone please post a simple makefile for me?

I tried using this that i got from a tutorial:
----------------------------------------------------------------------------
PACKAGES = clanCore-0.8 clanDisplay-0.8 clanApp-0.8 clanGL-0.8 clanVorbis-0.8 clanSound-0.8
CPP = g++ -Wall `pkg-config --cflags $(PACKAGES)`
lines: clanmain.o
$(CPP) clanmain.o -fmessage-length=0 -O3 -o boxes `pkg-config --libs $(PACKAGES)`
clean:
@rm -f *.o boxes
--------------------------------------------------------------------------
1. this is the file lines.h
#include <ClanLib/application.h>
#include <ClanLib/core.h>
#include <ClanLib/display.h>
#include <ClanLib/gl.h>
#include <ClanLib/sound.h>
#include <ClanLib/vorbis.h>

#ifndef __LINES_H__
#define __LINES_H__

const int boardsize = 6;
const int spacing = 50;
const<ClanLib/application.h> int border = 20;

const int numsquares = int(pow(float(boardsize - 1), 2));

class Lines : public CL_ClanApplication
{

public:
virtual int Lines::main(int, char **);
};

#endif //__LINES_H__

-------------------------------------------
2. this is the file clanmain.cpp
#include "lines.h"
int Lines::main(int, char **)
{
int winsize = spacing * (boardsize - 1) + border * 2;
try {
CL_SetupCore::init();
CL_SetupDisplay::init();
CL_SetupGL::init();
CL_SetupSound::init();
CL_SetupVorbis::init();
CL_DisplayWindow window("Line pwner", winsize, winsize);
while (!CL_Keyboard::get_keycode(CL_KEY_ESCAPE)) {

CL_Display::flip();
CL_System::keep_alive(20);
}



CL_SetupVorbis::deinit();
CL_SetupSound::deinit();
CL_SetupGL::deinit();
CL_SetupDisplay::deinit();
CL_SetupCore::deinit();
}
catch (CL_Error err) {
std::cout << "Exception caught: " << err.message.c_str() << std::endl;
}

return 0;
}
---------------------------------------------------------------------
but i get these errors and the sample wont compile:

c++ -O2 -fno-strict-aliasing -pipe -c clanmain.cpp
In file included from clanmain.cpp:1:
lines.h:1:33: error: ClanLib/application.h: No such file or directory
lines.h:2:26: error: ClanLib/core.h: No such file or directory
lines.h:3:29: error: ClanLib/display.h: No such file or directory
lines.h:4:24: error: ClanLib/gl.h: No such file or directory
lines.h:5:27: error: ClanLib/sound.h: No such file or directory
lines.h:6:28: error: ClanLib/vorbis.h: No such file or directory
In file included from clanmain.cpp:1:
lines.h:13: error: expected unqualified-id before '<' token
lines.h:15: error: 'pow' was not declared in this scope
lines.h:18: error: expected class-name before '{' token
lines.h:21: error: extra qualification 'Lines::' on member 'main'
clanmain.cpp: In member function 'virtual int Lines::main(int, char**)':
clanmain.cpp:4: error: 'border' was not declared in this scope
clanmain.cpp:6: error: 'CL_SetupCore' has not been declared
clanmain.cpp:7: error: 'CL_SetupDisplay' has not been declared
clanmain.cpp:8: error: 'CL_SetupGL' has not been declared
clanmain.cpp:9: error: 'CL_SetupSound' has not been declared
clanmain.cpp:10: error: 'CL_SetupVorbis' has not been declared
clanmain.cpp:11: error: 'CL_DisplayWindow' was not declared in this scope
clanmain.cpp:11: error: expected `;' before 'window'
clanmain.cpp:12: error: 'CL_Keyboard' has not been declared
clanmain.cpp:12: error: 'CL_KEY_ESCAPE' was not declared in this scope
clanmain.cpp:14: error: 'CL_Display' has not been declared
clanmain.cpp:15: error: 'CL_System' has not been declared
clanmain.cpp:20: error: 'CL_SetupVorbis' has not been declared
clanmain.cpp:21: error: 'CL_SetupSound' has not been declared
clanmain.cpp:22: error: 'CL_SetupGL' has not been declared
clanmain.cpp:23: error: 'CL_SetupDisplay' has not been declared
clanmain.cpp:24: error: 'CL_SetupCore' has not been declared
clanmain.cpp:26: error: expected type-specifier before 'CL_Error'
clanmain.cpp:26: error: expected `)' before 'err'
clanmain.cpp:26: error: expected `{' before 'err'
clanmain.cpp:26: error: 'err' was not declared in this scope
clanmain.cpp:26: error: expected `;' before ')' token
*** Error code 1
-----------------------------------------------------
i figured that the makefile must be incorrect in some way. could you give me some help here please?
thanks