[Top][All Lists]

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

Building multiple versions of the same program

From: iamcamiel
Subject: Building multiple versions of the same program
Date: Wed, 19 Mar 2008 09:58:20 -0700 (PDT)

Hello everyone,

I've finally gotten around to learning to use the autotools for an
open-source project I'm working on, and I run into one thing that I can't
figure out how to do.

I have one program, that can be built in four different variants. The
variant is choosen by defining a macro, and affects lots of sources. The
four variants are always needed.

In the current makefile, this is solved by doing some substitutions (I'll
just show two variants):


VAR_A_OBJS = $(subst .o,.do,$(OBJS))


        $(CC) $(CFLAGS) -c $<  -o $@

        $(CC) $(CFLAGS) $(VAR_A_CFLAGS) -c $< -o $@

all: prog prog_a

prog:   $(OBJS)
        $(LD) $(LDFLAGS) -o prog $(OBJS)

prog_a: $(VAR_A_OBJS)
        $(LD) $(LDFLAGS) -o prog_a $(VAR_A_OBJS)

Is there a standard way of doing something like this when using the


View this message in context:
Sent from the Gnu - Automake - General mailing list archive at

reply via email to

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