Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Compiler-flags

3 views
Skip to first unread message

J?rg Polzfu?

unread,
Jan 31, 2005, 7:41:10 AM1/31/05
to
Hello,

I've found some information in the SDK-Docs. Unfortunately the
"XGOCFLAGS"-flags are listed as "GOCFLAGS". And the other flags do
have different names, too?!

Confused,
Jörg
P.S.: Maybe I should sue Google for making their newsgroups-access
worse every day: the "reply-to"-function doesn't work anymore, ...
*argllll*

============================

Concepts book
Libraries
C.6 Compiler Directives

Libraries have to be compiled slightly differently from applications.
Since library routines are run under application threads, they must
treat global variables differently than applications do. You must
therefore add pragmas to ensure that the library is compiled
correctly.
There are several steps to take:
* The compiler should not to expect the ss register to be the same as
ds.
* The compiler must generate code to load the dgroup segment address
into ds at the start of exported routines.
* The compiler must set up semaphores or other data-synchronization
structures for global variables.
Most compiler manuals have a section on compiling dynamically-linked
libraries (DLLs) for Microsoft Windows; this section will describe how
to set up these conditions. Note that you need only do this if your
library will have its own global or static variables. If the library's
routines and methods use only local, automatic variables, you need not
perform these actions.
When you compile a library, you must pass the argument "-L <libname>"
to Goc. Edit your local.mk file to make it insert this flag. For more
information about the local.mk file, see "Using Tools," Chapter 10 of
the
Tools book.
Finally, if your library is written in C or Goc (or if its API is in
C, even if some internal routines are written in assembly), you must
indicate this by putting the flag c-api on the "type" line of the
library's .gp file. This instructs the kernel to pass arguments on the
stack (instead of in registers) when calling the entry point routine.

============================

Tools Book
Pmake
10.13.2 How to Customize pmake

For most applications, executing mkmf will generate a perfect
makefile. However, you may be creating an unusual geode or have some
makefile definitions which you want to include. Fortunately, there are
ways to
customize your make environment without having to build a MAKEFILE
from scratch.
Makefiles can #include other makefiles. If you have a file named
LOCAL.MK in your make directory, then the standard makefile generated
by mkmf will include it; if you wish to customize your makes, you can
create a LOCAL.MK file and fill it with appropriate make directives.
Depending on how much customization you need to do, you may wish to
read on to find out about makefile syntax. However, there are several
simple things you can do without learning too much about makefiles.
# Pass extra flags to Goc:
GOCFLAGS += flag1 flag2
# Pass extra flags to your C compiler:
CCOMFLAGS += flag1 flag2
# Pass extra flags to the Esp assembler (if you have
# that tool):
ASMFLAGS += flag1 flag2
# Pass extra flags to the Glue linker:
LINKFLAGS += flag1 flag2
# Look somewhere special for .GOC files
# (This pattern applies to any suffix):
.PATH.GOC : $(ROOT_DIR)\DIR1 \DIR2
# Specify geode name:
GEODE = NAME
# Set NO_EC variable (which signals that we don't
# want to make an Error Checking version):
NO_EC = 1
# If your preprocessor is not reachable via the
# Path environment variable:
CPP = vol:\path\name
# If your C compiler is not reachable via the Path
# environment variable:
CCOM = vol:\path\name
# Include some other make file
#include "OTHERMF.MK"
# Include the standard makefile directives
# This will include INCLUDE\GEODE.MK:
#include <$(SYSMAKEFILE)>

Code Display 10-2 Sample local.mk Files
---FINGER\LOCAL.MK
# Local Makefile for FPaint
# FPaint is stored in a directory called FINGER. This would normally
confuse
# pmake, which expects the geode name to be the same as the directory
name.
# Let us, therefore, alert pmake to the geode's real name:
GEODE = FPAINT
# This was the only thing we wanted to change, so include standard
definitions:
#include <$(SYSMAKEFILE)>
---PROMO\LOCAL.MK
# Local Makefile for Promo
# Promo uses some clip art that isn't in or below its source
directory, so we
# tell pmake where to look for it:
.PATH.GOH : $(CSOURCE_PATHS) $(CINCLUDE_DIR) $(ROOT_DIR)\LOGOART
# This program contains no Error Checking code (See
# "GEOS Programming," Chapter 5 of the Concepts Book for information
# about EC code. So we tell pmake not to bother making an Error
Checking
# version:
NO_EC = 1
# Include the standard system makefile:
#include <$(SYSMAKEFILE)>

0 new messages