HelloWorld

This tutorial is located under www/tutorials/helloworld in the buildpp distribution.

The module list

The file modulelist contains at newline separated list of directories where buildpp should look for your source files.
Each directory is search recursively for source files so you only need to specify the top level directory.
Since this is a very simple project that dosn't borrow files from other projects, and keeps its file in just one directory namely src/ it only contains one line:
src
Download as text.
For more advanced features of the modulelist please read the man page.

localbuild.pl

This file is a perl script that changes the project settings (variables inside buildpp.pl) to match the requerments of this project.
This script is read and executed each time buildpp.pl is run.
As this is the introduction tutorial I have kept this script very small.
autoTarget();
$lazyLinking=1;
Download as text.
For more information regarding the possibilities of localbuild.pl read the man page or an more advanced tutorial if/when available.

Source files

All source files are placed under the src/ folder.
They have been converted to HTML using http://www.chami.com/colorizer/
When writing source file you need to be aware that any files included with "" brackets are searched for dependency information.
Therefor buildpp.pl must be able to locate them in a directory specified in modulelist.
Files included in with <> brackets are however not searched.

Generally speaking your header-files should be included using "" and system/library includes should be included using <>

Also buildpp.pl dos't use a C/C++ parser to parse the files, as a result it is oblivious to such things as #ifdef, #else

helloworld.cpp

//#exe

#include "hellowriter.h"

int main(int argc, char **args){

  HelloWriter writer;
  writer.write();
  return 0;

}
Download as text.

hellowriter.h

#ifndef MOD_HELLO_WRITER_H
#define MOD_HELLO_WRITER_H

class HelloWriter
{
  public:
  HelloWriter();

	void write();
};

#endif
Download as text.

hellowriter.cpp

#include "hellowriter.h"
#include <iostream>

using namespace std;

HelloWriter::HelloWriter()

{
}

void HelloWriter::write()
{
  cout << "Hello there." << endl;

}
Download as text.

Building files

This requires a compiler called g++, a gcc compiler should work, other compilers might also work as well.
When standing in the directory www/tutorials/helloworld you can build the helloworld program by issuing the command:
"perl buildpp.pl helloworld"
It should output something similar to this:
reading localbuild.pl
Reading module list and compiling file list
Finding files needing to be rebuild
Parsing file helloworld.cpp
Parsing file hellowriter.h
Parsing file hellowriter.cpp
Building files
1/2 (0%) Compiling hellowriter.o
2/2 (50% 2s) Compiling helloworld.o
Linking files
Linking helloworld
You should now have one overcomplicated Hello World ™ program.
The output (.o, .d and executables) are written to the directory build/, this location by the way can be changed (read the man page)

"perl buildpp.pl -test="" helloworld" will build and run helloworld (without any arguments)
"perl buildpp.pl helloworld -clean" will clean the build/ directory before it builds helloworld (WARNING: all files in the directory will be removed not just files buildpp.pl has created eg. don't put files in this directory), it will however ask you if you are sure.