compile error

Henrik Brautaset Aronsen henrik.aronsen at gmail.com
Sat Oct 5 10:21:56 UTC 2013


If you had included the space between * and .dep, my instructions would
have worked for you too :)

H
-- 
Sent from my phone
5. okt. 2013 19:07 skrev "Miika Turkia" <miika.turkia at gmail.com> følgende:

> On Sat, Oct 5, 2013 at 7:17 PM, Linus Torvalds <
> torvalds at linux-foundation.org> wrote:
>
>> On Sat, Oct 5, 2013 at 3:02 AM, Cristian Ionescu-Idbohrn
>> <cristian.ionescu-idbohrn at axis.com> wrote:
>> > On Sat, 5 Oct 2013, Cristian Ionescu-Idbohrn wrote:
>> >>
>> >> This may help you get to the bottom:
>> >>
>> >> -%.o: %.cpp $(UIC_HEADERS)
>> >> +%.o: %.cpp $(uicables)
>>
>> Ahh. You should *not* add dependencies to static rules. It might work
>> in some situations, but it's wrong.
>>
>> Even the fixed version is still wrong:
>>
>> > -%.o: %.cpp $(UIC_HEADERS)
>> > +%.o: %.cpp uicables
>>
>> No, just do it as
>>
>>    %.o: %.cpp
>>
>> to declare the fixed rule for how to generate object files from cpp
>> files. No dependencies at that stage at at all.
>>
>> You can make pattern rules be true for just certain patterns, and then
>> the syntax is
>>
>>     file-list: %.o: %.cpp
>>
>> but that is a different thing - that's a restriction on the when the
>> pattern is used (only for file-list), not a dependency.
>>
>> To add dependencies, you need to do it separately. So you could do
>> something like
>>
>>   %.o: %.cpp
>>         pattern-commands
>>
>>    cpp-files := $(wildcard *.cpp)
>>    $(cpp-files): $(UIC_HEADERS)
>>
>> as two different rules: the first one is the pattern that (re-)defines
>> the implicit rule in what make should do, and the second rule makes it
>> clear that all *.cpp files depend on the files listed in UIC_HEADERS.
>>
>> Does that get things working better for you guys?
>>
>
> Yeah, I got my version compiled with such tweak on Rules.mk:
> -%.o: %.cpp $(UIC_HEADERS)
> +%.o: %.cpp
>
> Other part I had to do was due to old generated files. That was solved
> with some heavy cleaning:
> make distclean
> rm -rf *.dep .tx .uic
> find . -name ui_\*.h  -exec rm {} \+
>
> (I had to add the removal of au_*.h files on top of Henrik's clean-up
> instructions on another thread)
>
> miika
>
> _______________________________________________
> subsurface mailing list
> subsurface at hohndel.org
> http://lists.hohndel.org/cgi-bin/mailman/listinfo/subsurface
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.hohndel.org/pipermail/subsurface/attachments/20131005/563eeb8c/attachment-0001.html>


More information about the subsurface mailing list