@@ -4,31 +4,37 @@ REM ----------------------------------------------------
44REM Batch file to build all runtime libraries
55REM
66REM (c) Zilog, Inc.
7- REM Modified by Matt Waltz for CE support
7+ REM Modified by Matt "MateoConLechuga" Waltz for CE support
88REM ----------------------------------------------------
99
1010REM +--Setting environment variables-------------------+
11+
12+ set SRC = .
1113set BIN = %CEDEV% \bin
1214set INC = %CEDEV% \include
1315set LIBPATH = %CEDEV% \lib
14- set SRC = .
16+ set SHARED_PATH = std\shared
17+ set STATIC_PATH = std\static
18+ set LINKED_PATH = std\linked
19+ set CE_PATH = ce
1520
1621set ASM = %BIN% \ez80asm.exe
1722set CC = %BIN% \eZ80cc.exe
1823set LIB = %BIN% \ez80lib.exe
1924
20- set RTL_C_SRC = bsearch.c maptab.c modf.c qsort.c strtod.c strtol.c strtoul.c ufltinfo.c ufltrnd.c ureverse.c
21- set RTL_ST_C_SRC = uitoa.c ultoa.c ustoa.c uuitoa.c uultoa.c uustoa.c vsprintf.c
25+ REM -- Static and linked hold the same file names --
2226
23- set RTL_NOKERNEL_C_SRC = free .c malloc .c realloc .c
24- set RTL_ASM_SRC = atoi .asm atol .asm atos .asm abs .asm calloc .asm isalnum.asm isalpha.asm iscntrl.asm isdigit.asm isgraph.asm islower.asm isprint.asm ispunct.asm isspace.asm isupper.asm isxdigit.asm isascii.asm labs.asm sprintf.asm strtok.asm longjmp.asm memchr.asm memcmp.asm memcpy.asm memmove.asm memset.asm sbrk.asm setjmp.asm strcat.asm strchr.asm strcmp.asm strcpy.asm strcspn.asm strlen.asm strncat.asm strncmp.asm strncpy.asm strpbrk.asm strrchr.asm strspn.asm strstr.asm div.asm ldiv.asm tolower.asm toupper.asm strncasecmp.asm srand.asm rand.asm strdup .asm
27+ set RTL_STATIC_C_SRC = asin .c atan .c atan2.c exp.c floor.c fmod.c frexp.c ldexp.c log.c log10.c modf.c pow.c sin.c sinh.c sqrt.c strtod.c tan.c tanh.c ufltinfo.c ufltrnd .c
28+ set RTL_STATIC_ASM_SRC = acos .asm atof .asm ceil .asm cos .asm fabs .asm isalnum.asm isalpha.asm iscntrl.asm isdigit.asm isgraph.asm islower.asm isprint.asm ispunct.asm isspace.asm isupper.asm isxdigit.asm
2529
26- set HLP_C_SRC =
27- set HLP_ASM_SRC=bdivs.asm bdivu.asm bldix.asm bldiy.asm bmuls.asm brems.asm bremu.asm bshl.asm bshrs.asm bshru.asm bstix.asm bstiy.asm case.asm iand.asm idivs.asm idivu.asm ildix.asm ildiy.asm imulu.asm indcall.asm ineg.asm inot.asm ior.asm irems.asm iremu.asm ishl.asm ishrs.asm ishru.asm istix.asm istiy.asm itol.asm ixor.asm ladd.asm land.asm lcmpu.asm lcmps.asm ldivs.asm ldivu.asm lldix.asm lldiy.asm lmulu.asm lmuls.asm lneg.asm lnot.asm lor.asm lrems.asm lremu.asm lshl.asm lshrs.asm lshru.asm lstix.asm lstiy.asm lsub.asm lxor.asm sand.asm sdivs.asm sdivu.asm sldix.asm sldiy.asm smulu.asm sneg.asm snot.asm sor.asm srems.asm sremu.asm sshl.asm sshrs.asm sshru.asm sstix.asm sstiy.asm stoi.asm stoiu.asm sxor.asm frbmuls.asm frbtof.asm frftob.asm frftoi.asm frftos.asm frftoub.asm frftoui.asm frftous.asm frimuls.asm frimulu.asm fritof.asm frsmuls.asm frsmulu.asm frstof.asm frubtof.asm fruitof.asm frustof.asm frameset0.asm frameset.asm setflag.asm scmpzero.asm icmpzero.asm lcmpzero.asm seqcase.asm seqcaseD.asm case24.asm case24D.asm case16.asm case16D.asm case8.asm case8D.asm
30+ set RTL_LINKED_C_SRC =
31+ set RTL_LINKED_ASM_SRC = acos.asm asin.asm atan.asm atan2.asm atof.asm ceil.asm cos.asm cosh.asm exp.asm fabs.asm floor.asm fmod.asm frexp.asm isalnum.asm isalpha.asm iscntrl.asm isdigit.asm isgraph.asm islower.asm isprint.asm ispunct.asm isspace.asm isupper.asm isxdigit.asm ldexp.asm log.asm log10.asm modf.asm pow.asm sin.asm sinh.asm sqrt.asm strtod.asm tan.asm tanh.asm ufltinfo.asm ufltrnd.asm
32+
33+ set RTL_SHARED_C_SRC = bsearch.c fpdata.c free.c gamma.c malloc.c maptab.c qsort.c realloc.c strtol.c strtoul.c udtoe.c udtof.c udtog.c uitoa.c ultoa.c ureverse.c ustoa.c uuitoa.c uultoa.c uustoa.c vsprintf.c
34+ set RTL_SHARED_ASM_SRC = abs.asm atoi.asm atol.asm atos.asm calloc.asm div.asm finite.asm fpadd.asm fpcmp.asm fpdiv.asm fpftol.asm fpltof.asm fpmul.asm fpneg.asm fppack.asm fpsub.asm fpultof.asm fpupop1.asm fpupop2.asm isascii.asm isinf.asm isnan.asm longjmp.asm memchr.asm memcmp.asm memcpy.asm memmove.asm memset.asm rand.asm sbrk.asm setjmp.asm sprintf.asm sqrtf.asm srand.asm stoi.asm strcasecmp.asm strcat.asm strchr.asm strcmp.asm strcpy.asm strcspn.asm strdup.asm strlen.asm strncasecmp.asm strncat.asm strncmp.asm strncpy.asm strpbrk.asm strrchr.asm strspn.asm strstr.asm strtok.asm tolower.asm toupper.asm uldiv.asm
2835
29- set FP_C_SRC = asin.c atan.c atan2.c exp.c floor.c fmod.c fpdata.c frexp.c ldexp.c log.c log10.c modf.c pow.c sin.c sinh.c sqrt.c tan.c tanh.c gamma.c udtoe.c
30- set FP_ST_C_SRC = udtof.c udtog.c
31- set FP_ASM_SRC = acos.asm atof.asm ceil.asm cos.asm fabs.asm finite.asm fpadd.asm fpcmp.asm fpdiv.asm fpftol.asm fpltof.asm fpmul.asm fpneg.asm fppack.asm fpsub.asm fpultof.asm fpupop1.asm fpupop2.asm sqrtf.asm isnan.asm isinf.asm
36+ set HLP_C_SRC =
37+ set HLP_ASM_SRC=bdivs.asm bdivu.asm bldix.asm bldiy.asm bmuls.asm brems.asm bremu.asm bshl.asm bshrs.asm bshru.asm bstix.asm bstiy.asm case.asm case24.asm case24D.asm case16.asm case16D.asm case8.asm case8D.asm iand.asm idivs.asm idivu.asm ildix.asm ildiy.asm imulu.asm imuls.asm indcall.asm ineg.asm inot.asm ior.asm irems.asm iremu.asm ishl.asm ishrs.asm ishru.asm istix.asm istiy.asm itol.asm ixor.asm ladd.asm land.asm lcmpu.asm lcmps.asm ldivs.asm ldivu.asm lldix.asm lldiy.asm lmulu.asm lmuls.asm lneg.asm lnot.asm lor.asm lrems.asm lremu.asm lshl.asm lshrs.asm lshru.asm lstix.asm lstiy.asm lsub.asm lxor.asm sand.asm sdivs.asm sdivu.asm sldix.asm sldiy.asm smulu.asm sneg.asm snot.asm sor.asm srems.asm sremu.asm sshl.asm sshrs.asm sshru.asm sstix.asm sstiy.asm stoi.asm stoiu.asm sxor.asm frbmuls.asm frbtof.asm frftob.asm frftoi.asm frftos.asm frftoub.asm frftoui.asm frftous.asm frimuls.asm frimulu.asm fritof.asm frsmuls.asm frsmulu.asm frstof.asm frubtof.asm fruitof.asm frustof.asm frameset0.asm frameset.asm setflag.asm scmpzero.asm icmpzero.asm lcmpzero.asm seqcase.asm seqcaseD.asm
3238
3339set DEBUG_C_SRC =
3440set DEBUG_ASM_SRC = debugger.asm removeallbreakpoints.asm removeallwatchpoints.asm removebreakpoint.asm removewatchpoint.asm setbreakpoint.asm setreadwatchpoint.asm setwritewatchpoint.asm setreadwritewatchpoint.asm setwatchpoint.asm
@@ -38,7 +44,7 @@ set TICE_ASM_SRC=tice.asm memset_fast.asm prgmcleanup.asm abort.asm os.asm
3844set CPU = EZ80F91
3945set STDINC = %INC% \lib\std
4046set CEINC = %CEDEV% \include\lib\ce
41- set ZLGINC = %SRC% \std_include
47+ set ZLGINC = %SRC% \include
4248set CFLG_REL = -NOdebug -optsize -NOkeeplst -promote -quiet -fplib
4349set AFLG = -genobj -NOigcase -include:%STDINC% -include:%ZLGINC% -NOlist -NOlistmac -pagelen:56 -pagewidth:100 -quiet -sdiopt -warn -NOzmasm
4450
@@ -49,60 +55,47 @@ mkdir %LIBPATH%\std\ce
4955
5056REM --- CE Libraries
5157
52- echo --Building CE Debugger library...
58+ set C_FLG = %CFLG_REL% -cpu:%CPU% -asmsw:" -cpu:%CPU% -include:%STDINC% -include:%ZLGINC% " -define:_%CPU%
59+ set ASM_FLG = %AFLG% -cpu:%CPU% -NOdebug
60+
61+ echo -- Building CE Debugger library...
62+ set MY_PATH = %CE_PATH%
5363set C_SRC = %DEBUG_C_SRC%
5464set ASM_SRC = %DEBUG_ASM_SRC%
55- set C_FLG = %CFLG_DBG% -cpu:%CPU% -asmsw:" -cpu:%CPU% -include:%STDINC% -include:%ZLGINC% " -define:_%CPU%
56- set ASM_FLG = %AFLG% -cpu:%CPU% -debug -include:%CEINC%
57- call buildcelib.bat cdebug.lib
65+ call buildlib.bat cdebug.lib
5866
59- echo --Building TICE library...
67+ echo -- Building TICE library...
68+ set MY_PATH = %CE_PATH%
6069set C_SRC = %TICE_C_SRC%
6170set ASM_SRC = %TICE_ASM_SRC%
62- set C_FLG = %CFLG_DBG% -cpu:%CPU% -asmsw:" -cpu:%CPU% -include:%STDINC% -include:%ZLGINC% " -define:_%CPU%
63- set ASM_FLG = %AFLG% -cpu:%CPU% -debug -include:%CEINC%
64- call buildcelib.bat ctice.lib
65-
66- echo --Building RTL libraries...
67- set C_SRC = %RTL_C_SRC%
68- set ASM_SRC = %RTL_ASM_SRC%
69- set C_FLG = %CFLG_REL% -cpu:%CPU% -asmsw:" -cpu:%CPU% -include:%STDINC% -include:%ZLGINC% " -define:_%CPU%
70- set ASM_FLG = %AFLG% -cpu:%CPU% -NOdebug
71- call buildstdlib.bat crt.lib
71+ call buildlib.bat ctice.lib
7272
73- set C_SRC = %RTL_ST_C_SRC%
74- set ASM_SRC =
75- set C_FLG = %CFLG_REL% -cpu:%CPU% -asmsw:" -cpu:%CPU% -include:%STDINC% -include:%ZLGINC% " -define:_%CPU%
76- set ASM_FLG = %AFLG% -cpu:%CPU% -NOdebug
77- call buildstdlib.bat crtS.lib
78-
79- set C_SRC = %RTL_NOKERNEL_C_SRC%
80- set ASM_SRC =
81- set C_FLG = %CFLG_REL% -cpu:%CPU% -asmsw:" -cpu:%CPU% -include:%STDINC% -include:%ZLGINC% " -define:_%CPU%
82- set ASM_FLG = %AFLG% -cpu:%CPU% -NOdebug
83- call buildstdlib.bat nokernel.lib
84-
85- echo --Building CHLP libraries...
73+ echo -- Building CHLP libraries...
74+ set MY_PATH = %SHARED_PATH%
8675set C_SRC = %HLP_C_SRC%
8776set ASM_SRC = %HLP_ASM_SRC%
88- set C_FLG = %CFLG_REL% -cpu:%CPU% -asmsw:" -cpu:%CPU% -include:%STDINC% -include:%ZLGINC% "
89- set ASM_FLG = %AFLG% -cpu:%CPU% -NOdebug
90- call buildstdlib.bat chelp.lib
77+ call buildlib.bat chelp.lib
9178
92- echo --Building FPLIB libraries...
93- set C_SRC = %FP_C_SRC%
94- set ASM_SRC = %FP_ASM_SRC%
95- set C_FLG = %CFLG_REL% -cpu:%CPU% -asmsw:" -cpu:%CPU% -include:%STDINC% -include:%ZLGINC% "
96- set ASM_FLG = %AFLG% -cpu:%CPU% -NOdebug
97- call buildstdlib.bat fplib.lib
79+ echo -- Building RTL...
80+ set MY_PATH = %SHARED_PATH%
81+ set C_SRC = %RTL_SHARED_C_SRC%
82+ set ASM_SRC = %RTL_SHARED_ASM_SRC%
83+ call buildlib.bat crt.lib
9884
99- set C_SRC = %FP_ST_C_SRC%
100- set ASM_SRC =
101- set C_FLG = %CFLG_REL% -cpu:%CPU% -asmsw:" -cpu:%CPU% -include:%STDINC% -include:%ZLGINC% "
102- set ASM_FLG = %AFLG% -cpu:%CPU% -NOdebug
103- call buildstdlib.bat fplibS.lib
85+ echo -- Building RT Linked Library Portion...
86+ set MY_PATH = %LINKED_PATH%
87+ set C_SRC = %RTL_LINKED_C_SRC%
88+ set ASM_SRC = %RTL_LINKED_ASM_SRC%
89+ call buildlib.bat crt_linked.lib
90+
91+ echo -- Building RT Static Library Portion...
92+ set MY_PATH = %STATIC_PATH%
93+ set C_SRC = %RTL_STATIC_C_SRC%
94+ set ASM_SRC = %RTL_STATIC_ASM_SRC%
95+ call buildlib.bat crt_static.lib
96+
97+ echo -- Copying the libraries...
10498
105- echo --Copying the libraries...
10699REM -- copy the libraries --
107100copy /Y *.lib %LIBPATH% \std
108101move /Y %LIBPATH% \std\ctice.lib %LIBPATH% \std\ce\ctice.lib
0 commit comments