MySVC
an open source UNIX framework for shell script based web services provider
»Home
»Tools
»Man Page
»User Guide
»ChangeLog
»Installation
»Source Code
»Downloads
»FAQ
»Support
»License

»My Apps

Table of Contents

Introduction

MySDE (My Service Development Environment) is a light UNIX development environment makefile based for C/C++ and Java software projects.

It is the development environment of MySVC framework and includes support:

  • for build external libraries and binaries from packages sources with configuration for more UNIX environments

  • for configuration management (RCS)

  • for third party C/C++ and Java libraries (including J2EE web applications .war)

  • for Lex & Jacc compilers

  • for AsciiDoc based web sites

  • for FTP deploy

This environment is configured as:

  • a base environment (under $MYSDE_BASE)

  • a root environment, which is a subset of the base environment (under $MYSDE_ROOT=$MYSDE_BASE/src/mysde)

The base environment contains:

  • all package sources and binaries

  • all makefiles to build binaries from sources

  • the support to create initial configuration for more UNIX environments and switch from one environment to another (each environment using its environment variable name for shared libraries)

  • the support to archive system binaries and sources

The root environment contains all system sources and its configured as a tree with three logical levels:

  • The system is the root of the tree

  • The subsystems are the childs of the system

  • The software units are the childs of each subsystem and the leafs of the tree

system
  |
  | ---- subsystem1
  |          |
  |          | ---- softwareunit11
  |          | ---- softwareunit12
  |          | ---- ...
  |          | ---- softwareunit1M
  | ---- subsystem2
  |          |
  |          | ---- softwareunit21
  |          | ---- softwareunit22
  |          | ---- ...
  |          | ---- softwareunit2M
  | ...
  | ---- subsystemN
             |
             | ---- softwareunitN1
             | ---- softwareunitN2
             | ---- ...
             | ---- softwareunitNM

Each of the three levels (system, subsystem and software unit) has an src subdirectory containing the corresponding Makefile to customize filling some variables

There is also a forth Makefile, included by other three makefiles, that is the "engine" of the development environment

The src subdirectories of the software units contain all the software (including scripts and configuration files)

Each software unit can generate one the following objects:

  • a C/C++ application

  • a C/C++ library (lib*.a or lib*.so) that can be used (linked):

    • only from other software units of its own subsystem ("subsystem" library) or

    • also from software units of other subsystems ("system" library)

  • a Java application

  • a Java library (.jar)

  • a Java/J2EE web application (.war)

  • an AsciiDoc based Web Site (with automatic FTP deploy)

From the system level is then possible to generate Java libraries (.jar) or web applications (.war)

Setup

The MySDE installation kit is made only of the mysde shell script

In order to install MySDE you must:

  • execute mysde script

       mysde [-e]
             [-1]
             [-n <name>=default]
             [-l <libpath>=LD_LIBRARY_PATH]
             [-S <subsystems>]
             [-s <softwareunits>]
             [<basedir>=$HOME/mysde]
        -S-|-s- => read subsystems or softwareunits from stdin
        <subsystems>="<subsystem1> <subsystem2> ...<subsystemN>" |
                     "<subsystem1>
                      <subsystem2>
                      ...
                      <subsystemN>" |
                      <subsystem1>,<subsystem2>[,...],<subsystemN>
        <softwareunits>="[<subsystem1>/]<softwareunit1> [<subsystem2>/]<softwareunit2> ... [<subsystemN>/]<softwareunitN>" |
                        "[<subsystem1>/]<softwareunit1>
                         [<subsystem2>/]<softwareunit2>
                         ...
                         [<subsystemN>/]<softwareunitN>" |
                         [<subsystem1>/]<softwareunit1>,[<subsystem2>/]<softwareunit2>[,...],[<subsystemN>/]<softwareunitN>
      -e => get only configuration for $HOME/.profile
      -s => configure for only one environment
      -n => set name of default environment
      -l => set name of environment variable used for shared libraries
      <basedir> =>base directory of the service development tree
      (e.g. /home/mysystem)
  • you can add later other subsystems and/or software units using the same mysde script with the same base directory of the existing development tree

  • add the output of mysde script to $HOME/.profile (this output is always stored as $MYSDE_BASE/.profile)

  • execute . $HOME/.profile

  • the MYSDE_ROOT is automatically set to $MYSDE_BASE/src/mysde

  • the MYSDE_HOME is automatically set to $MYSDE_BASE/bin/mysde

  • if a base directory was specified as argument on mysde script then the prefix of environment variables for base and root direcotory are based on basename of base directory; e.g. if $HOME/mysystem is the base directory then MYSYSTEM_BASE and MYSYSTEM_ROOT are the names of environment variables

  • if default $HOME/mysde was used as base directory this create under $MYSDE_BASE the following tree:

      mysde/
         |
         | --- README
         | --- .mysde (-> .mysde.<name>)
         | --- .mysderc (-> .mysderc.<name>)
         | --- bin/
         |      |
         |      | --- <binaries> (empty)
         | --- src/
         |      |
         |      | --- <sources> (see tree under $MYSDE_ROOT)
         ! --- makefiles/
         |      |
         |      | --- Makefile (-> Makefile.<name>)
         | --- local/ (-> local.<name>)
         | --- build/ (-> build.<name>)
         | --- makefiles/
         | --- pkg/
         | --- docs/
         | --- man/
         | --- usr/
         |      |
         |      | --- bin
         |      | --- lib
         | --- arc/
         |      |
         |      | --- bin
         |      | --- lib
         | --- sys/
         |      |
         |      | --- bin
         |      | --- lib
  • $MYSDE_BASE/bin is the directory of mysde binaries

  • $MYSDE_BASE/src is the directory of mysde sources

  • $MYSDE_BASE/pkg is the directory for package sources (.tar.gz)

  • $MYSDE_BASE/usr is the directory for external binaries and libraries not buildable from package sources

  • $MYSDE_BASE/arc is the directory for mysde binaries and sources archive

  • $MYSDE_BASE/makefiles/Makefile is the base Makefile to build package binaries from package sources (if not -1 option is specified to mysde then is a symbolic link to current Makefile.<name> of <name> environment)

  • $MYSDE_BASE/build and $MYSDE_BASE/local are the directories for build and install of package sources (if not -1 option is specified to mysde then is a symbolic link to current build.<name> and local.<name> directories of <name> environment)

  • $MYSDE_BASE/Makefile is the base Makefile with targets for

    • build and clean a single package or all packages (make build, make clean)

    • build and clean all packages (make build-all, make clean-all)

    • tar all system base tree

    • init one or more <name> environments (make init names="osx sun linux")

    • configure a <name> as current environment (make init name="osx")

  • under $MYSDE_ROOT the following tree:

      mysde/
         |
         | --- .mysde (-> .mysde.<name>)
         | --- .mysderc (-> .mysderc.<name>)
         | --- README
         | --- sys/
         |      |
         |      | --- bin/
         |      |      |
         |      |      | --- mysde
         | --- src/
         |      |
         |      | --- Makefile
         |      | --- RCS/
         !      | --- makefiles/
         |             |
         |             | --- Makefile
         |             | --- Makefile.system
         |             | --- Makefile.subsystem
         |             | --- Makefile.softwareunit
         | --- bin/
         | --- lib/
         | --- include/
         | --- classes/
         | --- conf/
         | --- docs/
         | --- web/

