help-make
[Top][All Lists]
Advanced

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

Re: Problem making GNU Make 3.81


From: Mike Shal
Subject: Re: Problem making GNU Make 3.81
Date: Thu, 20 Aug 2009 23:51:18 -0400

On 8/20/09, Paul Smith <address@hidden> wrote:
> Quoting "Tovrea, George W \(US SSA\)"
> <address@hidden>:
>
>
> > The following appears in a Makefile:
> >
> > OBJS    = alldevices.o
> > # input/output devices
> > OBJS-$(CONFIG_ALSA_MUXER)   += alsa-audio-common.o alsa-audio-enc.o
> >
> > The .c file being compiled contains
> >
> > #define REGISTER_MUXER(X,x) { \
> >    extern AVOutputFormat x##_muxer; \
> >    if(CONFIG_##X##_MUXER)
> av_register_output_format(&x##_muxer); }
> > ...
> >    REGISTER_MUXER (ALSA, alsa);
> >
> > This results in an "undeclared" error for CONFIG_ALSA_MUXER.
> >
>
>  This doesn't have anything to do with make (and is certainly not a "problem
> making GNU make" as your subject mentions).
>
>
> > I am unfamiliar with the OBJS- line from the make file. What is this
> > suppose to do? It appears to do nothing in regards to the compile.
> >
>
>  It indeed does NOT do anything with regards to the compile, and it's not
> supposed to.  What that does is assign a make variable whose name is
> constructed from the prefix OBJS- and whatever value the make variable
> $(CONFIG_ALSA_MUXER) contains.
>
>  This looks like a Linux kernel makefile

Paul - actually it seems to be ffmpeg (or maybe some other package
that has common code?). Looks like they just adopted the Linux kernel
style of selectively compiling C files based on variables.

George - if it is indeed ffmpeg, the make definitions of the CONFIG_*
are in config.mak, and the C definitions are in config.h. Both of
these files are generated by the ./configure step. In this case, the
CONFIG_ALSA_MUXER would expand to "yes", and then in common.mak
there's a line that does:

OBJS + = $(OBJS-yes)

This just sets another variable, that eventually gets used in a rule
somewhere to tell make which files to compile. There's nothing special
about the name of the variable. It's really just a fancy way to avoid
doing something like:

ifeq ($(CONFIG_ALSA_MUXER),yes)
 OBJS += alsa-audio-common.c
endif

Since that would take three lines when it can be done in one :).

Anyway, as Paul said you'll need to contact the maintainer of the
package you're actually trying to compile. It will probably help if
you tell them up front which version you're using and what commands
you're running (such as what options you may have provided to
./configure or make). For reference, I was looking at ffmpeg-0.5.

-Mike




reply via email to

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