A simple sample

SimpleSample is similar to Kernighan and Ritchie's hello world program. This program is ideal for demonstrating how to create, build, and execute an application.

How to create SimpleSample

  1. Create a directory named SimpleSample. You can create the directory anywhere on your file system; but your home directory is probably best.
  2. Create a source file hello.C and enter:
      #include <stdio.h>
      void main()
      {
          printf("Hi there everybody!\n");
      }
    Use your favorite editor to create hello.C.
  3. Create a makefile description called SimpleSample.PinkMake and enter:
      program SimpleSample {
          source:
              hello.C             // A single source file
      }
    The name of the *.PinkMake file must be the same as the name of the directory in which it resides. This example resides in .../SimpleSample.
  4. Build SimpleSample using Makeit without any options or targets
    (see
    "Makeit" on page 56):
      Makeit

The build log

What follows is the build
log; yours should look similar.

Makeit messages

The first message is from Makeit stating that it did not find SimpleSample.Make in the project. Therefore, Makeit built a makefile from SimpleSample.PinkMake. Line 3 is the CreateMake command that Makeit issued to create the makefile.

    1  ### Makeit:  No makefile found in `/home/EeeDee/SimpleSample'.
    2  ###             However one will be built from `SimpleSample.PinkMake'.
    3  # CreateMake > SimpleSample.Make;
    

Includes phase

Since SimpleSample.PinkMake did not specify any public header files, Makeit did not build any include files.

    4 # 5 # Making "Includes" for "/home/EeeDee/SimpleSample"... 6 # make -f SimpleSample.Make Includes 7 # 8 make: Nothing to be done for 'Includes'.

Objects phase

Compiles hello.C to hello.o, and contains the make line that Makeit called.

    9 # 10 # Making "Objects" for "/home/EeeDee/SimpleSample"... 11 # make -f SimpleSample.Make Objects 12 # 13 # Compile hello.C to produce hello.o

Exports phase

Did not build a shared library because SimpleSample didn't build an export file.

    14 # 15 # Making "Exports" for "/home/EeeDee/SimpleSample"... 16 # make -f SimpleSample.Make Exports 17 # 18 make: `Exports' is up to date.

Binaries phase

Creates the executable application by calling MakeSharedApp (as echoed from make). For more information, see
"MakeSharedApp" on page 85.

    19 # 20 # Making "Binaries" for "/home/EeeDee/SimpleSample"... 21 # make -f SimpleSample.Make Binaries 22 # 23 MakeSharedApp -L. -L/usr/lib/dce -o SimpleSample hello.o /home/EeeDee/work/Expo rts/RuntimeLib.e /home/EeeDee/work/Exports/OpixLib.e /home/EeeDee/work/Exports/T oolboxLib.e /home/EeeDee/work/Exports/TimeLib.e /home/EeeDee/work/Exports/TestFr ameworkLib.e /home/EeeDee/work/Exports/HighLevelAlbert.e /home/EeeDee/work/Expo rts/LowLevelAlbert.e /home/EeeDee/work/Exports/AlbertPixelBuffers.e

Copy phase

Copies the built application to $TaligentBinaries, the standard location for executable files, and leaves a copy in the current directory.

    24 SmartCopy SimpleSample /home/EeeDee/work/TaligentBinaries

How to execute SimpleSample

When the build completes, execute
the SimpleSample program by typing its name at the UNIX prompt. It should look like this:

      % SimpleSample
      OPIX compile timestamp = Jan 22 1994, 08:25:22
    
      Hi there everybody!
      %

[Contents] [Previous] [Next]
Click the icon to mail questions or corrections about this material to Taligent personnel.
Copyright©1995 Taligent,Inc. All rights reserved.

Generated with WebMaker