-
Notifications
You must be signed in to change notification settings - Fork 38
/
compile.txt
105 lines (85 loc) · 4.18 KB
/
compile.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
Compile notes:
NOTE: Use NASM version 0.98.35 or later!
When building on Windows a native (win32 or win64) version is recommended.
There is a more detailed description located here:
http://freedos.sourceforge.net/freecom/build48.html
1) Setup a compiler: TC++ v1.01 (see www.freedos.org, Links page for a
reference to Borland's museum site), TC 2.01, Borland C++, Open Watcom
(www.openwatcom.org), or ia16-elf-gcc (github.com/tkchia/gcc-ia16).
2) Configure CONFIG.MAK (see below)
3) Configure CONFIG.H (see there)
4) Run BUILD.BAT** or build.sh (cross compilation from Linux or MinGW/MSYS)
(Some newer MAKE variants may require a space between the -f option
and the makefile name. On trouble try to fix BUILD.BAT.)
** BUILD.BAT and build.sh accept to following options:
C> BUILD.BAT [-r] [clean] [no-xms-swap] [debug] [compiler] [language]
-r Rebuilt (clean previous files before proceed)
clean remove *.COM, *.OBJ, *.LIB etc. files, then exit
no-xms-swap create FreeCOM without XMS-Only Swap support
debug enable debug code in FreeCOM
compiler one of wc, tc, tcpp, bc (build.sh: wc or gcc only)
language sets the specified language as the default build language
You will find two executables in the FreeCOM directory:
SHELL\COMMAND.EXE and COMMAND.COM.
The .COM file is the stand-alone application, which includes the
strings etc, whereas COMMAND.EXE is the pure executable without the
strings table for instance.
NOTE: A message like "Fatal: command line too long" was always caused
during my tests by an invalid settings in CONFIG.MAK, esp. CC_BASE_PATH
and NASM!
CONFIG.BAT (copied from CONFIG.B)
This is the central file to tweak options and environment settings
regarding your compiler.
COMPILER
default compiler to use, if none of tc, tcpp, bc, or wc is given.
TC2_BASE
TP1_BASE
BC5_BASE
WATCOM
base paths (aka "root") for Turbo C 2.01, Turbo C++ v1.01, or Borland
C++; usually it is sufficient to modify this macro and all files
(headers and libraries) and programs (C compiler and linker) will be
found. If not, check the macros at the end of the file and/or the
usage of $(LIBPATH) within COMMAND.MAK or STRINGS.MAK respectively.
For Open Watcom, the WATCOM environment variable can be adjusted, if
it is not already set.
Update XNASM as needed, if "nasm" is not in your PATH.
CONFIG.MAK (copied from CONFIG.STD)
This is the central file to tweak other options and environment settings.
SUPPL_INC_PATH / SUPPL_LIB_PATH
To compile this version of command.com, you have to add the SUPPL library.
SUPPL_INC_PATH points to the directory with all the header files, whereas
SUPPL_LIB_PATH contains the pre-compiled library (SUPPL_S.LIB). Due to
popular demand, a variant of SUPPL is integrated into the FreeCOM release
and both settings are pre-configured so that the BUILD.BAT script will
pick up the library automatically. Note: See the SUPPL\README.TXT file,
if you wish to NOT use the integrated SUPPL variant.
Update NASMFLAGS as needed.
SHELL_MMODEL
is the memory model used to compile the shell. It should be Small (s),
unless you want to include debugging support; use Large (l) in such case.
$(CFG): $(CFG_DEPENDENCIES) ../config.mak
This rule is used to create the default option file for the compiler.
It should set the header and library search paths and the memory
model, disable floating
point arithmetics (as it is not used by FreeCOM). The default char
type should be unsigned. There are no known specific alignment
or optimization settings, configure as you wish.
===
[this step is optional, recommended to just use included mini SUPPL library]
To compile the SUPPL library as well do this:
+ download the source code from where SUPPL\README.TXT points to
+ use one of the COMPILER\* preparations -or-
: DEL cfg*.*
: DEL STRBOOL*.*
: DEL t.c
: CALL MKDYNSRC.BAT
: compile all remaining *.c files
: check if it is necessary to meddle with any of the assembly files
and compile them if needed
: archive all created object files -- usually named .OBJ or .O --
into a library named SUPPL_#, where # is S for Small memory
model or L for Large.
+ copy all the INCLUDE\*.H files and the library from the SUPPL release
into FREECOM\SUPPL -or-
update CONFIG.MAK to let SUPPL_???_PATH point to the SUPPL directory