Shop Learn
Catalina — Parallax Forums

Catalina

RossHRossH Posts: 4,762
edited 2021-10-17 11:57 in Propeller 1

I have just added the release version of Catalina 4.9.1 to [url="https://sourceforge.net/projects/catalina-c/"]SourceForge[/url]. This release is for both Windows and Linux.

The main purpose of this release is to fix up a few issues with 4.9. Here is an extract of the new README file.
[code]
RELEASE 4.9.1

New Functionality

None. Release 4.9.1 is a bug fix release for release 4.9.

Other Changes

  1. Catalina Geany has been updated to fix a crash on startup under
    Windows. This affected both Propeller 1 and Propeller 2 programs.
    Linux versions of Catalina were not affected.

  2. A bug in Catalyst support for SMALL FLASH binaries has been fixed.
    In previous releases only FLASH programs with the LARGE memory layout
    would load correctly under Catalyst. Now Catalyst will correctly load
    FLASH programs compiled with the SMALL memory layout as well. Note that
    old program binaries will not load correctly - they will need to be
    recompiled with Catalina 4.9 to do so. This affected Propeller 1
    programs only.

  3. A bug in the PROPTERMINAL HMI support has been fixed. This affected
    Propeller 1 programs only.

  4. The project file chimaera.geany specified the -p2 flag in the project's
    Catalina Options field. This meant the project would not compile correctly
    for the Propeller 1 even if a Propeller 1 platform was specified (e.g. in
    the CATALINA_DEFINE environment variable).

  5. If the LCCDIR environment variable is not set, Catalina now assumes it is
    installed in C:\Program Files (x86)\Catalina (it used to assume it was
    in C:\Program Files\Catalina), which confused lcc.

RELEASE 4.9

