⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 sdccman.txt

📁 This a FREE tool chain which compiles C codes into 8051 binary code, converts the binary to RTL ROM,
💻 TXT
📖 第 1 页 / 共 5 页
字号:
docdir="
\${datarootdir}/doc" \ 
include_dir_suffix="include" \
lib_dir_suffix="
lib" \
sdccconf_h_dir_separator="\\\\" \
CC="gcc -mno-cygwin" \
CXX="
g++ -mno-cygwin" 

'configure' is quite slow on Cygwin (at least on 
windows before Win2000/XP). The option '--C' turns on 
caching, which gives a little bit extra speed. However 
if options are changed, it can be necessary to delete 
the config.cache file.

2.2 Install paths<sub:Install-paths>





+-------------------+----------------------------------+----------------------------------+-----------------+
| 

Description     | 

Path                           | 

Default                        | 

Win32 builds  |
+-------------------+----------------------------------+----------------------------------+-----------------+
+-------------------+----------------------------------+----------------------------------+-----------------+
| 

Binary files*   | 

$EXEC_PREFIX                   | 

/usr/local/bin                 | 

\sdcc\bin     |
+-------------------+----------------------------------+----------------------------------+-----------------+
| 

Include files   | 

$DATADIR/ $INCLUDE_DIR_SUFFIX  | 

/usr/local/share/sdcc/include  | 

\sdcc\include |
+-------------------+----------------------------------+----------------------------------+-----------------+
| 

Library file**  | 

$DATADIR/$LIB_DIR_SUFFIX       | 

/usr/local/share/sdcc/lib      | 

\sdcc\lib     |
+-------------------+----------------------------------+----------------------------------+-----------------+
| 

Documentation   | 

$DOCDIR                        | 

/usr/local/share/sdcc/doc      | 

\sdcc\doc     |
+-------------------+----------------------------------+----------------------------------+-----------------+


*compiler, preprocessor, assembler, and linker
**the 
model is auto-appended by the compiler, e.g. small, 
large, z80, ds390 etc

