From 3eb55007a682d1eb94ba6a1fb0fe0b4652b8a120 Mon Sep 17 00:00:00 2001 From: Mike Wey Date: Sat, 9 Jul 2011 17:57:07 +0200 Subject: Add building the unittests to the makefile --- GNUmakefile | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/GNUmakefile b/GNUmakefile index 4d49def..5422876 100644 --- a/GNUmakefile +++ b/GNUmakefile @@ -65,7 +65,18 @@ $(LIBNAME_DMAGICK): $(OBJECTS_DMAGICK) ####################################################################### %.o : %.d - $(DC) $(DCFLAGS) $(IMPORTS) -c $< $(output) + $(DC) $(DCFLAGS) -c $< $(output) + +####################################################################### + +/tmp/stubmain.o: + $(shell echo "void main(){}" > /tmp/stubmain.d) + $(DC) $(DCFLAGS) -c /tmp/stubmain.d $(output) + +unittest: DCFLAGS+=-unittest +unittest: /tmp/stubmain.o $(SOURCES_DMAGICK) + $(DC) $(DCFLAGS) -L-lMagickCore $(SOURCES_DMAGICK) $< $(output) + ./$@ ####################################################################### @@ -75,7 +86,7 @@ docs: $(DOCS_DMAGICK) ####################################################################### docs/%.html : dmagick/%.d - $(DC) $(DCFLAGS) $(IMPORTS) -o- $< -Df$@ + $(DC) $(DCFLAGS) -o- $< -Df$@ ####################################################################### -- cgit v1.2.3