in which $MYSDE_ROOT/src/Makefile is a copy of Makefile.system

  • go to the $MYSDE_ROOT/src directory

  • create the web applications and web sites (AsciiDoc based) root directories executing the command: make init webapps="mywebapp1 … mywebappN" make init websites="mywebsite1 … mywebsiteN" this create the following tree:

      mysde/
         |
         | --- .mysde (-> .mysde.<name>)
         | --- .mysderc (-> .mysderc.<name>)
         | --- README
         | --- sys/
         |      |
         |      | --- bin/
         |      |      |
         |      |      | --- mysde
         | --- src/
         |      |
         |      | --- Makefile
         |      | --- RCS/
         !      | --- makefiles/
         |             |
         |             | --- Makefile
         |             | --- Makefile.system
         |             | --- Makefile.subsystem
         |             | --- Makefile.softwareunit
         | --- bin/
         | --- lib/
         | --- include/
         | --- classes/
         | --- conf/
         | --- docs/
         | --- web/
                |
                | --- MyWebApp1/
                !         |
                |         | --- WEB-INF/
                |                  | --- classes/
                |                  | --- lib/
                | --- MyWebApp2/
                !         |
                |         | --- WEB-INF/
                |                  | --- classes/
                |                  | --- lib/
                | --- .../
                | --- MyWebAppN/
                |         |
                |         | --- WEB-INF/
                |                  | --- classes/
                |                  | --- lib/
                | --- MyWebSite1/
                | --- MyWebSite2/
                | ...
                | --- MyWebSiteN/
  • edit the system Makefile ($MYSDE_ROOT/src/Makefile) setting the SUBSYSTEMS variable, as: SUBSYSTEMS=\ MySubsystem1 \ MySubsystem2 \

    1. \ MySubsystemN (note the <end of line> after each backslash \)

  • create the subtrees corresponding to each of the subsystems, executing from the $MYSDE_ROOT/src directory the command: make init subsystems="MySubsystem1 MySubsystem2 … MySubsystemN" that creates the following tree:

      mysde/
         |
         | --- .mysde (-> .mysde.<name>)
         | --- .mysderc (-> .mysderc.<name>)
         | --- README
         | --- sys/
         |      |
         |      | --- bin/
         |      |      |
         |      |      | --- mysde
         | --- src/
         |      |
         |      | --- Makefile
         |      | --- RCS/
         !      | --- bin/
         |      |      |
         |      |      | --- mysde
         !      | --- makefiles/
         |      !      |
         |      |      | --- Makefile
         |      |      | --- Makefile.system
         |      |      | --- Makefile.subsystem
         |      |      | --- Makefile.softwareunit
         |      | --- MySubsystem1/
         |      |          | --- include/
         |      !          | --- lib/
         |      |          | --- src/
         |      |                 | --- Makefile
         |      |                 | --- RCS/
         |      | --- MySubsystem2/
         |                 | --- include/
         |                 | --- lib/
         |                 | --- src/
         |      |                 | --- Makefile
         |      |                 | --- RCS/
         |      | --- ...
         |      | --- MySubsystemN
         |                 | --- include/
         |                 | --- lib/
         |                 | --- src/
         | --- bin/
         | --- lib/
         | --- include/
         | --- classes/
         | --- conf/
         | --- docs/
         | --- web/
                |
                | --- MyWebApp1/
                !         |
                |         | --- WEB-INF/
                |                  | --- classes/
                |                  | --- lib/
                | --- MyWebApp2/
                !         |
                |         | --- WEB-INF/
                |                  | --- classes/
                |                  | --- lib/
                | --- .../
                | --- MyWebAppN/
                |         |
                |         | --- WEB-INF/
                |                  | --- classes/
                |                  | --- lib/
                | --- MyWebSite1/
                | --- MyWebSite2/
                | ...
                | --- MyWebSiteN/

