mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-04-29 19:45:01 +02:00
debug tests: Trigger rebuild when any header file changes
We could go more complicated and only rebuild those source files that are affected by the changes in the header files, but I think this is a good compromise. Change-Id: I508e8ca0176408c68a16e09c51f005446aace099 Signed-off-by: Simon Marchi <simon.marchi@polymtl.ca> Reviewed-on: https://git.eclipse.org/r/36797 Tested-by: Hudson CI Reviewed-by: Marc Khouzam <marc.khouzam@ericsson.com> Tested-by: Marc Khouzam <marc.khouzam@ericsson.com>
This commit is contained in:
parent
15980decb9
commit
ab31b3bcbb
1 changed files with 5 additions and 2 deletions
|
@ -2,6 +2,9 @@ BINDIR = ../bin
|
||||||
SRC_C = $(wildcard *.c)
|
SRC_C = $(wildcard *.c)
|
||||||
SRC_CXX = $(wildcard *.cc)
|
SRC_CXX = $(wildcard *.cc)
|
||||||
|
|
||||||
|
# We rebuild everything whenever one of the headers change
|
||||||
|
HEADERS = $(wildcard *.h)
|
||||||
|
|
||||||
# Use .exe extension so that files are named the same way in Linux and Windows.
|
# Use .exe extension so that files are named the same way in Linux and Windows.
|
||||||
BINS = $(patsubst %.c,$(BINDIR)/%.exe,$(SRC_C)) $(patsubst %.cc,$(BINDIR)/%.exe,$(SRC_CXX))
|
BINS = $(patsubst %.c,$(BINDIR)/%.exe,$(SRC_C)) $(patsubst %.cc,$(BINDIR)/%.exe,$(SRC_CXX))
|
||||||
COREFILE = $(BINDIR)/core
|
COREFILE = $(BINDIR)/core
|
||||||
|
@ -23,10 +26,10 @@ all: $(BINS) $(COREFILE)
|
||||||
$(BINDIR):
|
$(BINDIR):
|
||||||
$(MKDIR) $@
|
$(MKDIR) $@
|
||||||
|
|
||||||
$(BINDIR)/%.exe: %.c | $(BINDIR)
|
$(BINDIR)/%.exe: %.c $(HEADERS) | $(BINDIR)
|
||||||
$(CC) $(CFLAGS) -o $@ $<
|
$(CC) $(CFLAGS) -o $@ $<
|
||||||
|
|
||||||
$(BINDIR)/%.exe: %.cc | $(BINDIR)
|
$(BINDIR)/%.exe: %.cc $(HEADERS) | $(BINDIR)
|
||||||
$(CXX) $(CXXFLAGS) -o $@ $<
|
$(CXX) $(CXXFLAGS) -o $@ $<
|
||||||
|
|
||||||
# Generate a core file that is needed for post-morted core-file tests
|
# Generate a core file that is needed for post-morted core-file tests
|
||||||
|
|
Loading…
Add table
Reference in a new issue