Building Applications

Please note that you need Syspack 53 or higher to run games or applications made with Cybiko SDK on your Cybiko computer (in Main Desktop, press '?' to get to the System Information screen, and check the 'System Pack version' line).

There are two primary ways to build your application:


The Easy Way

The easiest way is to use the vcc command, for example:

         vcc <filename1>.c [-o <filename2>.app]
         or   vcc <filename1>.cpp [-o <filename2>.app]


The Harder But More Flexible Way
   1.To use a vcpp preprocessor:
vcpp <filename1>.c [-I directory ] <filename1>.p
or   vcpp <filename1>.cpp -D__cplusplus [-I directory ] <filename1>.pp


   2. ... compile your file with vcc1 or vcp1 compiler:
vcc1 <filename1>.p -o <filename1>.asm
or   vcp1 <filename1>.pp -o <filename1>.asm


   3. ... assemble your file with vas assembler:
vas <filename1>.asm -o <filename1>.o


   4. ... bind necessary files with vlink linker:
vlink -o bytecode.bin <filename1>.o [<other files>.o][...]


   5. ... and, finally, prepare an application archive for the Cybiko computer:
filer a <app-filename>.app <resource-filenames> main.e bytecode.bin
Yet Another Way

There is one more way to compile your application: you may create a makefile and process it using vmake. To simplify this procedure, use this makefile as a template:

  #-------------------------------------------------------------------------------------
#
# use 'vmake' (not 'make'!) to run this script!
#
#-------------------------------------------------------------------------------------

# set this to where Cybiko SDK actually resides
#CYBIKO_SDK = C:\Program Files\Cybiko\Cybiko SDK

# you may also want to change this...

NAME = Fox_Hunting
OBJ = src/Foxhunt.o
RES = res/0.help res/bests.dat res/disable.mus res/filer.list res/fox.mus \
res/fox_hunting.pic res/intro.pic res/root.ico res/root.inf res/root.spl \
res/success.mus res/title.mus

PP = vcpp
CC = vcc1
AS = vas
LN = vlink
LD = filer
RM = vrm

.SUFFIXES : .c

all : $(NAME).app

# You must add to archive "$(CYBIKO_SDK)"/lib/cybiko/main.e,
# your bytecode and application resources
# (*.pic better place first).
# *.spl - splash screen.
# *.help - help file.
# *.inf - information for programm manager.
# For more details see filer.exe manual.
$(NAME).app : tmp/bytecode.bin $(RES)
  @echo building app archive...
  @$(LD) a $@ @res/filer.list tmp/bytecode.bin "$(CYBIKO_SDK)"/lib/cybiko/main.e

tmp/bytecode.bin : $(OBJ)
  @echo linking ...
  @$(LN) -o $@ src/*.o

.c.o :
  @echo compiling $<...
  @$(PP) -I"$(CYBIKO_SDK)"/inc/cybiko $< | $(CC) | $(AS) -O -o $@

src/Foxhunt.o : src/Foxhunt.h

clean :
  @echo cleaning...
  @$(RM) -f tmp/*.* src/*.o $(NAME).app

new : clean all

Using MS Developer Studio as a Development Environment

1. Make sure that Cybiko SDK 'bin' directory is listed in MSDEV executable search path (Tools -> Options -> Directories -> Executable files)

2. Create new project. Go to File -> New... -> Projects, select 'Makefile' (important!) and fill in project name and location, then click 'OK'. For instance, name: 'highway_hitman', location: 'C:\Program Files\Cybiko\SDK\demos\cybiko\highway_hitman'

3.   Fill in project options. Specify 'vmake' in the 'Command line' field, name of your application in the 'Output' field ('highway_hitman.app', for example) and rebuild target in the 'Rebuild All Switch' field (that should be 'new' for any makefile supplied with the SDK)

4. Repeat previous step for the 'Release' options. You may want to use special targets in your makefile to build release version of your project.

At this point, your project should be ready — you can use 'Build' command to build your application. For your convenience, Cybiko SDK error and warning message format is made fully compatible with that of the Developer Studio, so that you could 'jump' to a source line for which a warning (or an error) message is issued — by simple clicking on a respective line in the output window (its 'Build' tab, if more exactly).