each subsystem subdirectory contains the include, lib and src subdirectories, where the $MYSDE_ROOT/src/MySubsystem/src/Makefile is a copy of Makefile.subsystem

  • edit each subsystem Makefile ($MYSDE_ROOT/src/MySubsystem/src/Makefile) setting the SOFTWAREUNITS variable, as: SOFTWAREUNITS=\ MySoftwareUnit1 \ MySoftwareUnit2 \

    1. \ MySoftwareUnitM (note the <end of line> after each backslash \)

  • create the subtrees corresponding to each of the software units, executing from each of the $MYSDE_ROOT/src/MySubsystem/src directory the command: make init softwareunits="MySoftwareUnit1 MySoftwareUnit2 … MySoftwareUnitN" that creates the following tree:

      mysde/
         |
         | --- .mysde (-> .mysde.<name>)
         | --- .mysderc (-> .mysderc.<name>)
         | --- README
         | --- sys/
         |      |
         |      | --- bin/
         |      |      |
         |      |      | --- mysde
         | --- src/
         |      |
         |      | --- Makefile
         |      | --- RCS/
         !      | --- makefiles/
         |      !      |
         |      |      | --- Makefile
         |      |      | --- Makefile.system
         |      |      | --- Makefile.subsystem
         |      |      | --- Makefile.softwareunit
         |      | --- MySubsystem1/
         |      |          | --- include/
         |      !          | --- lib/
         |      |          | --- src/
         |      |                 | --- Makefile
         |      |                 | --- RCS/
         |      |                 | --- MySoftwareUnit11/
         |      |                 |          |
         |      |                 |          | --- src/
         |      |                 |                 | --- Makefile
         |      |                 |                 | --- RCS/
         |      |                 | --- MySoftwareUnit12/
         |      |                 |          |
         |      |                 |          | --- src/
         |      |                 |                 | --- Makefile
         |      |                 |                 | --- RCS/
         |      |                 | --- ...
         |      |                 | --- MySoftwareUnit1M/
         |      |                 |          |
         |      |                 |          | --- src/
         |      |                 |                 | --- Makefile
         |      |                 |                 | --- RCS/
         |      | --- MySubsystem2/
         |      |          | --- include/
         |      |          | --- lib/
         |      |          | --- src/
         |      |                 | --- Makefile
         |      |                 | --- RCS/
         |      |                 | --- MySoftwareUnit21/
         |      |                 |          |
         |      |                 |          | --- src/
         |      |                 |                 | --- Makefile
         |      |                 |                 | --- RCS/
         |      |                 | --- MySoftwareUnit22/
         |      |                 |          |
         |      |                 |          | --- src/
         |      |                 |                 | --- Makefile
         |      |                 |                 | --- RCS/
         |      |                 | --- ...
         |      |                 | --- MySoftwareUnit2M/
         |      |                 |          |
         |      |                 |          | --- src/
         |      |                 |                 | --- Makefile
         |      |                 |                 | --- RCS/
         |      | --- ...
         |      | --- MySubsystemN
         |      |          | --- include/
         |      |          | --- lib/
         |      |          | --- src/
         |      |                 | --- MySoftwareUnit21/
         |      |                 |          |
         |      |                 |          | --- src/
         |      |                 |                 | --- Makefile
         |      |                 |                 | --- RCS/
         |      |                 | --- MySoftwareUnit22/
         |      |                 |          |
         |      |                 |          | --- src/
         |      |                 |                 | --- Makefile
         |      |                 |                 | --- RCS/
         |      |                 | --- ...
         |      |                 | --- MySoftwareUnit2M/
         |      |                 |          |
         |      |                 |          | --- src/
         |      |                 |                 | --- Makefile
         |      |                 |                 | --- RCS/
         | --- bin/
         | --- lib/
         | --- include/
         | --- classes/
         | --- conf/
         | --- docs/
         | --- web/
                |
                | --- MyWebApp1/
                !         |
                |         | --- WEB-INF/
                |                  | --- classes/
                |                  | --- lib/
                | --- MyWebApp2/
                !         |
                |         | --- WEB-INF/
                |                  | --- classes/
                |                  | --- lib/
                | --- .../
                | --- MyWebAppN/
                |          |
                |          | --- WEB-INF/
                |                   | --- classes/
                |                   | --- lib/
                | --- MyWebSite1/
                | --- MyWebSite2/
                | ...
                | --- MyWebSiteN/

