Hello again, I figured it out. I'm sorry to have bothered you with this.
For those interested; I put something like this in Makefile.am, which seems to be all thats needed, and do the trick just fine: bin_PROGRAMS = prog prog_a prog_SOURCES = file1.cpp file2.cpp prog_a_SOURCES = $(prog_SOURCES) prog_a_CXXFLAGS = -DVAR_A Thanks, Camiel. iamcamiel wrote: > > 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-tp16144717p16147474.html Sent from the Gnu - Automake - General mailing list archive at Nabble.com.