summaryrefslogtreecommitdiff
path: root/GNUmakefile
diff options
context:
space:
mode:
authorMike Wey2011-07-09 17:57:07 +0200
committerMike Wey2011-07-09 17:57:07 +0200
commit3eb55007a682d1eb94ba6a1fb0fe0b4652b8a120 (patch)
treeca8d983e38708b16b0f65ce391695641f8843b3e /GNUmakefile
parent233e88fd554fb4e1f816d402b4dcf753fc7eaee8 (diff)
Add building the unittests to the makefile
Diffstat (limited to 'GNUmakefile')
-rw-r--r--GNUmakefile15
1 files 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$@
#######################################################################