diff --git a/dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/data/launch/src/Makefile b/dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/data/launch/src/Makefile index e67f6e886e9..a54528f6acd 100644 --- a/dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/data/launch/src/Makefile +++ b/dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/data/launch/src/Makefile @@ -1,17 +1,38 @@ -src = $(wildcard *.cc *.c) -destDir = ../bin -GCCFLAGS = -gdwarf-2 -pthread +BINDIR = ../bin +SRC_C = $(wildcard *.c) +SRC_CXX = $(wildcard *.cc) -all: - @mkdir -p $(destDir) -# Name the target with an .exe extension so that CVS does not -# include it when making a patch - @for file in $(src) ; \ - do \ - target=`basename $$file .c` ; \ - target=`basename $$target .cc` ; \ - g++ $(GCCFLAGS) $$file -o $(destDir)/$$target.exe ; \ - done -# Now generate the core file that we need for the post-mortem core-file tests - @gdb --nx --batch -ex "b testLocals" -ex run -ex "next 16" -ex "gcore ../bin/core" \ - ../bin/ExpressionTestApp.exe > /dev/null +# 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 + +CC = gcc +CFLAGS = -gdwarf-2 -pthread + +CXX = g++ +CXXFLAGS = -gdwarf-2 -pthread + +MKDIR = mkdir -p +RM = rm -f +RMDIR = rmdir + +.PHONY: all clean + +all: $(BINS) $(COREFILE) + +$(BINDIR): + $(MKDIR) $@ + +$(BINDIR)/%.exe: %.c | $(BINDIR) + $(CC) $(CFLAGS) -o $@ $< + +$(BINDIR)/%.exe: %.cc | $(BINDIR) + $(CXX) $(CXXFLAGS) -o $@ $< + +# Generate a core file that is needed for post-morted core-file tests +$(COREFILE): $(BINDIR)/ExpressionTestApp.exe | $(BINDIR) + gdb -nx --batch -ex 'b testLocals' -ex 'run' --ex 'next 16' \ + -ex 'gcore ../bin/core' $(BINDIR)/ExpressionTestApp.exe > /dev/null + +clean: + $(RM) -r $(BINDIR) diff --git a/dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/data/launch/src/MultiThreadRunControl.cc b/dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/data/launch/src/MultiThreadRunControl.cc index 4556b07b6dd..30b23e74b2d 100644 --- a/dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/data/launch/src/MultiThreadRunControl.cc +++ b/dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/data/launch/src/MultiThreadRunControl.cc @@ -21,7 +21,7 @@ void firstBreakpoint(long id) #ifdef __MINGW32__ -unsigned int __stdcall PrintHello(void *threadid) +unsigned int __stdcall PrintHello(void *threadId) #else void *PrintHello(void *threadId) #endif