automake
[Top][All Lists]
Advanced

[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_CFLAGS = -DVAR_A 

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

.SUFFIXES: .ova

.cpp.o:
        $(CC) $(CFLAGS) -c $<  -o $@

.cpp.ova:
        $(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
autotools?

Thanks,

Camiel.
-- 
View this message in context: 
http://www.nabble.com/Building-multiple-versions-of-the-same-program-tp16144717p16144717.html
Sent from the Gnu - Automake - General mailing list archive at Nabble.com.





reply via email to

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