Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[cdt-dev] Custom Make Targets


I am a developer on the Wine project, and I decided to see if Eclipse
CDT would be an efficient IDE for me to work with.  I set up a new C
standard make project that pulled in the existing wine source.  The
initial build requires the following operations:

make depend
sudo make install

The make depend command is usually run only once.  In the wine tree,
we have a dlls subdirectory and all the dlls in subdirectories
underneath dlls.  These dlls subdirectories are atomic so the above
three commands work in the same fashion.

I tried to create some Make Targets for a particular dll I was working
on, advpack.  I right-clicked the advpack folder in the C/C++ Projects
tab and selected Create Make Target.  I left the target name as 'all'
and the make target as 'all', but changed the build command to 'make
depend && make && sudo make install'.  I checked the Make Targets tab
and tried to Build Make Target for all.  The make depend ran, but I
got this afterwards:

make depend && make && sudo make install all
cd `dirname tests/__depend__` && make depend
make[1]: Entering directory `/home/truiken/wine/dlls/advpack/tests'
../../../tools/makedep -I. -I. -I../../../include -I../../../include 
-C. advpack.c files.c testlist.c
make[1]: Leaving directory `/home/truiken/wine/dlls/advpack/tests'
../../tools/makedep -I. -I. -I../../include -I../../include  -C.
advpack.c reg.c
make: *** No rule to make target `&&'.  Stop.

My guess is that you can't execute more than one command per target,
so I created three new targets: make depend, make, and sudo make
install.  make depend and make work, but sudo make install doesn't. 
The make target is 'install', and the build command is 'sudo make' . 
This is the output I get from trying to build this target:

Error launching builder (sudo make install )
(Exec error:Cannot run sudo)

If I'm messing up the configuration somehow, please let me know.  What
I'd like to have is two targets: 'all' and 'make && sudo make
install'.  The first would call make depend before calling make and
sudo make install while the second just calls make && sudo make
install.  Another request, if the first is not possible, is to allow
some way to input a password or allow the sudo command to be run first
for install; otherwise, how can I install from eclipse?  The third
option, which would be spectacular to see implemented, is the option
for eclipse to scan the makefiles of a new project with an existing
source root to pull out all the make targets.  That would be much
easier than going through every dll and creating new targets for 160+

Thankyou very much for your time in considering this message.  What
I've seen from eclipse and CDT so far has really impressed me, and I'd
like to make eclipse my permanent IDE.

James Hawkins

Back to the top