each software unit subdirectory contains only the src subdirectories, where the $MYSDE_ROOT/src/MySubsystem/src/MySoftwareUnit/src/Makefile is a copy of Makefile.softwareunit

  • for the software units containing Java packages (sources java files that contains "package declaration") execute from the corresponding src subdirectory ($MYSDE_ROOT/src/MySubsystem/src/MySoftwareUnit/src) the command: make init packages="mypackage1.mysubpackage1 … mypackageN.mysubpackageN" that create into software unit src subdirectory the directory structure corresponding to the package names, creating also an RCS subdirectory for each leaf (for configuration management support) e.g. if the software unit is MySoftwareUnit11 this creates the following tree:

      mysde/
         |
         | --- .mysde (-> .mysde.<name>)
         | --- .mysderc (-> .mysderc.<name>)
         | --- README
         | --- sys/
         |      |
         |      | --- bin/
         |      |      |
         |      |      | --- mysde
         | --- src/
         |      |
         |      | --- Makefile
         |      | --- RCS/
         !      | --- makefiles/
         |      !      |
         |      |      | --- Makefile
         |      |      | --- Makefile.system
         |      |      | --- Makefile.subsystem
         |      |      | --- Makefile.softwareunit
         |      | --- MySubsystem1/
         |      |          | --- include/
         |      !          | --- lib/
         |      |          | --- src/
         |      |                 | --- Makefile
         |      |                 | --- RCS/
         |      |                 | --- MySoftwareUnit11/
         |      |                 |          |
         |      |                 |          | --- src/
         |      |                 |                 | --- mypackage1/
         |      |                 |                 |         |--- mysubpackage1/
         |      |                 |                 |                   |--- RCS/
         |      |                 |                 | --- mypackage2/
         |      |                 |                 |         |--- mysubpackage2/
         |      |                 |                 |                   |--- RCS/
         |      |                 |                 | --- .../
         |      |                 |                 | --- mypackageN/
         |      |                 |                 |         |--- mysubpackageN/
         |      |                 |                 |                   |--- RCS/
         |      |                 |                 | --- Makefile
         |      |                 |                 | --- RCS/
         |      |                 | --- MySoftwareUnit12/
         |      |                 |          |
         |      |                 |          | --- src/
         |      |                 |                 | --- Makefile
         |      |                 |                 | --- RCS/
         |      |                 | --- ...
         |      |                 | --- MySoftwareUnit1M/
         |      |                 |          |
         |      |                 |          | --- src/
         |      |                 |                 | --- Makefile
         |      |                 |                 | --- RCS/
         |      | --- MySubsystem2/
         |      |          | --- include/
         |      |          | --- lib/
         |      |          | --- src/
         |      |                 | --- Makefile
         |      |                 | --- RCS/
         |      |                 | --- MySoftwareUnit21/
         |      |                 |          |
         |      |                 |          | --- src/
         |      |                 |                 | --- Makefile
         |      |                 |                 | --- RCS/
         |      |                 | --- MySoftwareUnit22/
         |      |                 |          |
         |      |                 |          | --- src/
         |      |                 |                 | --- Makefile
         |      |                 |                 | --- RCS/
         |      |                 | --- ...
         |      |                 | --- MySoftwareUnit2M/
         |      |                 |          |
         |      |                 |          | --- src/
         |      |                 |                 | --- Makefile
         |      |                 |                 | --- RCS/
         |      | --- ...
         |      | --- MySubsystemN
         |      |          | --- include/
         |      |          | --- lib/
         |      |          | --- src/
         |      |                 | --- MySoftwareUnit21/
         |      |                 |          |
         |      |                 |          | --- src/
         |      |                 |                 | --- Makefile
         |      |                 |                 | --- RCS/
         |      |                 | --- MySoftwareUnit22/
         |      |                 |          |
         |      |                 |          | --- src/
         |      |                 |                 | --- Makefile
         |      |                 |                 | --- RCS/
         |      |                 | --- ...
         |      |                 | --- MySoftwareUnit2M/
         |      |                 |          |
         |      |                 |          | --- src/
         |      |                 |                 | --- Makefile
         |      |                 |                 | --- RCS/
         | --- bin/
         | --- lib/
         | --- include/
         | --- classes/
         | --- conf/
         | --- docs/
         | --- web/
                |
                | --- MyWebApp1/
                !         |
                |         | --- WEB-INF/
                |                  | --- classes/
                |                  | --- lib/
                | --- MyWebApp2/
                !         |
                |         | --- WEB-INF/
                |                  | --- classes/
                |                  | --- lib/
                | --- .../
                | --- MyWebAppN/
                |         |
                |         | --- WEB-INF/
                |                  | --- classes/
                |                  | --- lib/
                | --- MyWebSite1/
                | --- MyWebSite2/
                | ...
                | --- MyWebSiteN/
  • for the software units containing, into separate directories, web application files other than class files (e.g. *.html, *.js) execute from the corresponding src subdirectory ($MYSDE_ROOT/src/MySubsystem/src/MySoftwareUnit/src) the command: make init webappdirs="mywebappdir1 … mywebappdirN" (where each "mywebappdir" can contains subdirectories) that:

    • create into software unit src subdirectory the directory structure corresponding to the web application directories, creating also an RCS subdirectory for each leaf

    • create into web application root directory the same directories (without RCS) e.g. if TARGET_WEB=MyWebApp1 and software unit is MySoftwareUnit11 this creates the following tree:

      mysde/
         |
         | --- .mysde (-> .mysde.<name>)
         | --- .mysderc (-> .mysderc.<name>)
         | --- README
         | --- sys/
         |      |
         |      | --- bin/
         |      |      |
         |      |      | --- mysde
         | --- src/
         |      |
         |      | --- Makefile
         |      | --- RCS/
         !      | --- makefiles/
         |      !      |
         |      |      | --- Makefile
         |      |      | --- Makefile.system
         |      |      | --- Makefile.subsystem
         |      |      | --- Makefile.softwareunit
         |      | --- MySubsystem1/
         |      |          | --- include/
         |      !          | --- lib/
         |      |          | --- src/
         |      |                 | --- Makefile
         |      |                 | --- RCS/
         |      |                 | --- MySoftwareUnit11/
         |      |                 |          |
         |      |                 |          | --- src/
         |      |                 |                 | --- mywebappdir1/
         |      |                 |                 |         | --- RCS/
         |      |                 |                 | --- mywebappdir2/
         |      |                 |                 |         | --- RCS/
         |      |                 |                 | --- ...
         |      |                 |                 | --- mywebappdirN/
         |      |                 |                 |         | --- RCS/
         |      |                 |                 | --- mypackage1/
         |      |                 |                 |         |--- mysubpackage1/
         |      |                 |                 |                   |--- RCS/
         |      |                 |                 | --- mypackage2/
         |      |                 |                 |         |--- mysubpackage2/
         |      |                 |                 |                   |--- RCS/
         |      |                 |                 | --- .../
         |      |                 |                 | --- mypackageN/
         |      |                 |                 |         |--- mysubpackageN/
         |      |                 |                 |                   |--- RCS/
         |      |                 |                 | --- Makefile
         |      |                 |                 | --- RCS/
         |      |                 | --- MySoftwareUnit12/
         |      |                 |          |
         |      |                 |          | --- src/
         |      |                 |                 | --- Makefile
         |      |                 |                 | --- RCS/
         |      |                 | --- ...
         |      |                 | --- MySoftwareUnit1M/
         |      |                 |          |
         |      |                 |          | --- src/
         |      |                 |                 | --- Makefile
         |      |                 |                 | --- RCS/
         |      | --- MySubsystem2/
         |      |          | --- include/
         |      |          | --- lib/
         |      |          | --- src/
         |      |                 | --- Makefile
         |      |                 | --- RCS/
         |      |                 | --- MySoftwareUnit21/
         |      |                 |          |
         |      |                 |          | --- src/
         |      |                 |                 | --- Makefile
         |      |                 |                 | --- RCS/
         |      |                 | --- MySoftwareUnit22/
         |      |                 |          |
         |      |                 |          | --- src/
         |      |                 |                 | --- Makefile
         |      |                 |                 | --- RCS/
         |      |                 | --- ...
         |      |                 | --- MySoftwareUnit2M/
         |      |                 |          |
         |      |                 |          | --- src/
         |      |                 |                 | --- Makefile
         |      |                 |                 | --- RCS/
         |      | --- ...
         |      | --- MySubsystemN
         |      |          | --- include/
         |      |          | --- lib/
         |      |          | --- src/
         |      |                 | --- MySoftwareUnit21/
         |      |                 |          |
         |      |                 |          | --- src/
         |      |                 |                 | --- Makefile
         |      |                 |                 | --- RCS/
         |      |                 | --- MySoftwareUnit22/
         |      |                 |          |
         |      |                 |          | --- src/
         |      |                 |                 | --- Makefile
         |      |                 |                 | --- RCS/
         |      |                 | --- ...
         |      |                 | --- MySoftwareUnit2M/
         |      |                 |          |
         |      |                 |          | --- src/
         |      |                 |                 | --- Makefile
         |      |                 |                 | --- RCS/
         | --- bin/
         | --- lib/
         | --- include/
         | --- classes/
         | --- conf/
         | --- docs/
         | --- web/
                |
                | --- MyWebApp1/
                !         |
                !         | --- mywebappdir1/
                !         | --- mywebappdir2/
                !         | --- ...
                !         | --- mywebappdirN/
                |         | --- WEB-INF/
                |                  | --- classes/
                |                  | --- lib/
                | --- MyWebApp2/
                !         |
                |         | --- WEB-INF/
                |                  | --- classes/
                |                  | --- lib/
                | --- .../
                | --- MyWebAppN/
                |          |
                |          | --- WEB-INF/
                |                   | --- classes/
                |                   | --- lib/
                | --- MyWebSite1/
                | --- MyWebSite2/
                | ...
                | --- MyWebSiteN/

