From 50d5eeafc266fae1f13f2a1461f09336806c58b4 Mon Sep 17 00:00:00 2001 From: Sebastian Wilzbach Date: Thu, 22 Jun 2017 22:06:04 +0200 Subject: [PATCH] Compile dependencies separately, s.t. their unittests don't get executed --- makefile | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/makefile b/makefile index d98e9f6..2780216 100644 --- a/makefile +++ b/makefile @@ -5,14 +5,15 @@ DMD := $(DC) GDC := gdc LDC := ldc2 OBJ_DIR := obj -SRC := \ +LIB_SRC := \ $(shell find containers/src -name "*.d")\ $(shell find dsymbol/src -name "*.d")\ $(shell find inifiled/source/ -name "*.d")\ $(shell find libdparse/src/std/experimental/ -name "*.d")\ $(shell find libdparse/src/dparse/ -name "*.d")\ - $(shell find libddoc/src -name "*.d")\ - $(shell find src/ -name "*.d") + $(shell find libddoc/src -name "*.d") +PROJECT_SRC := $(shell find src/ -name "*.d") +SRC := $(LIB_SRC) $(PROJECT_SRC) INCLUDE_PATHS = \ -Iinifiled/source -Isrc\ -Ilibdparse/src\ @@ -21,7 +22,7 @@ INCLUDE_PATHS = \ VERSIONS = DEBUG_VERSIONS = -version=dparse_verbose DMD_FLAGS = -w -inline -release -O -J. -od${OBJ_DIR} -version=StdLoggerDisableWarning -DMD_TEST_FLAGS = -w -g -unittest -J. +DMD_TEST_FLAGS = -w -g -J. -version=StdLoggerDisableWarning all: dmdbuild ldc: ldcbuild @@ -46,8 +47,12 @@ ldcbuild: githash mkdir -p bin ${LDC} -O5 -release -oq -of=bin/dscanner ${VERSIONS} ${INCLUDE_PATHS} ${SRC} -J. -test: githash - ${DC} -w -g -J. -unittest ${INCLUDE_PATHS} ${SRC} -ofbin/dscanner-unittest -version=StdLoggerDisableWarning +# compile the dependencies separately, s.t. their unittests don't get executed +bin/dscanner-unittest-lib.a: ${LIB_SRC} + ${DC} ${DMD_TEST_FLAGS} -c ${INCLUDE_PATHS} ${LIB_SRC} -of$@ + +test: bin/dscanner-unittest-lib.a githash + ${DC} ${DMD_TEST_FLAGS} -unittest ${INCLUDE_PATHS} bin/dscanner-unittest-lib.a ${PROJECT_SRC} -ofbin/dscanner-unittest ./bin/dscanner-unittest rm -f bin/dscanner-unittest