Skip to content

Commit

Permalink
doc updates
Browse files Browse the repository at this point in the history
  • Loading branch information
Walter Bright committed Aug 8, 2010
1 parent f579c9e commit 3efaa4b
Show file tree
Hide file tree
Showing 7 changed files with 131 additions and 43 deletions.
141 changes: 108 additions & 33 deletions dcompiler.dd
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Ddoc

$(D_S dmd - $(WINDOWS Windows)$(LINUX Linux)$(OSX Mac OSX)$(FREEBSD FreeBSD) D Compiler,
$(D_S dmd - $(WINDOWS Windows)$(LINUX Linux)$(OSX Mac OS X)$(FREEBSD FreeBSD) D Compiler,

$(UL
$(WINDOWS $(LI dmd for $(LINK2 dmd-linux.html, Linux)))
Expand All @@ -23,11 +23,13 @@ $(D_S dmd - $(WINDOWS Windows)$(LINUX Linux)$(OSX Mac OSX)$(FREEBSD FreeBSD) D C
$(LI $(LINK2 #linking, Linking))
$(LI $(LINK2 #environment, Environment Variables))
$(WINDOWS $(LI $(LINK2 #sc_ini, sc.ini Initialization File)))
$(UNIX $(LI $(LINK2 #dmd_conf, dmd.conf Initialization File)))
$(UNIX $(LI $(DMD_CONF) Initialization File))
$(WINDOWS $(LI $(LINK2 #problems, Common Installation Problems)))
$(LI $(LINK2 #differences, Differences between Windows and Linux versions))
$(LI $(LINK2 #interface_files, D Interface Files))
$(LI $(LINK2 #library, Building Libraries))
$(LI $(LINK2 #compiling_dmd, Compiling dmd))
$(LI $(LINK2 #compiling_phobos, Compiling Phobos))
)

<h2>$(LNAME2 requirements, Requirements and Downloads)</h2>
Expand Down Expand Up @@ -102,19 +104,19 @@ $(D_S dmd - $(WINDOWS Windows)$(LINUX Linux)$(OSX Mac OSX)$(FREEBSD FreeBSD) D C
$(DD D compiler executable)
)

$(DT $(TT $(DMDDIR)/linux/bin/$(LINK2 http://www.digitalmars.com/ctg/dumpobj.html, dumpobj))
$(DT $(TT $(DMDDIR)/linux/bin/$(DUMPOBJ))
$(DD Elf file dumper)
)

$(DT $(TT $(DMDDIR)/linux/bin/$(LINK2 http://www.digitalmars.com/ctg/obj2asm.html, obj2asm))
$(DT $(TT $(DMDDIR)/linux/bin/$(OBJ2ASM))
$(DD Elf file disassembler)
)

$(DT $(TT $(DMDDIR)/linux/bin/$(LINK2 http://www.digitalmars.com/ctg/shell.html, shell))
$(DT $(TT $(DMDDIR)/linux/bin/$(SHELL))
$(DD Simple command line shell)
)

$(DT $(TT $(DMDDIR)/linux/bin/dmd.conf)
$(DT $(TT $(DMDDIR)/linux/bin/$(DMD_CONF))
$(DD Global compiler settings (copy to $(TT /etc/dmd.conf)))
)

Expand All @@ -127,19 +129,19 @@ $(D_S dmd - $(WINDOWS Windows)$(LINUX Linux)$(OSX Mac OSX)$(FREEBSD FreeBSD) D C
$(DD D compiler executable)
)

$(DT $(TT $(DMDDIR)/freebsd/bin/$(LINK2 http://www.digitalmars.com/ctg/dumpobj.html, dumpobj))
$(DT $(TT $(DMDDIR)/freebsd/bin/$(DUMPOBJ))
$(DD Elf file dumper)
)

$(DT $(TT $(DMDDIR)/freebsd/bin/$(LINK2 http://www.digitalmars.com/ctg/obj2asm.html, obj2asm))
$(DT $(TT $(DMDDIR)/freebsd/bin/$(OBJ2ASM))
$(DD Elf file disassembler)
)

$(DT $(TT $(DMDDIR)/freebsd/bin/$(LINK2 http://www.digitalmars.com/ctg/shell.html, shell))
$(DT $(TT $(DMDDIR)/freebsd/bin/$(SHELL))
$(DD Simple command line shell)
)

$(DT $(TT $(DMDDIR)/freebsd/bin/dmd.conf)
$(DT $(TT $(DMDDIR)/freebsd/bin/$(DMD_CONF))
$(DD Global compiler settings (copy to $(TT /etc/dmd.conf)))
)

Expand All @@ -152,19 +154,19 @@ $(D_S dmd - $(WINDOWS Windows)$(LINUX Linux)$(OSX Mac OSX)$(FREEBSD FreeBSD) D C
$(DD D compiler executable)
)

$(DT $(TT $(DMDDIR)/osx/bin/$(LINK2 http://www.digitalmars.com/ctg/dumpobj.html, dumpobj))
$(DT $(TT $(DMDDIR)/osx/bin/$(DUMPOBJ))
$(DD Mach-O file dumper)
)

$(DT $(TT $(DMDDIR)/osx/bin/$(LINK2 http://www.digitalmars.com/ctg/obj2asm.html, obj2asm))
$(DT $(TT $(DMDDIR)/osx/bin/$(OBJ2ASM))
$(DD Mach-O file disassembler)
)

$(DT $(TT $(DMDDIR)/osx/bin/$(LINK2 http://www.digitalmars.com/ctg/shell.html, shell))
$(DT $(TT $(DMDDIR)/osx/bin/$(SHELL))
$(DD Simple command line shell)
)

$(DT $(TT $(DMDDIR)/osx/bin/dmd.conf)
$(DT $(TT $(DMDDIR)/osx/bin/$(DMD_CONF))
$(DD Global compiler settings (copy to $(TT /etc/dmd.conf)))
)

Expand Down Expand Up @@ -205,17 +207,17 @@ C:\&gt;unzip dmc.zip
All the tools are command line tools, which means
they are run from a console window.)

$(LI Copy $(TT dmd.conf) to $(TT /etc):
$(LI Copy $(TT $(DMD_CONF)) to $(TT /etc):

$(CONSOLE
cp $(DMDDIR)/linux/bin/dmd.conf /etc
cp $(DMDDIR)/linux/bin/$(DMD_CONF) /etc
)
)

$(LI Give execute permission to the following files:

$(CONSOLE
chmod u+x $(DMDDIR)/linux/bin/{dmd,dumpobj,obj2asm,rdmd}
chmod u+x $(DMDDIR)/linux/bin/{dmd,$(DUMPOBJ),$(OBJ2ASM),rdmd}
)
)

Expand All @@ -237,7 +239,7 @@ cp $(DMDDIR)/linux/lib/$(LIB) /usr/lib
All the tools are command line tools, which means
they are run from a console window.)

$(LI Copy $(TT dmd.conf) to $(TT /etc):
$(LI Copy $(TT $(DMD_CONF)) to $(TT /etc):

$(CONSOLE
cp $(DMDDIR)/freebsd/bin/dmd.conf /etc
Expand All @@ -247,7 +249,7 @@ cp $(DMDDIR)/freebsd/bin/dmd.conf /etc
$(LI Give execute permission to the following files:

$(CONSOLE
chmod u+x $(DMDDIR)/freebsd/bin/{dmd,dumpobj,obj2asm,rdmd}
chmod u+x $(DMDDIR)/freebsd/bin/{dmd,$(DUMPOBJ),$(OBJ2ASM),rdmd}
)
)

Expand All @@ -263,29 +265,57 @@ cp $(DMDDIR)/freebsd/lib/$(LIB) /usr/lib
)
)
$(OSX
$(LI Unzip the archive into your home directory.
It will create
$(LI Put the dmd zip file into your home directory,
and unzip it:

$(CONSOLE
unzip dmd.$(I VERSION).zip
)
where $(I VERSION) is the particular version of the zip file.
)

$(LI It will create
a $(TT ~/$(DMDDIR)) directory with all the files in it.
All the tools are command line tools, which means
they are run from a console window.)

$(LI Copy $(TT dmd.conf) to $(TT /etc):
$(LI Give execute permission to the binaries:

$(CONSOLE
sudo cp $(DMDDIR)/osx/bin/dmd.conf /etc
chmod u+x $(DMDDIR)/osx/bin/{dmd,$(DUMPOBJ),$(OBJ2ASM),$(SHELL)$(V2 ,rdmd)}
)
)

$(LI Give execute permission to the following files:
$(LI Verify that this works by creating $(TT hello.d) in your home directory
with these contents:
---
import std.stdio;

void main() {
writeln("hello world!");
}
---
and compile and run it with:
$(CONSOLE
chmod u+x $(DMDDIR)/osx/bin/{dmd,dumpobj,obj2asm,shell}
$(DMDDIR)/osx/bin/dmd hello
./hello
)
and it should print:
$(CONSOLE
hello world!
)
)

$(LI Put $(TT $(DMDDIR)/osx/bin) on your $(B PATH),
or copy the OSX executables
to $(TT /usr/local/bin))
$(LI To install a global copy:)

$(LI Copy binaries to $(TT /usr/local/bin):

$(CONSOLE
sudo cp $(DMDDIR)/osx/bin/{dmd,$(DUMPOBJ),$(OBJ2ASM),$(SHELL)$(V2 ,rdmd)} /usr/local/bin
sudo cp $(DMDDIR)/osx/bin/dmdx.conf /usr/local/bin/$(DMD_CONF)
sudo chmod +x /usr/local/bin/{dmd,$(DUMPOBJ),$(OBJ2ASM),$(SHELL)$(V2 ,rdmd)}
)
)

$(LI Copy the library to $(TT /usr/lib):

Expand Down Expand Up @@ -324,16 +354,17 @@ sudo dpkg -i --force-architecture dmd_X.XXX-0_i386.deb

)


$(WINDOWS
<h2>Example</h2>

$(P Run:)

$(CONSOLE
$(DMDDIR)$(SEP)bin$(SEP)shell all.sh
$(DMDDIR)$(SEP)$(OS)$(SEP)bin$(SEP)$(SHELL) all.sh
)

$(P in the $(TT $(DMDDIR)$(SEP)samples$(SEP)d) directory for several small examples.)
)


<h2>$(LNAME2 switches, Compiler Arguments and Switches)</h2>
Expand Down Expand Up @@ -955,7 +986,7 @@ $(WINDOWS
all to be combined into a library $(TT foo.$(LIBEXT)):)

$(OL
$(LI Compile modules separately and then run librarian on them:
$(LI Compile modules separately and then run the librarian on them:
$(WINDOWS
$(CONSOLE
dmd -c foo.d
Expand All @@ -976,7 +1007,7 @@ rm foo.o bar.o
This option is typical when using a makefile to avoid compiling
modules that have already been compiled.
)
$(LI Compile modules together and then run librarian on them:
$(LI Compile modules together and then run the librarian on them:
$(WINDOWS
$(CONSOLE
dmd -c foo.d bar.d
Expand Down Expand Up @@ -1005,11 +1036,55 @@ dmd -lib foo.d bar.d abc.$(OBJEXT) def.$(LIBEXT)
)
)

<h2>$(LNAME2 compiling_dmd, Compiling dmd)</h2>

$(P Complete source code is provided to build the compiler.
Follow these steps:)

$(CONSOLE
cd ~/$(DMDDIR)/src/dmd
make -f $(OS).mak
)

<h2>$(LNAME2 compiling_phobos, Compiling Phobos)</h2>

$(P Complete source code is provided to build Phobos, the D runtime library.
Follow these steps:)

$(V1
$(WINDOWS
cd \$(DMDDIR)\src\phobos
make -f $(OS).mak DMD=~\$(DMDDIR)\$(OS)\bin\dmd
)
$(UNIX
$(CONSOLE
cd ~/$(DMDDIR)/src/phobos
make -f $(OS).mak DMD=~/$(DMDDIR)/$(OS)/bin/dmd
)
)
)
$(V2
$(WINDOWS
cd \$(DMDDIR)\src\druntime
make -f $(OS).mak DMD=~\$(DMDDIR)\$(OS)\bin\dmd
cd ..\phobos
make -f $(OS).mak DMD=~\$(DMDDIR)\$(OS)\bin\dmd
)
$(UNIX
$(CONSOLE
cd ~/$(DMDDIR)/src/druntime
make -f posix.mak DMD=~/$(DMDDIR)/$(OS)/bin/dmd
cd ../phobos
make -f $(OS).mak DMD=~/$(DMDDIR)/$(OS)/bin/dmd
)
)
)

)

Macros:
TITLE=DMD Compiler for $(WINDOWS Windows)$(LINUX Linux)$(OSX OSX)$(FREEBSD FreeBSD)
WIKI=DCompiler
LIB=$(WINDOWS phobos.lib)$(UNIX $(V1 libphobos.a)$(V2 libphobos2.a))
DMD_CONF=$(LINK2 #dmd_conf, dmd.conf)
SWITCH=$(DT $1)$(DD $+)

23 changes: 15 additions & 8 deletions doc.ddoc
Original file line number Diff line number Diff line change
Expand Up @@ -265,6 +265,7 @@ NAVIGATION_D=
<h2>Community</h2>
$(UL
$(TOCENTRYT http://www.prowiki.org/wiki4d/wiki.cgi?FrontPage, Wiki for the D Programming Language, Wiki)
$(TOCENTRYT http://stackoverflow.com/questions/tagged/d, D on stackoverflow.com, Stackoverflow)
$(TOCENTRYT http://twitter.com/#search?q=%23d_lang, #d_lang on twitter.com, Twitter)
$(TOCENTRYT http://www.digitalmars.com/d/dlinks.html, External D related links, Links)
$(TOCENTRYX http://www.digitalmars.com/d/dnews.html, News Digest)
Expand Down Expand Up @@ -321,20 +322,23 @@ SECTION2=<h2>$1</h2>$+
SECTION3=<h3>$1</h3>$+
SECTION4=<h4>$1</h4>$+

NOTRANSLATE=<code>$0</code>
NOTRANSLATE=<span class="notranslate">$0</span>
D_CODE = <pre class="d_code">$(NOTRANSLATE $0)</pre>
D_COMMENT = <span class="d_comment">$0</span>
D_STRING = <span class="d_string">$0</span>
D_KEYWORD = <span class="d_keyword">$0</span>
D_PSYMBOL = <span class="d_psymbol">$0</span>
D_PARAM = <span class="d_param">$0</span>

CODE=<tt>$0</tt>
CCODE=<pre class="ccode">$0</pre>
CPPCODE=<pre class="cppcode">$0</pre>
GRAMMAR=<pre class="bnf">$0</pre>
DDOCCODE=<pre class="ddoccode">$0</pre>
SCINI=<pre class="scini">$0</pre>
CONSOLE=<pre class="console">$0</pre>
MODDEFFILE=<pre class="moddeffile">$0</pre>
CODE=<tt>$(NOTRANSLATE $0)</tt>
CCODE=<pre class="ccode">$(NOTRANSLATE $0)</pre>
CPPCODE=<pre class="cppcode">$(NOTRANSLATE $0)</pre>
GRAMMAR=<pre class="bnf">$(NOTRANSLATE $0)</pre>
DDOCCODE=<pre class="ddoccode">$(NOTRANSLATE $0)</pre>
SCINI=<pre class="scini">$(NOTRANSLATE $0)</pre>
CONSOLE=<pre class="console">$(NOTRANSLATE $0)</pre>
MODDEFFILE=<pre class="moddeffile">$(NOTRANSLATE $0)</pre>

NEWS=http://www.digitalmars.com/drn-bin/wwwnews?$1/$+
NEWS=http://www.digitalmars.com/pnews/read.php?server=news.digitalmars.com&group=$1&artnum=$+
Expand Down Expand Up @@ -374,6 +378,9 @@ DOWNLOADIMG=<img src="download.png" border=0 alt="Download">
WIKIIMG=<img src="wiki.png" border=0 alt="D Wiki">
DIMG=<img src="d.png" border=0 alt="D Programming Language">
NEWSIMG=<img src="http://www.digitalmars.com/news.png" border=0 alt="User Forums">
OBJ2ASM=$(LINK2 http://www.digitalmars.com/ctg/obj2asm.html, obj2asm)
DUMPOBJ=$(LINK2 http://www.digitalmars.com/ctg/dumpobj.html, dumpobj)
SHELL=$(LINK2 http://www.digitalmars.com/ctg/shell.html, shell)
DOLLAR=$

AMAZON= <iframe src="http://rcm.amazon.com/e/cm?t=classicempire&o=1&p=8&l=as1&asins=$0&fc1=000000&IS2=1&lt1=_blank&lc1=0000FF&bc1=000000&bg1=FFFFFF&f=ifr" style="width:120px;height:240px;" scrolling="no" marginwidth="0" marginheight="0" frameborder="0"></iframe>
Expand Down
1 change: 1 addition & 0 deletions freebsd.ddoc
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@

OS=freebsd
WINDOWS=
LINUX=
OSX=
Expand Down
3 changes: 2 additions & 1 deletion linux.ddoc
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@

OS=linux
WINDOWS=
LINUX=$0
OSX=
FREEBSD=
UNIX=$0
SEP=/
OBJEXT=o
Expand Down
2 changes: 1 addition & 1 deletion memory.dd
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ Ddoc

$(D_S Memory Management,

$(P Any non-trivial program needs to allocate and free memory.
$(P Most non-trivial programs needs to allocate and free memory.
Memory management techniques become more and more important as
programs increase in complexity, size, and performance.
D offers many options for managing memory.
Expand Down
2 changes: 2 additions & 0 deletions osx.ddoc
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@

OS=osx
WINDOWS=
LINUX=
OSX=$0
FREEBSD=
UNIX=$0
SEP=/
OBJEXT=o
Expand Down
2 changes: 2 additions & 0 deletions windows.ddoc
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@

OS=windows
WINDOWS=$0
LINUX=
FREEBSD=
SEP=\
OBJEXT=obj
LIBEXT=lib
Expand Down

0 comments on commit 3efaa4b

Please sign in to comment.