1
0
Fork 0
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:
Simon Marchi 2014-11-20 11:33:05 -05:00 committed by Marc Khouzam
parent 15980decb9
commit ab31b3bcbb

View file

@ -2,6 +2,9 @@ BINDIR = ../bin
SRC_C = $(wildcard *.c)
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.
BINS = $(patsubst %.c,$(BINDIR)/%.exe,$(SRC_C)) $(patsubst %.cc,$(BINDIR)/%.exe,$(SRC_CXX))
COREFILE = $(BINDIR)/core
@ -23,10 +26,10 @@ all: $(BINS) $(COREFILE)
$(BINDIR):
$(MKDIR) $@
$(BINDIR)/%.exe: %.c | $(BINDIR)
$(BINDIR)/%.exe: %.c $(HEADERS) | $(BINDIR)
$(CC) $(CFLAGS) -o $@ $<
$(BINDIR)/%.exe: %.cc | $(BINDIR)
$(BINDIR)/%.exe: %.cc $(HEADERS) | $(BINDIR)
$(CXX) $(CXXFLAGS) -o $@ $<
# Generate a core file that is needed for post-morted core-file tests