Skip to main content



      Home
Home » Language IDEs » C / C++ IDE (CDT) » Standard Make C project with subfolders?
Standard Make C project with subfolders? [message #164498] Fri, 24 February 2006 06:15 Go to next message
Eclipse UserFriend
Originally posted by: asd.asd.com

I have made a standard Make C Project. Now I would like this project to
contain a subfolder called "Assignments" which again contains the two
subfolders "assign1" and "assign2".

These two subfolder would contain 2 different sourcefiles each one having
its own unique makefile.

But this seems to be impossible in eclipse CDT 3.0.2. The reason appears
that a Standard Make C Project can only have one makefile associated with
it.

Is there somway to obtain the above filestructure that I described?

Johs
Re: Standard Make C project with subfolders? [message #164516 is a reply to message #164498] Fri, 24 February 2006 06:40 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: ccvural.ttnet.net.tr

Johs32 wrote:
> I have made a standard Make C Project. Now I would like this project to
> contain a subfolder called "Assignments" which again contains the two
> subfolders "assign1" and "assign2".
>
> These two subfolder would contain 2 different sourcefiles each one having
> its own unique makefile.
>
> But this seems to be impossible in eclipse CDT 3.0.2. The reason appears
> that a Standard Make C Project can only have one makefile associated with
> it.
>
> Is there somway to obtain the above filestructure that I described?
>
> Johs

make and makefiles area reentrant.

You can call subfolders' makefiles from your main makefile

Regards

CC Vural
Re: Standard Make C project with subfolders? [message #164524 is a reply to message #164516] Fri, 24 February 2006 06:49 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: asd.asd.com

Cavit Cahit VURAL wrote:

> Johs32 wrote:
>> I have made a standard Make C Project. Now I would like this project to
>> contain a subfolder called "Assignments" which again contains the two
>> subfolders "assign1" and "assign2".
>>
>> These two subfolder would contain 2 different sourcefiles each one having
>> its own unique makefile.
>>
>> But this seems to be impossible in eclipse CDT 3.0.2. The reason appears
>> that a Standard Make C Project can only have one makefile associated with
>> it.
>>
>> Is there somway to obtain the above filestructure that I described?
>>
>> Johs
>
> make and makefiles area reentrant.


> You can call subfolders' makefiles from your main makefile

I have now made a Standard Make C Project called "myproject". In this
project I have made 2 sourcefolders: A,B. I have then put test1.c in A and
test2.c in B (the two test files have nothing to do with each other, they
are totally independant applications).

I have then made a makefile for test1.c and put it in folder A. I have also
made a makefile for test2.c that I have put in B.

Should I make a third makefile and put it in "myproject" where I can call
the two other makefiles from?
Re: Standard Make C project with subfolders? [message #164538 is a reply to message #164524] Fri, 24 February 2006 06:59 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: ccvural.ttnet.net.tr

> Cavit Cahit VURAL wrote:
>
>> Johs32 wrote:
>>> I have made a standard Make C Project. Now I would like this project to
>>> contain a subfolder called "Assignments" which again contains the two
>>> subfolders "assign1" and "assign2".
>>>
>>> These two subfolder would contain 2 different sourcefiles each one having
>>> its own unique makefile.
>>>
>>> But this seems to be impossible in eclipse CDT 3.0.2. The reason appears
>>> that a Standard Make C Project can only have one makefile associated with
>>> it.
>>>
>>> Is there somway to obtain the above filestructure that I described?
>>>
>>> Johs
>> make and makefiles area reentrant.
>
>
>> You can call subfolders' makefiles from your main makefile
>
> I have now made a Standard Make C Project called "myproject". In this
> project I have made 2 sourcefolders: A,B. I have then put test1.c in A and
> test2.c in B (the two test files have nothing to do with each other, they
> are totally independant applications).
>
> I have then made a makefile for test1.c and put it in folder A. I have also
> made a makefile for test2.c that I have put in B.
>
> Should I make a third makefile and put it in "myproject" where I can call
> the two other makefiles from?
>
>

:-) yes

Regards

CC Vural
Re: Standard Make C project with subfolders? [message #164546 is a reply to message #164538] Fri, 24 February 2006 07:16 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: asd.asd.com

Cavit Cahit VURAL wrote:

>> Cavit Cahit VURAL wrote:
>>
>>> Johs32 wrote:
>>>> I have made a standard Make C Project. Now I would like this project to
>>>> contain a subfolder called "Assignments" which again contains the two
>>>> subfolders "assign1" and "assign2".
>>>>
>>>> These two subfolder would contain 2 different sourcefiles each one
>>>> having its own unique makefile.
>>>>
>>>> But this seems to be impossible in eclipse CDT 3.0.2. The reason
>>>> appears that a Standard Make C Project can only have one makefile
>>>> associated with it.
>>>>
>>>> Is there somway to obtain the above filestructure that I described?
>>>>
>>>> Johs
>>> make and makefiles area reentrant.
>>
>>
>>> You can call subfolders' makefiles from your main makefile
>>
>> I have now made a Standard Make C Project called "myproject". In this
>> project I have made 2 sourcefolders: A,B. I have then put test1.c in A
>> and test2.c in B (the two test files have nothing to do with each other,
>> they are totally independant applications).
>>
>> I have then made a makefile for test1.c and put it in folder A. I have
>> also made a makefile for test2.c that I have put in B.
>>
>> Should I make a third makefile and put it in "myproject" where I can call
>> the two other makefiles from?
>>
>>
>
> :-) yes


Ok here is the "main" makefile that I am trying to make:

test1:
make -I A/ test1

test2:
make -I B/ test2

But I just get no makefile found eventhough they are in A and B.
Re: Standard Make C project with subfolders? [message #164554 is a reply to message #164546] Fri, 24 February 2006 07:21 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: ccvural.ttnet.net.tr

> Cavit Cahit VURAL wrote:
>
>>> Cavit Cahit VURAL wrote:
>>>
>>>> Johs32 wrote:
>>>>> I have made a standard Make C Project. Now I would like this project to
>>>>> contain a subfolder called "Assignments" which again contains the two
>>>>> subfolders "assign1" and "assign2".
>>>>>
>>>>> These two subfolder would contain 2 different sourcefiles each one
>>>>> having its own unique makefile.
>>>>>
>>>>> But this seems to be impossible in eclipse CDT 3.0.2. The reason
>>>>> appears that a Standard Make C Project can only have one makefile
>>>>> associated with it.
>>>>>
>>>>> Is there somway to obtain the above filestructure that I described?
>>>>>
>>>>> Johs
>>>> make and makefiles area reentrant.
>>>
>>>> You can call subfolders' makefiles from your main makefile
>>> I have now made a Standard Make C Project called "myproject". In this
>>> project I have made 2 sourcefolders: A,B. I have then put test1.c in A
>>> and test2.c in B (the two test files have nothing to do with each other,
>>> they are totally independant applications).
>>>
>>> I have then made a makefile for test1.c and put it in folder A. I have
>>> also made a makefile for test2.c that I have put in B.
>>>
>>> Should I make a third makefile and put it in "myproject" where I can call
>>> the two other makefiles from?
>>>
>>>
>> :-) yes
>
>
> Ok here is the "main" makefile that I am trying to make:
>
> test1:
> make -I A/ test1
>
> test2:
> make -I B/ test2
>
> But I just get no makefile found eventhough they are in A and B.
>
>

You need to add ,

all : test1 test2

And change test?: as

cd A
make all
cd ..


Regards

CC Vural
Re: Standard Make C project with subfolders? [message #164562 is a reply to message #164554] Fri, 24 February 2006 07:32 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: asd.asd.com

Cavit Cahit VURAL wrote:

>> Cavit Cahit VURAL wrote:
>>
>>>> Cavit Cahit VURAL wrote:
>>>>
>>>>> Johs32 wrote:
>>>>>> I have made a standard Make C Project. Now I would like this project
>>>>>> to contain a subfolder called "Assignments" which again contains the
>>>>>> two subfolders "assign1" and "assign2".
>>>>>>
>>>>>> These two subfolder would contain 2 different sourcefiles each one
>>>>>> having its own unique makefile.
>>>>>>
>>>>>> But this seems to be impossible in eclipse CDT 3.0.2. The reason
>>>>>> appears that a Standard Make C Project can only have one makefile
>>>>>> associated with it.
>>>>>>
>>>>>> Is there somway to obtain the above filestructure that I described?
>>>>>>
>>>>>> Johs
>>>>> make and makefiles area reentrant.
>>>>
>>>>> You can call subfolders' makefiles from your main makefile
>>>> I have now made a Standard Make C Project called "myproject". In this
>>>> project I have made 2 sourcefolders: A,B. I have then put test1.c in A
>>>> and test2.c in B (the two test files have nothing to do with each
>>>> other, they are totally independant applications).
>>>>
>>>> I have then made a makefile for test1.c and put it in folder A. I have
>>>> also made a makefile for test2.c that I have put in B.
>>>>
>>>> Should I make a third makefile and put it in "myproject" where I can
>>>> call the two other makefiles from?
>>>>
>>>>
>>> :-) yes
>>
>>
>> Ok here is the "main" makefile that I am trying to make:
>>
>> test1:
>> make -I A/ test1
>>
>> test2:
>> make -I B/ test2
>>
>> But I just get no makefile found eventhough they are in A and B.
>>
>>
>
> You need to add ,
>
> all : test1 test2
>
> And change test?: as
>
> cd A
> make all
> cd ..
>
>
> Regards
>
> CC Vural


I now have:

all: test1 test2

test1:
cd g1
make all
cd ..

test2:
cd g2
make all
cd ..

in eclipse I have made a "Make Target": "build command": make test1

but when I build it goes on forever with this:

make[4]: *** [test1] Terminated
make[3]: *** [test1] Terminated
make[2]: *** [test1] Terminated
make[1]: *** [test1] Terminated
make: *** [test1] Terminated
Error launching builder (make test1 all )
(Command canceled)


what have I misunderstood?
Re: Standard Make C project with subfolders? [message #164585 is a reply to message #164562] Fri, 24 February 2006 08:18 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: ccvural.ttnet.net.tr

Sorry, my mistake

make auto changes to new diretories, so makefile in `test` diretory must be

all : test1 test2

clean :
make -f test1/makefile clean
make -f test2/makefile clean

test1 :
make -f test1/makefile all

test2 :
make -f test2/makefile all

Regards

CC Vural

> Cavit Cahit VURAL wrote:
>
>>> Cavit Cahit VURAL wrote:
>>>
>>>>> Cavit Cahit VURAL wrote:
>>>>>
>>>>>> Johs32 wrote:
>>>>>>> I have made a standard Make C Project. Now I would like this project
>>>>>>> to contain a subfolder called "Assignments" which again contains the
>>>>>>> two subfolders "assign1" and "assign2".
>>>>>>>
>>>>>>> These two subfolder would contain 2 different sourcefiles each one
>>>>>>> having its own unique makefile.
>>>>>>>
>>>>>>> But this seems to be impossible in eclipse CDT 3.0.2. The reason
>>>>>>> appears that a Standard Make C Project can only have one makefile
>>>>>>> associated with it.
>>>>>>>
>>>>>>> Is there somway to obtain the above filestructure that I described?
>>>>>>>
>>>>>>> Johs
>>>>>> make and makefiles area reentrant.
>>>>>> You can call subfolders' makefiles from your main makefile
>>>>> I have now made a Standard Make C Project called "myproject". In this
>>>>> project I have made 2 sourcefolders: A,B. I have then put test1.c in A
>>>>> and test2.c in B (the two test files have nothing to do with each
>>>>> other, they are totally independant applications).
>>>>>
>>>>> I have then made a makefile for test1.c and put it in folder A. I have
>>>>> also made a makefile for test2.c that I have put in B.
>>>>>
>>>>> Should I make a third makefile and put it in "myproject" where I can
>>>>> call the two other makefiles from?
>>>>>
>>>>>
>>>> :-) yes
>>>
>>> Ok here is the "main" makefile that I am trying to make:
>>>
>>> test1:
>>> make -I A/ test1
>>>
>>> test2:
>>> make -I B/ test2
>>>
>>> But I just get no makefile found eventhough they are in A and B.
>>>
>>>
>> You need to add ,
>>
>> all : test1 test2
>>
>> And change test?: as
>>
>> cd A
>> make all
>> cd ..
>>
>>
>> Regards
>>
>> CC Vural
>
>
> I now have:
>
> all: test1 test2
>
> test1:
> cd g1
> make all
> cd ..
>
> test2:
> cd g2
> make all
> cd ..
>
> in eclipse I have made a "Make Target": "build command": make test1
>
> but when I build it goes on forever with this:
>
> make[4]: *** [test1] Terminated
> make[3]: *** [test1] Terminated
> make[2]: *** [test1] Terminated
> make[1]: *** [test1] Terminated
> make: *** [test1] Terminated
> Error launching builder (make test1 all )
> (Command canceled)
>
>
> what have I misunderstood?
Re: Standard Make C project with subfolders? [message #164602 is a reply to message #164585] Fri, 24 February 2006 08:38 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: asd.asd.com

Cavit Cahit VURAL wrote:

> Sorry, my mistake
>
> make auto changes to new diretories, so makefile in `test` diretory must
> be

What do you mean by 'test' dir, I never mentioned anything about a 'test'
dir?


> all : test1 test2
>
> clean :
> make -f test1/makefile clean
> make -f test2/makefile clean
>
> test1 :
> make -f test1/makefile all
>
> test2 :
> make -f test2/makefile all
>
> Regards


still does not work.
I have these files:

/home/johs/parent/makefile # The main make file

/home/johs/parent/g1/test1.c
/home/johs/parent/g1/makefile

/home/johs/parent/g2/test2.c
/home/johs/parent/g2/makefile

Now I would like to start EITHER the makefile in g2 or g1 with the main make
file. If I would like to start the makefile in g1, I would type:

make test1

from the '/home/johs/parent/' dir.

The content of my main make file is:

all: test1 test2

clean :
make -f g1/makefile clean
make -f g2/makefile clean

test1 :
make -f g1/makefile all

test2 :
make -f g2/makefile all


and the content of the makefile in /home/johs/parent/g1/ is:

CC=gcc
CFLAGS=-g -pthread

all: test1

test: test1.c
$(CC) $(CFLAGS) test1.c -o test1
clean:
rm -rf *o test1


....it seems that calling another makefile in another dir with a makefile is
not the best way to make it work.
Re: Standard Make C project with subfolders? [message #164610 is a reply to message #164585] Fri, 24 February 2006 08:46 Go to previous message
Eclipse UserFriend
Originally posted by: asd.asd.com

Cavit Cahit VURAL wrote:

> Sorry, my mistake
>
> make auto changes to new diretories, so makefile in `test` diretory must
> be
>
> all : test1 test2
>
> clean :
> make -f test1/makefile clean
> make -f test2/makefile clean
>
> test1 :
> make -f test1/makefile all
>
> test2 :
> make -f test2/makefile all
>
> Regards
>
> CC Vural
>
>> Cavit Cahit VURAL wrote:
>>
>>>> Cavit Cahit VURAL wrote:
>>>>
>>>>>> Cavit Cahit VURAL wrote:
>>>>>>
>>>>>>> Johs32 wrote:
>>>>>>>> I have made a standard Make C Project. Now I would like this
>>>>>>>> project to contain a subfolder called "Assignments" which again
>>>>>>>> contains the two subfolders "assign1" and "assign2".
>>>>>>>>
>>>>>>>> These two subfolder would contain 2 different sourcefiles each one
>>>>>>>> having its own unique makefile.
>>>>>>>>
>>>>>>>> But this seems to be impossible in eclipse CDT 3.0.2. The reason
>>>>>>>> appears that a Standard Make C Project can only have one makefile
>>>>>>>> associated with it.
>>>>>>>>
>>>>>>>> Is there somway to obtain the above filestructure that I described?
>>>>>>>>
>>>>>>>> Johs
>>>>>>> make and makefiles area reentrant.
>>>>>>> You can call subfolders' makefiles from your main makefile
>>>>>> I have now made a Standard Make C Project called "myproject". In this
>>>>>> project I have made 2 sourcefolders: A,B. I have then put test1.c in
>>>>>> A and test2.c in B (the two test files have nothing to do with each
>>>>>> other, they are totally independant applications).
>>>>>>
>>>>>> I have then made a makefile for test1.c and put it in folder A. I
>>>>>> have also made a makefile for test2.c that I have put in B.
>>>>>>
>>>>>> Should I make a third makefile and put it in "myproject" where I can
>>>>>> call the two other makefiles from?
>>>>>>
>>>>>>
>>>>> :-) yes
>>>>
>>>> Ok here is the "main" makefile that I am trying to make:
>>>>
>>>> test1:
>>>> make -I A/ test1
>>>>
>>>> test2:
>>>> make -I B/ test2
>>>>
>>>> But I just get no makefile found eventhough they are in A and B.
>>>>
>>>>
>>> You need to add ,
>>>
>>> all : test1 test2
>>>
>>> And change test?: as
>>>
>>> cd A
>>> make all
>>> cd ..
>>>
>>>
>>> Regards
>>>
>>> CC Vural
>>
>>
>> I now have:
>>
>> all: test1 test2
>>
>> test1:
>> cd g1
>> make all
>> cd ..
>>
>> test2:
>> cd g2
>> make all
>> cd ..
>>
>> in eclipse I have made a "Make Target": "build command": make test1
>>
>> but when I build it goes on forever with this:
>>
>> make[4]: *** [test1] Terminated
>> make[3]: *** [test1] Terminated
>> make[2]: *** [test1] Terminated
>> make[1]: *** [test1] Terminated
>> make: *** [test1] Terminated
>> Error launching builder (make test1 all )
>> (Command canceled)
>>
>>
>> what have I misunderstood?


This works:

all: test1 test2

test1 :
cd g1 && $(MAKE) test1

test2 :
cd g2 && $(MAKE) test2
Previous Topic:Slow content assist with qt
Next Topic:How to set environment variables when building?
Goto Forum:
  


Current Time: Sat Jul 12 20:04:42 EDT 2025

Powered by FUDForum. Page generated in 0.05310 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top