Re: [LTP] [PATCH V3 1/3] syscalls/utils/compat_16.mk: fix build dependencies

chrubis
2013-09-03T11:06:44Z

Hi!
> But I think that my approach is easier to understand: we explicitly
> define object files targets, make them depend on compat_16.h and also
> mark them as intermediate targets (so make will remove them after linking).
>
> And if we make binaries to depend on compat_16.h gcc treats this header
> file not as a header:
>
> gcc -g -O2 -g -O2 -fno-strict-aliasing -pipe -Wall
> -I/home/stas/ltp/testcases/kernel/include
> -I/home/stas/ltp/testcases/kernel/syscalls/setgroups
> -I/home/stas/ltp/testcases/kernel/syscalls/setgroups/../utils
> -I../../../../include -I../../../../include -L../../../../lib
> setgroups01.c
> /home/stas/ltp/testcases/kernel/syscalls/setgroups/../utils/compat_16.h
> -lltp -o setgroups01
>
> gcc -g -O2 -g -O2 -fno-strict-aliasing -pipe -Wall
> -I/home/stas/ltp/testcases/kernel/include
> -I/home/stas/ltp/testcases/kernel/syscalls/setgroups
> -I/home/stas/ltp/testcases/kernel/syscalls/setgroups/../utils
> -I../../../../include -I../../../../include
> -DTST_USE_COMPAT16_SYSCALL=1 -c -o setgroups01_16.o setgroups01.c
> gcc -L../../../../lib setgroups01_16.o
> /home/stas/ltp/testcases/kernel/syscalls/setgroups/../utils/compat_16.h
> -lltp -o setgroups01_16
>
> It doesn't look nice :)

Ah, it gets to the list of prerequisities and gets apended to the
linking. I Should have noticed this.

I guess that your approach is better.

--
Cyril Hrubis
chrubis@suse.cz

------------------------------------------------------------------------------
Learn the latest--Visual Studio 2012, SharePoint 2013, SQL 2012, more!
Discover the easy way to master current and previous Microsoft technologies
and advance your career. Get an incredible 1,500+ hours of step-by-step
tutorial videos with LearnDevNow. Subscribe today and save!