[LITMUS^RT] [PATCH 0/2] Add module functionality to liblitmus

Björn Brandenburg bbb at mpi-sws.org
Wed Feb 5 22:21:32 CET 2014


On 05 Feb 2014, at 22:18, Björn Brandenburg <bbb at mpi-sws.org> wrote:

> 
> On 05 Feb 2014, at 18:44, Manohar Vanga <mvanga at mpi-sws.org> wrote:
> 
>> Hey Björn,
>> 
>> I just wanted to point out that this method places certain restrictions on the filenames that you must use for your tasks. If you specify a different output binary name with regard to the source file name, the linker will not get called since that’s how the implicit rules work.
>> 
>> eg. if you’re compiling a binary called ‘example’ consisting of ‘task.o’, the linker will not get called. 
>> eg. if you’re compiling a binary called ‘example’ consisting of ‘task.o’ and ‘another.o’, the linker will not get called.
>> 
>> eg. if you’re compiling a binary called ‘example’ consisting of ‘example.o’, the linker will get called.
>> eg. if you’re compiling a binary called ‘example’ consisting of ‘example.o’ and ‘another.o', the linker will get called.
>> 
>> :-/
> 
> Can’t you provide an explicit rule to call the linker?

To clarify, this test within ft_tools seems to work just fine:

> obj-ftsort = ftsort.o timestamp.o mapping.o
> abc: ${obj-ftsort}
>         $(CC) -o $@ $(LDFLAGS) $+

'make abc’ results in a working binary called ‘abc’.

Basically, you want to recreate the following line to the extent that it’s needed:

	$(CC) -o $@ $(LDFLAGS) ${ldf-$@} $(filter-out liblitmus.a,$+) $(LOADLIBS) $(LDLIBS) ${liblitmus-flags} ${lib-$@}

	With context: https://github.com/LITMUS-RT/liblitmus/blob/master/Makefile#L238

- Björn





More information about the litmus-dev mailing list