Note that you can add other subsystems and software units later, but to generate an application or a library you must create at least a subsystem and for this subsystem at least a software unit

Variables

Before using the MySDE development environment you must fill some variables into all three Makefiles at system, subsystem and software unit level:

  • system:

  SUBSYSTEMS=\
    MySubsystem1 \
    MySubsystem2 \
    ...\
    MySubsystemN

  TARGET_JARS=\
    mywebapp1.war[:mywebapp1manifestfilepath]\
    mywebapp2.war[:mywebapp2manifestfilepath]\
    ...\
    mywebappN.war[:mywebappNmanifestfilepath]\
    myjar1name.jar[:myjar1dir[:myjar1file1,...,myjar1fileM[:myjar1manifestfilepath]]]\
    myjar2name.jar[:myjar2dir[:myjar2file1,...,myjar2fileM[:myjar2manifestfilepath]]]\
    ...\
    myjarNname.jar[:myjarNdir[:myjarNfile1,...,myjarNfileM[:myjarNmanifestfilepath]]]
    (default: myjardir = classes, myjarfiles = .)

  SYS_JARS=\
    /path/to/myjarfile1.jar \
    /path/to/myjarfile2.jar \
    ...\
    /path/to/myjarfileN.jar

  SYS_LIBS=\
    -l/path/to/mylibfile1.a \
    -l/path/to/mylibfile2.a \
    ...\
    -l/path/to/mylibfileN.a

  SYS_INC_PATH=\
    -I/path/to/myincludedir1 \
    -I/path/to/myincludedir2 \
    ...\
    -I/path/to/myincludedirN

  SYS_LIB_PATH=\
    -L/path/to/mylibdir1 \
    -L/path/to/mylibdir2 \
    ...\
    -L/path/to/mylibdirN

  # System Java virtual machine options
  SYS_JAVA_OPTS=myjavavmoptions

  # System javadoc options
  SYS_JDOC_OPTS=myjavadocoptions

  # System flags for C/C++, Java, Lex and Yacc compilers, AsciiDoc tool
  SYS_CFLAGS=
  SYS_JFLAGS=
  SYS_LFLAGS=
  SYS_YFLAGS=
  SYS_AFLAGS=

  # System flags for checkin and checkout (RCS)
  SYS_CIFLAGS=
  SYS_COFLAGS=
  • subsystem:

  SOFTWAREUNITS=\
    MySoftwareUnit1 \
    MySoftwareUnit2 \
    ...\
    MySoftwareUnitN

  SUB_JARS=\
    /path/to/myjarfile1.jar \
    /path/to/myjarfile2.jar \
    ...\
    /path/to/myjarfileN.jar

  SUB_LIBS=\
    -l/path/to/mylibfile1.a \
    -l/path/to/mylibfile2.a \
    ...\
    -l/path/to/mylibfileN.a

  SUB_INC_PATH=\
    -I/path/to/myincludedir1 \
    -I/path/to/myincludedir2 \
    ...\
    -I/path/to/myincludedirN

  SUB_LIB_PATH=\
    -L/path/to/mylibdir1 \
    -L/path/to/mylibdir2 \
    ...\
    -L/path/to/mylibdirN

  # Subsystem Java virtual machine options
  SUB_JAVA_OPTS=myjavavmoptions

  # Subsystem javadoc options
  SUB_JDOC_OPTS=myjavadocoptions

  # Subsystem flags for C/C++, Java, Lex and Yacc compilers, AsciiDoc tool
  SUB_CFLAGS=
  SUB_JFLAGS=
  SUB_LFLAGS=
  SUB_YFLAGS=
  SUB_AFLAGS=

  # Subsystem flags for checkin and checkout (RCS)
  SUB_CIFLAGS=
  SUB_COFLAGS=
  • software unit:

  # Java WEB application
  TARGET_WEB=mywebapp

  # Java main class name and args
  TARGET_MAIN=my.java.main.class
  TARGET_ARGS=myjavamainargs

  # AsciiDoc based web site
  TARGET_WEBSITE=mywebsite

  TARGET_BIN=myapplication

  SYS_TARGET_LIB=libmysystem.a
  # or
  SYS_TARGET_LIB=libmysystem.so

  SUB_TARGET_LIB=libmysubsystem.a
  # or
  SUB_TARGET_LIB=libmysubsystem.so

  TARGET_SCRIPTS=\
    myscript1.sh \
    myscript2.awk \
    ...\
    myscriptN.pl

  TARGET_CONF=\
    myconfigfile1.conf \
    myconfigfile2.conf \
    ...\
    myconfigfileN.conf

  JARS=\
    /path/to/myjarfile1.jar \
    /path/to/myjarfile2.jar \
    ...\
    /path/to/myjarfileN.jar

  EXTERN_WEB=\
    /my/external/web/resourcefile1[:my/local/webapp/outputdir1] \
    /my/external/web/resourcefile2[:my/local/webapp/outputdir2] \
    ...\
    /my/external/web/resourcefileN[:my/local/webapp/outputdirN]
    (default: my/local/webapp/outputdir = WEB-INF/lib)

  EXTERN_WEB=\
    /my/external/web/resourcefile1[:my/local/webapp/outputdir1] \
    /my/external/web/resourcefile2[:my/local/webapp/outputdir2] \
    ...\
    /my/external/web/resourcefileN[:my/local/webapp/outputdirN]
    (default: my/local/webapp/outputdir = .)

  EXTERN_ROOT=\
    /my/external/website/resources/root/dir

  LIBS=\
    -l/path/to/mylibfile1.a \
    -l/path/to/mylibfile2.a \
    ...\
    -l/path/to/mylibfileN.a

  INC_PATH=\
    -I/path/to/myincludedir1 \
    -I/path/to/myincludedir2 \
    ...\
    -I/path/to/myincludedirN

  LIB_PATH=\
    -L/path/to/mylibdir1 \
    -L/path/to/mylibdir2 \
    ...\
    -L/path/to/mylibdirN

  SYS_HEADERS.h=\
    mysystemheaderfile1.h \
    mysytemsheaderfile2.h \
    ...
    mysystemheaderfileN.h

  SUB_HEADERS.h=\
    mysubsystemheaderfile1.h \
    mysubsytemsheaderfile2.h \
    ...
    mysubsystemheaderfileN.h

  HEADERS.h=\
    mylocalheaderfile1.h \
    mylocalheaderfile2.h \
    ...
    mylocalheaderfileN.h

  SOURCES.c=\
    mycsourcefile1.h \
    mycsourcefile2.h \
    ...
    mycsourcefileN.h

  SOURCES.c=\
    mycsourcefile1.h \
    mycsourcefile2.h \
    ...
    mycsourcefileN.h

  SOURCES.cc=\
    mycplusplussourcefile1.cc \
    mycplusplussourcefile2.cc \
    ...
    mycplusplussourcefileN.cc

  SOURCES.java=\
    myjavasourcefile1.java \
    my/package/path/from/src/javasourcefile2.java \
    ...
    my/package/path/from/src/javasourcefileN.java

  SOURCES.web=\
    mywebsourcefile1.html \
    mywebsourcefile2.txt \
    ...
    mywebsourcefileN.js

  SOURCES.l=\
    mylexsourcefile1.l \
    mylexsourcefile2.l \
    ...
    mylexsourcefileN.l

  SOURCES.y=\
    myyaccsourcefile1.y \
    myyaccsourcefile2.y \
    ...
    myyaccsourcefileN.y

  SOURCES.txt=\
    myasciidocsourcefile1.txt \
    myasciidocsourcefile2.txt \
    ...
    myasciidocsourcefileN.txt

  # Software Unit Java virtual machine options
  JAVA_OPTS=myjavavmoptions

  # Software Unit javadoc options
  JDOC_OPTS=myjavadocoptions

  # Software Unit flags for C/C++, Java, Lex and Yacc compilers, AsciiDoc tool
  CFLAGS=
  JFLAGS=
  LFLAGS=
  YFLAGS=
  AFLAGS=

  # Software Unit flags for checkin and checkout (RCS)
  CIFLAGS=
  COFLAGS=

  # Software Unit FTP deploy parameters
  FTP_HOST=
  FTP_USERNAME=
  FTP_PASSWORD=
  FTP_REMOTEDIR=
  FTP_LOCALDIR=

  if FTP_LOCALDIR is empty and TARGET_WEBSITE is not empty
  then default value of FTP_LOCALDIR is ${MYSDE_ROOT}/web/${TARGET_WEBSITE}

