[Top][All Lists]

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

Re: easiest way to do simultaneous builds with different options from sa

From: Basin Ilya
Subject: Re: easiest way to do simultaneous builds with different options from same dir?
Date: Thu, 5 Jul 2018 00:59:34 +0300
User-agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.8.0

Hi Britton.

Assuming you have a Makefile like this:

    all: test.o
        rm -rf *.o
    .PHONY: all clean

You can create two empty directories and perform make in each by setting VPATH 
and build flags:

    $ make -f ../src/Makefile CFLAGS=-DBUILD_1 VPATH=../src
    cc -DBUILD_1   -c -o test.o ../src/test.c

The output file will be created in current dir, but the source will be found in 

The existing Makefile may be written so that not everything works with VPATH.

Or Better migrate to Autotools and use VPATH builds.

04.07.2018 23:08, Britton Kerin пишет:
> I'm frequently rebuilding and uploading both ends of a tx/rx system
> and it's just slow enough to be annoying.  I'd like to rebuild the Tx
> and Rx ends in parallel but they need different build options for the
> same sources.
> I'm guessing the easiest approach is to do cp -r or so from a script
> and run make from there, and the tree is small enough that that will
> probably work ok, but I'm curious if anyone has a trick to do it in
> place somehow to avoid the cp and full rebuild of everything?
> Something like automagically injecting $$ into all non-phony targets
> or something?
> Thanks,
> Britton
> _______________________________________________
> Help-make mailing list
> address@hidden

reply via email to

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