software engineer &        architecture


How create own Executable

How to create your own executable using the ACDK libraries.

How to create own Executable/Library Project Currently there are multiple ways to create your own Project using the ACDK libraries.

Content of this chapter:

   Minimal Makefile sample for Unix
   Minimal build.csf sample for all platforms
   Use acdk_boot as sample
   Generate own Makefiles/Project using acdklisp

 Minimal Makefile sample for Unix

In an empty directory create the file minacdksample.cpp

#include <acdk.h>
#include <acdk/lang/System.h>

using namespace acdk::lang;

// minimal example, which just says hello
class MiniAcdkSample
  static int acdkmain(RStringArray args)
    System::out->println("Hello from miniacdksample");
    return 0;

main(int argc, char* argv[], char** envptr)
  return acdk::lang::System::main(MiniAcdkSample::acdkmain, argc, argv, envptr);
Create the corresponding Makefile for unix/gcc:

# where is your ACDK installed

CCOMPILER=g++ -Wall -Wno-unused -g -D_REENTRANT -I .  -I $(ACDKHOME)/include

# system libraries. These are needed by ACDK at least
SYSLIBRARIES=-lpthread -lm -ldl

# all libs together

# want maybe to debug

OBJECTS = minacdksample.o

# builds the executable itself
# don't forget to export LD_LIBRARY_PATH=/artefaktur/acdk/bin before execute the binary
minacdksample: $(OBJECTS)
	g++ $(SYSLDFLAGS)  $(OBJECTS) -o minacdksample $(LIBS)

%.o: %.cpp
	$(CCOMPILER) -c $< -o $@

	rm *.o minacdksample
That is all. Just make.

 Minimal build.csf sample for all platforms

 ACDK Make is a platform independ make substitution. Currently it is in experimental state. Create a build.csf in our directory:

  Just execute acdkmake in this directory

// needed for base definitions
#include "amake_config.csf"

// Create a standard ACDK console executable 
minacdksample = new acdk.make.AcdkExeTask("minacdksample");

//  add a single source. This also excepts pattern
//  like "src/acdk/bla/*.cpp" 
//  or   "src/acdk/blub/**/*.cpp"

// this uses acdk_core library

// make a project
default = new acdk.make.AcdkProjectTask("default");
Execute acdkmake in the directory.

 Use acdk_boot as sample

The package  ACDK Boot is small sample project which, which can be used as a template for creating own projects.

 Generate own Makefiles/Project using acdklisp

Currently ACDK uses a lisp files to generate platform make files. In the future this will replaced with acdkmake. Please refer to  Platform makes.
Last modified 2005-05-08 22:29 by SYSTEM By Artefaktur, Ing. Bureau Kommer