automake
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Partially linked .o objects


From: Alexandre Duret-Lutz
Subject: Re: Partially linked .o objects
Date: Sat, 3 Nov 2001 15:14:51 +0100

On Thu, Oct 04, 2001 at 06:50:27PM +0200, Pontus Lidman wrote:

> Hello,
>
> I'm trying to use automake 1.4a in a project where we build some Linux
> kernel modules. These modules are partially linked objects, i.e. .c is
> compiled to .o and these objects are linked using ld -r to produce the
> kernel module.
>
> However I can't seem to make it work. There seems to be no explicit
> support for this in automake; I don't want a .la or .a library.
>
> My attempt (included below) gives me trouble with dependencies, e.g.
>
> make[2]: *** No rule to make target `audioInt.o', needed by `audio.o'.  Stop.
>
> My Makefile.am:
>
> kernelmoddir=$(prefix)/kernel
> kernelmod_DATA=audio.o
> INCLUDES=-I$(top_srcdir)/include
> CFLAGS=-D_LOOSE_KERNEL_NAMES -DMODULE -D__KERNEL__ -DLINUX
> SOURCES=audioInt.c audioMain.c audioOps.c audioInt.h
> OBJECTS=audioInt.o audioMain.o audioOps.o
> audio.o: $(OBJECTS)
>       ld -r -o audio.o $(OBJECTS)
>
> Any advice is appreciated.

I think the following will works (with Automake 1.5), except that it's
quite tricky:

AUTOMAKE_OPTIONS = no-exeext  # Don't append $(EXEEXT) to audio.o
kernelmoddir = $(prefix)/kernel
kernelmod_PROGRAMS = audio.o
INSTALL_PROGRAM = $(INSTALL_DATA) # so audio.o is not installed executable
INCLUDES = -I$(top_srcdir)/include
AM_CFLAGS = -D_LOOSE_KERNEL_NAMES -DMODULE -D__KERNEL__ -DLINUX
audio_o_SOURCES = audioInt.c audioMain.c audioOps.c audioInt.h
audio.o: $(audio_o_OBJECTS)  # override the default link rule for audio.o
        ld -r -o audio.o $(audio_o_OBJECTS)



reply via email to

[Prev in Thread] Current Thread [Next in Thread]