The install paths can still be changed during `make 
install' with e.g.:

make install prefix=$(HOME)/local/sdcc

Of course this doesn't change the search paths compiled 
into the binaries.

Moreover the install path can be 
changed by defining DESTDIR:

make install DESTDIR=$(HOME)/sdcc.rpm/

Please note that DESTDIR must have a trailing slash!

2.3 Search Paths<sub:Search-Paths>

Some search paths or parts of them are determined by 
configure variables (in italics, see section above). 
Further search paths are determined by environment 
variables during runtime. 
The paths searched when 
running the compiler are as follows (the first catch wins):


1. Binary files (preprocessor, assembler and linker)


+-----------------------------------+--------------------+-------------------+
| 

Search path                     | 

default          | 

Win32 builds    |
+-----------------------------------+--------------------+-------------------+
+-----------------------------------+--------------------+-------------------+
| 

$SDCC_HOME/$PPREFIX2BIN_DIR     | 

$SDCC_HOME/bin   | 

$SDCC_HOME\bin  |
+-----------------------------------+--------------------+-------------------+
| 

Path of argv[0] (if available)  | 

Path of argv[0]  | 

Path of argv[0] |
+-----------------------------------+--------------------+-------------------+
| 

$PATH                           | 

$PATH            | 

$PATH           |
+-----------------------------------+--------------------+-------------------+

 


2. Include files


+------------------------------------------------------+--------------------------------------------------------------------------+----------------------------+
| 

Search path                                        | 

default                                                                | 

Win32 builds             |
+------------------------------------------------------+--------------------------------------------------------------------------+----------------------------+
+------------------------------------------------------+--------------------------------------------------------------------------+----------------------------+
| 

--I dir                                            | 

--I dir                                                                | 

--I dir                  |
+------------------------------------------------------+--------------------------------------------------------------------------+----------------------------+
| 

$SDCC_INCLUDE                                      | 

$SDCC_INCLUDE                                                          | 

$SDCC_INCLUDE            |
+------------------------------------------------------+--------------------------------------------------------------------------+----------------------------+
| 

$SDCC_HOME/
$PREFIX2DATA_DIR/
$INCLUDE_DIR_SUFFIX  | 

$SDCC_ HOME/
share/sdcc/
include                                       | 

$SDCC_HOME\include       |
+------------------------------------------------------+--------------------------------------------------------------------------+----------------------------+
| 

path(argv[0])/
$BIN2DATADIR/
$INCLUDE_DIR_SUFFIX   | 

path(argv[0])/
../sdcc/include
                                        | 

path(argv[0])\..\include |
+------------------------------------------------------+--------------------------------------------------------------------------+----------------------------+
| 

$DATADIR/
$INCLUDE_DIR_SUFFIX                      | 

/usr/local/share/sdcc/
include                                         | 

(not on Win32)           |
+------------------------------------------------------+--------------------------------------------------------------------------+----------------------------+

 


The option --nostdinc disables the last two search paths.


3. Library files 


With the exception of "--L dir" the model is 
auto-appended by the compiler (e.g. small, large, z80, 
ds390 etc.). 


+----------------------------------------------------------+-------------------------------------------------------------------------------+---------------------------------------------------------------------+
| 

Search path                                            | 

default                                                                     | 

Win32 builds                                                      |
+----------------------------------------------------------+-------------------------------------------------------------------------------+---------------------------------------------------------------------+
+----------------------------------------------------------+-------------------------------------------------------------------------------+---------------------------------------------------------------------+
| 

--L dir                                                | 

--L dir                                                                     | 

--L dir                                                           |
+----------------------------------------------------------+-------------------------------------------------------------------------------+---------------------------------------------------------------------+
| 

$SDCC_LIB/
<model>                                     | 

$SDCC_LIB/
<model>                                                          | 

$SDCC_LIB\
<model>                                                |
+----------------------------------------------------------+-------------------------------------------------------------------------------+---------------------------------------------------------------------+
| 

$SDCC_HOME/
$PREFIX2DATA_DIR/
$LIB_DIR_SUFFIX/<model>  | 

$SDCC_HOME/
share/sdcc/
lib/<model>                                         | 

$SDCC_HOME\lib\
<model>                                           |
+----------------------------------------------------------+-------------------------------------------------------------------------------+---------------------------------------------------------------------+
| 

path(argv[0])/
$BIN2DATADIR/
$LIB_DIR_SUFFIX/<model>   | 

path(argv[0])/
../sdcc/lib/<model>
                                         | 

path(argv[0])\
..\lib\<model>
                                    |
+----------------------------------------------------------+-------------------------------------------------------------------------------+---------------------------------------------------------------------+
| 

$DATADIR/
$LIB_DIR_SUFFIX/<model>                      | 

/usr/local/share/sdcc/
lib/<model>                                          | 

(not on Win32)                                                    |
+----------------------------------------------------------+-------------------------------------------------------------------------------+---------------------------------------------------------------------+





 
The option --nostdlib disables the last two search paths.

2.4 Building SDCC

2.4.1 Building SDCC on Linux<sub:Building-SDCC-on-Linux>

1. Download the source package either from the SDCC 
  Subversion repository or from snapshot builds, it 
  will be named something like 
  sdcc-src-yyyymmdd-rrrr.tar.bz2 [http://sdcc.sourceforge.net/snap.php].

2. Bring up a command line terminal, such as xterm.

3. Unpack the file using a command like: "tar -xvzf 
  sdcc-src-yyyymmdd-rrrr.tar.bz2", this will create a 
  sub-directory called sdcc with all of the sources.

4. Change directory into the main SDCC directory, for 
  example type: "cd sdcc".

5. Type "./configure". This configures the package for 
  compilation on your system.

6. Type "make". All of the source packages will 
  compile, this can take a while.

7. Type "make install" as root. This copies the binary 
  executables, the include files, the libraries and the 
  documentation to the install directories. Proceed 
  with section [sec:Testing-the-SDCC].

2.4.2 Building SDCC on Mac OS X

Follow the instruction for Linux.

On Mac OS X 10.2.x it 
was reported, that the default gcc (version 3.1 
20020420 (prerelease)) fails to compile SDCC. 
Fortunately there's also gcc 2.9.x installed, which 
works fine. This compiler can be selected by running 
'configure' with:

./configure CC=gcc2 CXX=g++2

Universal (ppc and i386) binaries can be produced on 
Mac OS X 10.4.x with Xcode. Run 'configure' with:

./configure \


LDFLAGS="-Wl,-syslibroot,/Developer/SDKs/MacOSX10.4u.sdk 
-arch i386 -arch ppc" \

CXXFLAGS = "-O2 -isysroot 
/Developer/SDKs/MacOSX10.4u.sdk -arch i386 -arch ppc" \

CFLAGS = "-O2 -isysroot /Developer/SDKs/MacOSX10.4u.sdk 
-arch i386 -arch ppc"

2.4.3 Cross compiling SDCC on Linux for Windows

With the Mingw32 gcc cross compiler it's easy to 
compile SDCC for Win32. See section 'Configure Options'.

2.4.4 Building SDCC using Cygwin and Mingw32

For building and installing a Cygwin executable follow 
the instructions for Linux.

On Cygwin a "native" 
Win32-binary can be built, which will not need the 
Cygwin-DLL. For the necessary 'configure' options see 
section 'configure options' or the script 
'sdcc/support/scripts/sdcc_cygwin_mingw32'.

In order to 
install Cygwin on Windows download setup.exe from [http://www.cygwin.com/||www.cygwin.com]. Run 
it, set the "default text file type" to "unix" and 
download/install at least the following packages. Some 
packages are selected by default, others will be 
automatically selected because of dependencies with the 
manually selected packages. Never deselect these packages!

* flex

* bison

* gcc ; version 3.x is fine, no need to use the old 2.9x

* binutils ; selected with gcc

* make

* rxvt ; a nice console, which makes life much easier 
  under windoze (see below)

* man ; not really needed for building SDCC, but you'll 
  miss it sooner or later

* less ; not really needed for building SDCC, but 
  you'll miss it sooner or later

* svn ; only if you use Subversion access

If you want to develop something you'll need:

* python ; for the regression tests

* gdb ; the gnu debugger, together with the nice GUI "insight"

* openssh ; to access the CF or commit changes

* autoconf and autoconf-devel ; if you want to fight 
  with 'configure', don't use autoconf-stable!

rxvt is a nice console with history. Replace in your 
cygwin.bat the line

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -