winpty/misc/buffer-tests/Makefile
Ryan Prichard 55bea51430 Implement precompiled headers in misc/buffer-tests
* I'm still going to try to include what is used in each module.

 * At some point, I should implement these in the main project.  It will
   need more testing on the various compilers.  It really needs to be
   on-by-default everywhere.  If it's off, then at least pch.h should be
   included everywhere, to minimize configuration differences between my
   checkout and other people's checkouts.

 * There should be some way to configure it off to check whether includes
   are correct.

 * The change reduces build times from 27.6s to 15.2s on a single-core VM.
2015-10-22 03:18:47 -05:00

76 lines
1.9 KiB
Makefile

include ../../config-mingw.mk
# Pass -Wno-format to disable format checking because gcc complains about
# %I64x. I can't use %lld because it's broken on MinGW-on-WinXP, though it
# works on later OSs. %I64x works everywhere with MinGW, at runtime. I
# need to find a better way to do this int-to-string conversion.
CFLAGS += -MMD -Wall -Iharness -I../../shared
CXXFLAGS += -MMD -Wall -Iharness -I../../shared -std=c++11 -Wno-format
LDFLAGS += -static -static-libgcc -static-libstdc++
# To disable PCH, just comment out these two lines.
PCHFLAGS = -include build/pch.h
PCHDEPS = build/pch.h.gch
# Use gmake -n to see the command-lines gmake would run.
.PHONY : default
default : all
build/pch.h.gch : harness/pch.h
@echo Compiling PCH $<
@$(CXX) $(CXXFLAGS) $(CPPFLAGS) -c -o $@ $<
build/%.o : %.c
@echo Compiling $<
@$(CC) $(CFLAGS) $(CPPFLAGS) -c -o $@ $<
build/%.o : %.cc $(PCHDEPS)
@echo Compiling $<
@$(CXX) $(PCHFLAGS) $(CXXFLAGS) $(CPPFLAGS) -c -o $@ $<
build/%.o : ../../shared/%.cc $(PCHDEPS)
@echo Compiling $<
@$(CXX) $(PCHFLAGS) $(CXXFLAGS) $(CPPFLAGS) -c -o $@ $<
build/%.o : harness/%.cc $(PCHDEPS)
@echo Compiling $<
@$(CXX) $(PCHFLAGS) $(CXXFLAGS) $(CPPFLAGS) -c -o $@ $<
.PRECIOUS : build/%.o
COMMON_OBJECTS = \
build/DebugClient.o \
build/Event.o \
build/NtHandleQuery.o \
build/ShmemParcel.o \
build/Spawn.o \
build/UnicodeConversions.o \
build/Util.o \
build/WinptyAssert.o \
build/winpty_wcsnlen.o
WORKER_OBJECTS = build/Worker.o
TEST_OBJECTS = build/TestCommon.o
all : \
build/Test_GetConsoleTitleW.exe \
build/Win7Bug_InheritHandles.exe \
build/Win7Bug_RaceCondition.exe \
build/TestHandleInheritance.exe \
build/Worker.exe
Worker.exe : $(WORKER_OBJECTS) $(COMMON_OBJECTS)
@echo Linking $@
@$(CXX) -o $@ $^ $(LDFLAGS)
%.exe : %.o $(TEST_OBJECTS) $(COMMON_OBJECTS)
@echo Linking $@
@$(CXX) -o $@ $^ $(LDFLAGS)
.PHONY : clean
clean:
rm -f build/*.exe build/*.o build/*.d build/*.gch
-include build/*.d