Zsetup#
Description#
This program generates a Makefile.dat
from a configuration file
named library_files
. The program is efficient for setting up
dependencies, adding new files, managing source directories, and
configuring libraries to create. It is provided as a utility for generating
appropriate Makefiles for user plugins.
Syntax#
In order to configure a source project, define the project structure in
library_files
and run Zsetup:
% Zsetup [
options]
\(\hookleftarrow\)
Options |
DESCRIPTION |
---|---|
|
original debug info for ZebFront programs |
-f <file> |
give an alternative configuration file (by default
the file named |
|
display help information for this command |
The -od
switch can be used to debug ZebFront program compilations.
By default ZebFront re-assigns line numbers to the corresponding number
in the .z
file, and the .c
C++ source is removed after
successful compilation. Because many lines are added to the resulting
C++ file, there is a possibility that syntax errors are first referenced
in the generated code. This method of compiling will leave the .c
file, and error messages from the compiler will refer to that file.
The syntax of the library_files
is partially summarized below. All
commands start with an exclamation point (!
) and are followed by
free format lists of parameters. In most cases the parameters are read
until the next command appears (not so for !MAKE
). The parameters may
be split with comments. The comment character is the pound sign (#
).
The file reading will end with the !!RETURN
command, which must
exist in the file.
|
Makefile lines which will be added to the top of the |
|
Indicates that all libraries to be generated, and those to
be used, will be shared libraries ( |
|
These are command options which are added on each source file
compilation line. One could also use the |
|
These are command options passed on at the link stage of the compilation. |
|
This command takes only one argument, the name of a
directory containing header files ( |
|
Description of the dependencies for a directory with C++ source files.
The directory name must be given, followed by the include directories with
|
|
Fortran files directory. |
|
Takes a list of the directories or file names to be compiled in debug
when Zmake is run using the |
|
Defines a library to be created. The first parameter is the name of the library, followed by the source directories which are contained in it. |
|
Defines a target executable. The first parameter is the prefix name of the executable, followed by the source directories which are contained in it. |
Important
Source files are included only if they begin with a capital letter and must have unique names.
A user-shared library intended for use with Z-mat should contain “Zmat” in its name.
Example#
The library_files
file used for the small user project is as
follows:
!MESSAGE User Z7 project
!DYNAMIC
!CFLAGS -I${Z7PATH}/include
!BFLAGS -L${Z7PATH}/PUBLIC/lib-${Z7MACHINE}
!INC source
!SRC source source
!DEBUG source
!LIB ZeBaBa_User source
!TARGET NONE source
!!RETURN
Note
An example of a user project is provided in $Z7PATH/User-project
, with
library_files
(for Linux) and *.zpr
(for Windows) files.
Setup user projects in Windows#
Setting up and building a user project on Windows differs from the process on Linux.
In the following, we outline how to configure and compile a user project using Microsoft
Visual Studio. The configuration file *.zpr
allows to easily generate a visual studio
project *.dsp
The syntax of the configuration file (.zpr
) is partially summarized below.
The comment character is the percent sign (%
).
|
defines the base directory ( |
|
indicates that the build will produce a DLL named user_dll. |
|
directory where Z-set DLLs will be installed. |
|
indicates the directory where the user project files are located. |
|
flag to prevent automatic installation after the build. |
|
specifies the version of Visual C++ being used. |
|
indicates that the build is for a 64-bit platform. |
|
optimization options for the compiler in release mode. |
|
debug options for the compiler in debug mode. |
|
additional preprocessor definitions and options for the compiler. |
|
linking options. |
|
specify the group of source files. |
|
indicates dependencies or modules to be used in the build. |
Here is an example of a Windows project file:
!Z7DIR C:\MyPath\Z9.1
!O_DEST_DIR C:\MyPath\Z9.1\win64
!PROJDIR D:\USER_PROJ
!DONT_INSTALL
!VCPP 6.00
!64BITS
!O_OPT CPP /Ox /D "NDEBUG" /FR /GX /MD /G5 /Tp /Gm-
!D_OPT CPP /D "ZCHECK" /Od /D "NDEBUG" /Zi /GX /MD /G5 /Tp /Gm-
!OPT LINK32
kernel32.lib
msvcrt.lib
/INCREMENTAL:NO /debug
/libpath:"..\win64"
!OPT CPP /D "ZEXCEPTIONS" /Tp /D "DLL3" /D "_WIN32"
!DLL zmat_user
!GROUPS
src
!USE
zmat_base
!!RETURN
Important
The name of a user dynamic link library intended for use with Z-mat should start with “zmat” (Case-insensitive).
To build a Z-set user project, follow these steps:
Execute the project file with
%Z7PATH%\win64\win_proj.exe
\(\longrightarrow\) generates user_dll.dsp
file.Open user_dll
.dsp
file with Visual studio.Retarget solution to the latest Microsoft toolset.
Build the solution (user_dll
.dll
).