New Functionality

  1. There has been a major rewrite of all the demo programs and build scripts
    in the demos directory and all its subdirectories. Makefiles are now
    provided for all the demo programs, which can be used either manually (i.e.
    by invoking 'make' on the command line) or via the Catalina Geany IDE. All
    platforms are supported by these new Makefiles except for the MORPHEUS and
    TRIBLADEPROP platforms (which still use the old batch scripts). To use the
    Makefiles on Windows, this means you need to have a version of 'make' and
    some core utilities that it needs installed. The Windows installer can
    install these for you if you do not already have them (e.g you don't
    already have MinGW installed), or you can download them from here:

    http://gnuwin32.sourceforge.net/packages/make.htm
    http://gnuwin32.sourceforge.net/packages/coreutils.htm

    The recommended version of make to use with Catalina is 3.81. The
    recommended version of the core utilities is 5.3.0.

    Note that Catalina can still be used as a command-line compiler without
    installing 'make', and even Catalina Geany can still be used without it
    to compile simple programs. But to build more complex examples (such as
    the Catalyst demos) or use the various build_all scripts, a version of
    'make' is required.

    Most of the 'build_all' scripts have all been rewritten to just invoke
    'make' internally, but other than that should work similarly to how they
    worked in previous releases. So there are now four different methods you
    can use to make the demo programs and your own C programs.

    For instance, in the demos directory, there are now four ways to compile
    the hello_world.c program ...

    a) Manually, by invoking catalina yourself on the command line with
    appropriate command-line options - e.g:

     catalina hello_world.c -lci
    

    You can define Catalina symbols on the command line to specify options
    for your compilation, or else use the CATALINA_DEFINE environment
    variable. For example, the following will give identical results:

     catalina hello_world.c -lci -C C3 -C COMPACT -C HIRES_VGA
    

    and (on Windows)

     set CATALINA_DEFINE=C3 COMPACT HIRES_VGA
     catalina hello_world.c -lci
    

    or (on Linux)

     export CATALINA_DEFINE="C3 COMPACT HIRES_VGA"
     catalina hello_world.c -lci
    

    The advantage of using the CATALINA_DEFINE environment variable is that
    if you are working with a single Propeller platform, you don't need to
    specify this in every compilation command. Note that you don't use the
    -C command line switch when defining symbols using CATALINA_DEFINE.

    b) Using 'make'. For all the Makefiles provided in the demo directory and
    its subdirectories, you can make either a single target, or all the
    targets specfied in the Makefile - e.g:

     make hello_world
    

    or

     make all
    

    Note: if you see a message like the following:

     make: Nothing to be done for `hello_world'
    

    then it means that 'make' did nothing because the program binary
    already exists and is up to date. You can force 'make' to rebuild
    the program either by first saying 'make clean', or by invoking 'make'
    with the -B command line option - e.g:

     make -B hello_world
    

    Note that compiling with 'make', like all Catalina compilations, will
    use any Catalina symbols defined in the CATALINA_DEFINE environment
    variable. This allows generic Makefiles to be written more easily.
    All the Makefiles provided as demos use the 'catalina_env' command to
    print out all Catalina environment variables before they build the
    programs to remind you what is specified in CATALINA_DEFINE.

    c) Using the build_all scripts, with or without appropriate Catalina
    symbols specified to the command - e.g :

     build_all 
    

    or

     build_all P2_EVAL NATIVE VT100 CR_ON_LF
    

    The build_all scripts are now wrappers around 'make'. They don't work
    exactly the same way they did in previous releases, partly because the
    demo directories have been restructured, but they still accept command
    line parameters to specify the Catalina symbols to define for the
    build. By convention, the first parameter is always the platform, and
    Propeller 2 platforms should always start with "P2" (e.g. P2_EVAL,
    P2_EDGE, P2D2 etc).

    The build scripts, like all Catalina compilations, will use any Catalina
    symbols defined in the CATALINA_DEFINE environment variable. Note that
    if you specify conflicting symbols as parameters to the build_all script,
    it will print a message about the conflict and not compile any programs.

    d) Using Geany. You can specify a Geany project on the command line, or
    just start Geany with no project specified (which will start Geany with
    whatever project was last loaded) and then manually load the project
    file in Geany - e.g:

     catalina_geany hello_world
    

    or

     catalina_geany
    

    Then, in Geany you have two sets of commands on the Build menu. Note
    that in Geany the build menu is determined by the type of file you
    have currently selected. You must have a C file (i.e. a file with a
    “.c” extension) open and currently selected to see the C Build commands.

    The first set are the simple build commands:

    Compile     - compile the current file only and produce an object file.
    
    Build       - compile the current file only and link it to produce an 
                  executable.
    
    Compile All - compile ALL the C files in the current directory to 
                  separate object files, but do not link them.
    
    Link        - link ALL the object file in the current file to produce 
                  an executable. The executable will be named for the
                  current file.
    
    Clean       - remove all binary, object, listing and executable files
                  in the current directory (similar to 'make clean').
    

    These commands are suitable for C programs that consist of a single
    C file, or when all the C files in the directory belong to the same
    project and there are no dependencies between them, and no other
    steps required except compiling and linking.

    After the simple build commands on the Build menu, you will see the
    two 'make' build commands:

    Make                 - Make the current project using the Makefile
                           in the current directory - i.e. invoke 'make'
                           specifying the current project as the target.
    
    Make (Custom Target) - Make a custom target. Geany will prompt for
                           the target name, which can be the special
                           targets 'clean' or 'all'.
    

    Like all Catalina compilations, Geany will use any Catalina symbols defined
    in the CATALINA_DEFINE environment variable. You can set this variable to
    specify to your platform and memory model. For instance, on Windows you
    might say:

     set CATALINA_DEFINE=P2_EVAL COMPACT
    

    On Linux, the syntax to set environment variables is different. You might
    instead say:

     export CATALINA_DEFINE="P2_EVAL COMPACT"
    

    Then, no matter which method you use, your programs will be compiled as
    if you had specified -C P2_EVAL -C COMPACT on the command line. Note that
    if you specify conflicting symbols as parameters to the build_all script,
    it will print a message about the conflict and not compile any programs.

    Catalina Geany has the ability to specify options to its build commands.
    You can specify these in the Project Properties menu item. Typically,
    the options would include libraries, optimization levels, and any
    Catalina symbols you might want to define. For instance, the options
    specified for "hello_world" might be as follows (multiple lines are
    acceptable here):

    -p2
    -lci
    -O5
    -C NO_REBOOT

    This means compile for the Propeller 2, use the integer version of the
    standard C library, use optimization level 5, and define the Catalina
    symbol NO_REBOOT, which prevents the program from rebooting the Propeller
    on exit from the main function (which in some cases might prevent all
    the output from being sent to the terminal before the Propeller reboots).

    These options are used by the simple build commands. In order to make
    them accessible to the 'make' commands, the Make command actually used
    is as follows:

    make "%n" CATALINA_OPTIONS="%o"

    This allows Geany to pass the options defined for the project to the
    project Makefile using the variable CATALINA_OPTIONS. The Makefiles
    provided for all the demo programs check whether CATALINA_OPTIONS have
    been passed, and try and use sensible default options if not. So even if
    you are using 'make' stand-alone, it is not usually necessary to specify
    options on the command line. This is what allows you to say (for example)
    just:

    make hello_world

    instead of having to say:

    make hello_world CATALINA_OPTIONS="-lci -C NO_REBOOT"

    Like the build_all scripts in the previous releases, all the Makefiles
    provided in the demos folder attempt to determine automatically if you
    are compiling for a Propeller 1 or 2, based on either the suffix, or
    (if no suffix is specified) then on whether the substring "P2" appears
    in any of the Catalina symbols defined in CATALINA_DEFINE or if "-p2"
    appears in CATALINA_OPTIONS. This means you do not generally have to
    explicitly add the -p2 option unless you are compiling for the default
    platform (and are therefore not specifying any specific platform).

    The Makefiles in the demo folders contain default rules that know
    how to make .bin, .binary and .eeprom executables. So, for example,
    if hello_world.c exists in the folder, you can simply say:

    make hello_world.bin
    make hello_world.binary
    make hello_world.eeprom

    to build the executable with default options (which can also be specified
    in the Makefile) and get the expected result. You can use the Makefile in
    the main demo directory as a template for your own Makefiles.

    Note that 'make' uses only the file date/time to determine if the
    executable needs to be remade, and is not aware of any changes you may
    make either to CATALINA_DEFINE or to Geany build options - so in some
    cases you need to use 'make clean' to remove old executables, or add the
    -B option to 'make' to force it to rebuild the executable. Or you can
    specify clean as your first target - e.g:

    make clean hello_world

  2. A new build command option has been added to the Catalina version of Geany.
    Now as part of a project build command, you can specify %n which will be
    replaced with the name of the project. By default, this option is now added
    to the 'make' build command which is now:

    make "%n" CATALINA_OPTIONS="%o"

    The purpose of this is to allow a single Makefile to be used to make
    multiple projects with sources in the same directory. This capability is
    used in many of the Catalina demo folders, rather than having to have a
    separate subdirectory (and a separate Makefile) for each individual demo
    program. Instead, the Makefile can simply have multiple targets, named for
    each project that uses the Makefile.

  3. Catalina Geany has been modified to allow relative file paths. This
    allows geany project files to be independent of where they are installed.
    This means, for example, that you can more easily copy all or part of the
    demos directory to another location to build the example programs. You no
    longer need to build them in place in the Catalina program folder.
    Note that in Geany you can specify "./" (without the quotation markes) as
    your project base path in the project properties. This applies on both
    Linux and Windows (even though Windows doesn't normally use "/" as a path
    separator) - it is not really a path specifier, it is a signal to Geany
    to use the path to the Geany project file as the base directory for the
    project.

  4. A new set of definitions has been added for P2_EDGE in the configuration
    file catalina_platforms.inc in the target_p2 folder. Currently, all the
    values defined are the same as the P2_EVAL board, but they can be edited
    if desired.
    [/code]

Ross.

Comments

Sign In or Register to comment.