The common Makefile can be edited to modify the path of compilers and tools

Usage

To use the MySDE development environment you must execute the make command from one of the src subdirectories at the three levels:

  • system level:

    • make create all objects of the systems

    • make clean delete all objects of the systems

    • make tar make a tar of the system src subdirectory

    • make checkin [rev=<revision>] make the checkin of all objects of the system

    • make checkout [rev=<revision>] make the checkout of all objects of the system

    • make jar create all java libraries

    • make javadoc execute javadoc for all classes of the system

    • make deploy execute FTP deploy for all subsystems

  • subsystem level

    • make create all objects of the subsystem

    • make clean delete all objects of the subsystem

    • make tar make a tar of the subsystem src subdirectory

    • make checkin [rev=<revision>] make the checkin of all objects of the subsystem

    • make checkout [rev=<revision>] make the checkout of all objects of the subsystem

    • make javadoc execute javadoc for all classes of the subsystem

    • make deploy execute FTP deploy for all software units

  • software unit level

    • make create all objects of the software unit

    • make clean delete all objects of the software unit

    • make tar make a tar of the software unit src subdirectory

    • make checkin [rev=<revision>] make the checkin of all objects of the software unit

    • make checkout [rev=<revision>] make the checkout of all objects of the software unit

    • make javadoc execute javadoc for all classes of the software unit

    • make install install the objects of the software unit:

    • C/C++ application and scripts into bin system subdirectory

    • C/C++ library into lib system or subsystem subdirectory

    • Java classes into classes system subdirectory (removing them from src software unit subdirectory) or in web application classes subdirectory

    • configuration files into conf system subdirectory

    • local and external web application files into web application root subdirectory

    • … | make path print on standard output the string evaluated joining all strings from standard input with ":"

    • make classpath print on standard output the string to use as CLASSPATH value (including classes system subdirectory and all Java libraries)

    • make run execute the Java application configured in the software unit Makefile

    • make deploy execute FTP deploy of software unit

    • make webappdeploy deploy the web application to the web server

