Re: [Freedos-kernel] Cross compilation from Linux

2009-05-21 Thread Eric Auer

Hi Bart :-)

 Jim reinstated SVN write access so I committed a patch that I have
 used internally in a not so clean fashion for a long time:
 cross-compiling from Linux using Open Watcom. The reason why: well it
 is more convenient and quicker (less than 2 vs. 20+ seconds here) to
 cross-compile than fire up DOSEMU or another VM and do the compilation
 there.
 
 I hope it is useful to some others and also clean enough: mostly DOS
 understands / fine but some commands in makefiles need to use
 $(DIRSEP) to get either \ or /.
 
 The batch files obviously can't be used but the top level makefile can
 do the trick using make all, make clean, and make clobber.

Interesting :-) How does it work (in other words, what was the
trick to make it possible) and how do the config bat settings
work in this context? :-)

Eric



--
Register Now for Creativity and Technology (CaT), June 3rd, NYC. CaT
is a gathering of tech-side developers  brand creativity professionals. Meet
the minds behind Google Creative Lab, Visual Complexity, Processing,  
iPhoneDevCamp asthey present alongside digital heavyweights like Barbarian
Group, R/GA,  Big Spaceship. http://www.creativitycat.com 
___
Freedos-kernel mailing list
Freedos-kernel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/freedos-kernel


Re: [Freedos-kernel] Cross compilation from Linux

2009-05-21 Thread Bart Oldeman
Hi Eric,

 Interesting :-) How does it work (in other words, what was the
 trick to make it possible) and how do the config bat settings
 work in this context? :-)

Can you be more specific?  Did you look at the svn diff at all?

Bart

--
Register Now for Creativity and Technology (CaT), June 3rd, NYC. CaT
is a gathering of tech-side developers  brand creativity professionals. Meet
the minds behind Google Creative Lab, Visual Complexity, Processing,  
iPhoneDevCamp asthey present alongside digital heavyweights like Barbarian
Group, R/GA,  Big Spaceship. http://www.creativitycat.com 
___
Freedos-kernel mailing list
Freedos-kernel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/freedos-kernel


Re: [Freedos-kernel] Cross compilation from Linux

2009-05-21 Thread Eric Auer

Hi Bart,

 Can you be more specific?  Did you look at the svn diff at all?

That is the point...

svn diff -r1386:1388

gives a diff of 14 kilobytes, 12 files modified,
46 lines changed, 170 lines added. Quite a lot.

Okay okay I can analyze the patch myself... :-( Some explanations
from the author would have saved some time here, of course ;-).

- segs.inc: ifdef owlinux then define WATCOM

- kernel makefile: make DIRSEP a variable instead of using backslash
- k. makefile: various target names: use slashes instead of backslash?
- kernel makefile: replace copy command name by a CP variable
- kernel makefile: remove ECHOTO target

- build.txt: add section about Linux (config.mak is Linux config bat?)

- watcom.mak: use DIRSEP in C flags instead of using backslash

- generic.mak: define DIRSEP RM CP ECHOTO CLDEF
- generic.mak: use slashes instead of backslash for includes?
- generic.mak: if CLDEF not 0 then do something with CLT CLC?

- owlinux.mak: new file, similar to generic.mak it seems
- owlinux.mak: defines ECHOTO as echo which looks odd...

- exeflat.c: add ' around something in cmdbuf, add trailing NUL

- utils makefile: use DIRSEP, drop use of INCLUDEPATH?
- utils makefile: use CLT CLC instead of CL
- utils makefile: drop TINY, CFLAGSC,CFLAGST?

- config.m: new file for Linux, looks like a config bat
- config.m: is preconfigured for 8086 FAT16, interestingly

- makefile: make the default target only show a help message
- makefile: change all target into build target which does build?
- makefile: add some Linux section and some defaults (and DOS?)
- makefile: rewrite all/clean/clobber targets, big changes?

- drivers makefile: add explicit .obj for LIBOBJS names
- drivers makefile: change backslashes to slashes in deps/targets
- drivers makefile: change backslashes to DIRSEP in RM options

- sys makefile: use DIRSEP in CFLAGS
- sys makefile: use slashes instead of backslashes for deps/targets
- sys makefile: use CP instead of copy
- sys makefile: use slashes instead of backslashes for bin2c options

Are you sure this still works on DOS, even with Turbo C etc? :-)

Eric


--
Register Now for Creativity and Technology (CaT), June 3rd, NYC. CaT
is a gathering of tech-side developers  brand creativity professionals. Meet
the minds behind Google Creative Lab, Visual Complexity, Processing,  
iPhoneDevCamp asthey present alongside digital heavyweights like Barbarian
Group, R/GA,  Big Spaceship. http://www.creativitycat.com 
___
Freedos-kernel mailing list
Freedos-kernel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/freedos-kernel


