Afficher un message
Vieux 09/05/2008, 15h04   #16
Bart
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: using a shell script to compile your C programs

On May 9, 8:10am, pereges <Brol...@gmail.com> wrote:
> Do you see anything wrong about this method ? For eg. I write a shell
> script a.sh containing :
>
> cc -o test file1.c file2.c file3.c
>
> and then execute the shell script ( sh a.sh) to compile and create the
> executable. What is the difference between this method and writing a
> make file ?


I find it fairly impossible to use either modern IDEs at one end of
the scale and makefiles at the other.

I use a simple utility, which I suppose could called be called a mini
IDE (to glorify it a little), which is given a project file like the
following (as set up for your program in the other thread):

module test.c
module bbox.c
module common.c
module radar.c
module raydetect.c
module raytrace.c
module raytriangle.c
module reader.c
module reflection.c

file bbox.h
file common.h
file radar.h
file raydetect.h
file raytrace.h
file raytriangle.h
file reader.h
file reflection.h

The utility shows a list of these files/modules and uses cursor keys
to highlight one or the other. Then, you have this extensive list of
commands:

Enter Edit (can use any editor)
C Compile
L Link
R Run
CA Compile all

Plus a few combinations of the above (this is really cutting edge...).

Point: this sort of thing really can be kept fairly simple. Of course
you need to write such an utility first.

If I didn't have this and had to use shell commands only, I'd probably
still end up with something similar by building a set of short,
dedicated .bat files (or whatever they might be called on your system)
that minimises typing.

--
Bartc
  Réponse avec citation
 
Page generated in 0,07777 seconds with 9 queries