The command make help from each src level give a summary of the available commands

Notes

  • in order to use the MySDE environment the following tools must be installed and available for command-line execution:

    • make

    • tar

    • gzip

    • ci and co (for checkin and checkout with RCS)

    • asciidoc (for websites)

  • for each web application archive must be specified into TARGET_JARS the .war filename (e.g. TARGET_JARS=mywebapp.war) and optionally the path to relative manifest file

Examples

The MySDE installation kit is made only of the mysde shell script.

In order to use MySDE you must:

  • create the development environment executing mysde (specifying as optional argument its base directory): mysde (if not base directory is specified then $HOME/mysde is used as default)

  • to use the development environment execute:

    1. $HOME/mysde/.profile (to set all environment variables including $MYSDE_BASE as the base directory $HOME/mysde and $MYSDE_ROOT as the root directory $HOME/mysde/src/mysde, or $MYSYSTEM_BASE and $MYSYSTEM_ROOT if, for example, $HOME/mysystem was specified as base directory)

  • if necessary customize file $MYSDE_BASE/.mysderc with environment variables, such as external PATH or LD_LIBRARY_PATH or others environment variables (or $MYSYSTEM_BASE/.mysystemrc if, for example, $HOME/mysystem was specified as base directory)

  • copy under $MYSDE_BASE/pkg the source packages .tar.gz to be used by development environment (e.g. rcs-5.7.tar.gz), buildable with commands such as: configure make make install

  • customize $MYSDE_BASE/makefiles/Makefile to add actions to build each source package copying the predefined templates build.mypkg and clean.mypkg (or customizing it if the commands specified into build.mypkg.template and clean.mypkg.template templates are not ok to build or clean the package)

    build.rcs-5.7:
          make build package=rcs-5.7
    clean.rcs-5.7:
          make clean package=rcs-5.7
  • build each package executing under $MYSDE_BASE: make build.rcs-5.7

  • add some subsystem and/or softwareunit to development environment: mysde -S mysubsystem1/mysoftwareunit1,mysubsystem2/mysoftwareunit2 (or mysde -S mysubsystem1/mysoftwareunit1,mysubsystem2/mysoftwareunit2 $HOME/mysystem if, for example, $HOME/mysystem was specified as base directory)

  • note that you can specify once the subsytem for all software units (if is common) with -S <subsystem> and -s <softwareunits> or specify for each software unit its corresponding subsystem with -s <subsystem1>/<softwareunit1>,<subsystem2>/<softwareunit2>,…,<subsystemN>/<softwareunitN> or as -s "<subsystem1>/<softwareunit1> <subsystem2>/<softwareunit2> <subsystemN>/<softwareunitN>"

  • another way to add a subsystem is to execute under $MYSDE_ROOT/src make init subsystems="mysubsystem"

  • another way to add a software unit is to execute under $MYSDE_ROOT/src/mysubsystem/src make init softwareunits="mysoftwareunit"

  • customize $MYSDE_ROOT/src/Makefile specifying into variable SUBSYSTEMS the list of added subsystems (using one backslash as line terminator, for each line, if muliple lines are used to specify the list instead of spaces)

  • for each subsystem customize $MYSDE_ROOT/src/mysubsystem/src/Makefile specifying into variable SOFTWAREUNITS the list of its softwareunits

  • for each softwareunit of each subsystem copy under $MYSDE_ROOT/src/mysubsytem/src/mysoftwareunit/src the source code and configuration files used by that softwareunit

  • for each softwareunit of each subsystem customize $MYSYSTEM_ROOT/src/mysubsytem/src/mysoftwareunit/src/Makefile specifying values for variables corresponding to source code files, binary targets, library paths, library names or other options (e.g. for a C+\+ main application TARGET_BIN for the name of executable and SOURCES.cc and SOURCES.hh the name of C++ source code files)

  • build the softwareunit and install (e.g. under $MYSDE_ROOT/bin, $MYSDE_ROOT/lib, $MYSDE_ROOT/classes of $MYSDE_ROOT/web) its deliverables (e.g. C+\+ executable, Java or C++ library) executing under $MYSDE_ROOT/src/mysubsytem/src/mysoftwareunit/src: make make install

  • to backup only the development environment root tree execute under $MYSDE_ROOT/src: make tar (creating under $MYSDE_ROOT/.. a file mysde-YYYYMMDDhhmmssr-src.tar.gz)

  • to backup your entire development environment base tree execute under $MYSDE_BASE: make tar (creating under $MYSDE_BASE/.. a file mysde-YYYYMMDDhhmmss.tar.gz)

  • to use the development environment under another UNIX OS (e.g. a sun) is sufficient

    • make a backup of the entire development environment base tree

    • copy via ftp this backup file mysde-YYYYMMDDhhmmss.tar.gz on the new sun host

    • untar the backup: gunzip mysde-YYYYMMDDhhmmss.tar.gz tar xvf mysde-YYYYMMDDhhmmss.tar

    • execute . $MYSDE_BASE/.profile to init all environment variables

    • setup a new environment executing under $MYSDE_BASE: make init names="sun" (to create a new default set of sun configuration files) make conf name="sun" (to switch all symbolic links to sun files $MYSDE_BASE/.profile.sun, $MYSDE_BASE/.mysderc.sun, $MYSDE_BASE/local.sun, $MYSDE_BASE/.build.sun and $MYSDE_BASE/makefiles/Makefile.sun)

    • customize (if necessary) $MYSDE_BASE/.mysderc and $MYSDE_BASE/makefiles/Makefile

    • rebuild all packages from their sources executing the same "make build" commands from $MYSDE_BASE (e.g. make build package=rcs-5.7)

    • rebuild all subsystems and sofwareunit, e.g. executing from $MYSDE_ROOT/src: make clean make

  • to return developing on the previous UNIX OS (e.g. "default" created as default when setup the development environment) is sufficient:

    • backup the entire development environment base tree

    • copy and untar this backup on the previous UNIX

    • execute: make conf name="default" (to switch all symbolic links to default files $MYSDE_BASE/.profile.default, $MYSDE_BASE/.mysderc.default, $MYSDE_BASE/local.default, $MYSDE_BASE/.build.default and $MYSDE_BASE/makefiles/Makefile.default)

    • rebuild all subsystems and sofwareunits executing from $MYSDE_ROOT/src: make clean make

  • to get help on make commands availables execute from $MYSDE_BASE and $MYSDE_ROOT/src: make help

  • two main rules when edit a Makefile:

    • when assign a value to a variable don’t put spaces after equal (=) if a value is multi-line end each line with a backspace (\)

    • each command of a target must begin with a single tab character use ": set list" editing files with vi to view the hidden characters such as tabs and end of lines (then ":set nolist" to switch off)

  • look at $MYSDE_ROOT/src/makefiles/Makefile as Makefile example