Re: [Freedos-kernel] Cross compilation from Linux

2009-05-21 Thread Bart Oldeman
2009/5/21 Eric Auer e.a...@jpberlin.de:
 That is the point...

 svn diff -r1386:1388

 gives a diff of 14 kilobytes, 12 files modified,
 46 lines changed, 170 lines added. Quite a lot.

 Okay okay I can analyze the patch myself... :-( Some explanations
 from the author would have saved some time here, of course ;-).

That makes it easier to answer, although you could have researched
many of your question marks yourself too...

Do you think the change is too big? Should it have been cut into more
smaller changes than two?

Or do you require a GNU style changelog like this?
http://gcc.gnu.org/viewcvs/trunk/gcc/ChangeLog?revision=147771view=markup

 k. makefile: various target names: use slashes instead of backslash?

Yes: / in targets works in DOS too.

 - build.txt: add section about Linux (config.mak is Linux config bat?)

Yes. Is that not clear enough? Do you have suggestions to improve the
documentation?

- generic.mak: use slashes instead of backslash for includes?

yes, because generic.mak needs to work on both DOS and Linux.

- generic.mak: if CLDEF not 0 then do something with CLT CLC?

CLT/CLC are used for build utilities, using tiny and compact memory
model. On Linux they are set to use plain gcc, but on DOS special
settings are needed.

 - owlinux.mak: defines ECHOTO as echo which looks odd...

The reason for the existence of ECHOTO is (as briefly stated in
kernel/makefile) that
Turbo C 2.01 make cannot handle redirections. So I wrote a batch file
that appends:
..\utils\echoto.bat file file1.obj file2.obj
instead of writing
echo file1.obj file2.obj  file
in the makefile.

The batch file does not work in Linux obviously but wmake is smart
enough to handle echo .

 - utils makefile: use DIRSEP, drop use of INCLUDEPATH?
 - utils makefile: use CLT CLC instead of CL
 - utils makefile: drop TINY, CFLAGSC,CFLAGST?

they're not dropped, but moved to generic.mak.

 - config.m: is preconfigured for 8086 FAT16, interestingly

It's not strange: I just copied the default from config.b.

 - makefile: change all target into build target which does build?

yes

 - makefile: add some Linux section and some defaults (and DOS?)

Nothing changed for DOS, except that make will give you a message.

 - makefile: rewrite all/clean/clobber targets, big changes?

just additions: this is like build/clobber/clean.bat for Linux, for
DOS this is not used.

 Are you sure this still works on DOS, even with Turbo C etc? :-)

Of course, I tested what I could.

Bart

--
Register Now for Creativity and Technology (CaT), June 3rd, NYC. CaT
is a gathering of tech-side developers  brand creativity professionals. Meet
the minds behind Google Creative Lab, Visual Complexity, Processing,  
iPhoneDevCamp asthey present alongside digital heavyweights like Barbarian
Group, R/GA,  Big Spaceship. http://www.creativitycat.com 
___
Freedos-kernel mailing list
Freedos-kernel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/freedos-kernel


Re: [Freedos-kernel] Cross compilation from Linux

2009-05-21 Thread Bart Oldeman
2009/5/21 Eric Auer e.a...@jpberlin.de:
 Not really - I think it would be tricky to put the config
 variables in something that all used MAKE versions can deal
 with directly, as opposed to having both a BAT and a MAK?

There used to be (a long time ago) both a config.bat and a config.mak
(for DOS!), where config.bat defined the make to use and config.mak
the rest. However it is easier to use just one file.

Problems:
a) On Linux you can assume that make works, on DOS you can't, only
batch files are sure to work.
b) The logic as done in default.bat and config.bat is impossible to do
in portable make; esp. Turbo C 2.01 Make is very basic, and can only
do !if tests on numbers.
c) A recursive make or GNU make calling OW wmake as now done in
the cross-build can make DOS run out of memory (depending on
compiler/command.com/make).

That's why build.bat is used for DOS.

 Okay but echo file file1.obj file2.obj here?
that works too.

Bart

--
Register Now for Creativity and Technology (CaT), June 3rd, NYC. CaT
is a gathering of tech-side developers  brand creativity professionals. Meet
the minds behind Google Creative Lab, Visual Complexity, Processing,  
iPhoneDevCamp asthey present alongside digital heavyweights like Barbarian
Group, R/GA,  Big Spaceship. http://www.creativitycat.com 
___
Freedos-kernel mailing list
Freedos-kernel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/freedos-kernel