pixman: Branch 'master' - 7 commits

Andrea Canciani ranma42 at kemper.freedesktop.org
Wed Sep 14 07:30:19 PDT 2011


 Makefile.win32              |   25 ++++++++++
 Makefile.win32.common       |   54 ++++++++++++++++++++++
 pixman/Makefile.am          |   61 +++++--------------------
 pixman/Makefile.sources     |   55 ++++++++++++++++++++++
 pixman/Makefile.win32       |  107 +++++---------------------------------------
 test/Makefile.am            |   47 ++-----------------
 test/Makefile.sources       |   36 ++++++++++++++
 test/Makefile.win32         |   89 +++++++++---------------------------
 test/blitters-test.c        |    1 
 test/composite.c            |    1 
 test/fetch-test.c           |    5 +-
 test/pdf-op-test.c          |    1 
 test/scaling-helpers-test.c |    3 -
 test/utils.h                |    5 +-
 14 files changed, 232 insertions(+), 258 deletions(-)

New commits:
commit 9623b478f7e872af36ca77af5cc9e85f5ea132cf
Author: Andrea Canciani <ranma42 at gmail.com>
Date:   Sun Sep 4 21:33:05 2011 +0200

    build-win32: Add 'check' target
    
    On win32 the tests are built but they are not run automatically by the
    build system.
    
    A minimal 'check' target (depending on the tests being built) can
    simply run them and log to the console their success/failure.

diff --git a/Makefile.win32 b/Makefile.win32
index 5b74878..91cd12a 100644
--- a/Makefile.win32
+++ b/Makefile.win32
@@ -14,7 +14,12 @@ clean_r:
 	@$(MAKE) -C pixman -f Makefile.win32 clean
 	@$(MAKE) -C test   -f Makefile.win32 clean
 
+check_r:
+	@$(MAKE) -C test -f Makefile.win32 check
+
 # Base targets
 all: test_r
 
 clean: clean_r
+
+check: check_r
diff --git a/test/Makefile.win32 b/test/Makefile.win32
index c857db9..307ba0c 100644
--- a/test/Makefile.win32
+++ b/test/Makefile.win32
@@ -18,6 +18,9 @@ BENCHS  = $(patsubst %,   $(CFG_VAR)/%.exe, $(BENCHMARKS))
 
 all: inform $(TESTS) $(BENCHS)
 
+check: inform $(TESTS)
+	@for test in $(TESTS) ; do ./$$test && echo "PASS: $$test" || echo "FAIL: $$test" ; done
+
 $(CFG_VAR)/libutils.lib: $(libutils_OBJECTS)
 	@$(AR) $(PIXMAN_ARFLAGS) -OUT:$@ $^
 
commit 479d0944851fffda7ed860523feb388fec028545
Author: Andrea Canciani <ranma42 at gmail.com>
Date:   Sun Sep 4 13:52:53 2011 -0700

    test: Do not include config.h unless HAVE_CONFIG_H is defined
    
    The win32 build system does not generate config.h and correctly runs
    the compiler without defining HAVE_CONFIG_H. Nevertheless some files
    include config.h without checking for its availability, breaking the
    build from a clean directory:
    
    test\utils.h(2) : fatal error C1083: Cannot open include file:
    'config.h': No such file or directory
    ...

diff --git a/test/blitters-test.c b/test/blitters-test.c
index 594ec54..790a27f 100644
--- a/test/blitters-test.c
+++ b/test/blitters-test.c
@@ -8,7 +8,6 @@
 #include <assert.h>
 #include <stdlib.h>
 #include <stdio.h>
-#include <config.h>
 #include "utils.h"
 
 static pixman_indexed_t rgb_palette[9];
diff --git a/test/composite.c b/test/composite.c
index edea9a9..408c363 100644
--- a/test/composite.c
+++ b/test/composite.c
@@ -27,7 +27,6 @@
 #include <stdio.h>
 #include <stdlib.h> /* abort() */
 #include <math.h>
-#include <config.h>
 #include <time.h>
 #include "utils.h"
 
diff --git a/test/fetch-test.c b/test/fetch-test.c
index feb98d9..9f80eec 100644
--- a/test/fetch-test.c
+++ b/test/fetch-test.c
@@ -1,8 +1,11 @@
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
 #include <assert.h>
 #include <stdlib.h>
 #include <stdio.h>
 #include "pixman.h"
-#include <config.h>
 
 #define SIZE 1024
 
diff --git a/test/pdf-op-test.c b/test/pdf-op-test.c
index dc7a4fd..99cb7df 100644
--- a/test/pdf-op-test.c
+++ b/test/pdf-op-test.c
@@ -1,4 +1,3 @@
-#include <config.h>
 #include <stdlib.h>
 #include "utils.h"
 
diff --git a/test/scaling-helpers-test.c b/test/scaling-helpers-test.c
index eb436d1..a8b94b0 100644
--- a/test/scaling-helpers-test.c
+++ b/test/scaling-helpers-test.c
@@ -1,4 +1,3 @@
-#include <config.h>
 #include <stdint.h>
 #include <stdlib.h>
 #include <stdio.h>
diff --git a/test/utils.h b/test/utils.h
index 3790483..b23925c 100644
--- a/test/utils.h
+++ b/test/utils.h
@@ -1,5 +1,8 @@
-#include <stdlib.h>
+#ifdef HAVE_CONFIG_H
 #include <config.h>
+#endif
+
+#include <stdlib.h>
 #include <assert.h>
 #include "pixman-private.h" /* For 'inline' definition */
 
commit d46a9f3acef21b50639c64f190a0de7eca21747c
Author: Andrea Canciani <ranma42 at gmail.com>
Date:   Sun Sep 4 21:56:20 2011 +0200

    build-win32: Add root Makefile.win32
    
    Add Makefile.win32 to the pixman root. This makefile can recursively
    run the other ones to compile the library or the test suite.

diff --git a/Makefile.win32 b/Makefile.win32
new file mode 100644
index 0000000..5b74878
--- /dev/null
+++ b/Makefile.win32
@@ -0,0 +1,20 @@
+default: all
+
+top_srcdir = .
+include $(top_srcdir)/Makefile.win32.common
+
+# Recursive targets
+pixman_r:
+	@$(MAKE) -C pixman -f Makefile.win32
+
+test_r:
+	@$(MAKE) -C test -f Makefile.win32
+
+clean_r:
+	@$(MAKE) -C pixman -f Makefile.win32 clean
+	@$(MAKE) -C test   -f Makefile.win32 clean
+
+# Base targets
+all: test_r
+
+clean: clean_r
commit a76b78c2daa61900572014070d3e856a460fd554
Author: Andrea Canciani <ranma42 at gmail.com>
Date:   Sun Sep 4 18:00:38 2011 +0200

    build-win32: Share targets and variables across win32 makefiles
    
    The win32 build system repeatedly defines some basic variables
    (notably program names and flags) and C sources compilation rules.
    
    They can be factored out to a common Makefile, to be included in every
    other Makefile.win32.

diff --git a/Makefile.win32.common b/Makefile.win32.common
new file mode 100644
index 0000000..56c3593
--- /dev/null
+++ b/Makefile.win32.common
@@ -0,0 +1,54 @@
+LIBRARY = pixman-1
+
+CC = cl
+LD = link
+AR = lib
+PERL = perl
+
+ifeq ($(top_builddir),)
+top_builddir = $(top_srcdir)
+endif
+
+CFG_VAR = $(CFG)
+ifeq ($(CFG_VAR),)
+CFG_VAR = release
+endif
+
+ifeq ($(CFG_VAR),debug)
+CFG_CFLAGS  = -MDd -Od -Zi
+CFG_LDFLAGS = -DEBUG
+else
+CFG_CFLAGS  = -MD -O2
+CFG_LDFLAGS =
+endif
+
+# Package definitions, to be used instead of those provided in config.h
+PKG_CFLAGS  = -DPACKAGE=$(LIBRARY) -DPACKAGE_VERSION="" -DPACKAGE_BUGREPORT=""
+
+BASE_CFLAGS = -nologo -I. -I$(top_srcdir) -I$(top_srcdir)/pixman
+
+PIXMAN_CFLAGS  = $(BASE_CFLAGS) $(PKG_CFLAGS) $(CFG_CFLAGS) $(CFLAGS)
+PIXMAN_LDFLAGS = -nologo $(CFG_LDFLAGS) $(LDFLAGS)
+PIXMAN_ARFLAGS = -nologo $(LDFLAGS)
+
+
+inform:
+ifneq ($(CFG),release)
+ifneq ($(CFG),debug)
+ifneq ($(CFG),)
+	@echo "Invalid specified configuration option: "$(CFG)"."
+	@echo
+	@echo "Possible choices for configuration are 'release' and 'debug'"
+	@exit 1
+endif
+	@echo "Using default RELEASE configuration... (use CFG=release or CFG=debug)"
+endif
+endif
+
+
+$(CFG_VAR)/%.obj: %.c $(BUILT_SOURCES)
+	@mkdir -p $(CFG_VAR)
+	@$(CC) -c $(PIXMAN_CFLAGS) -Fo"$@" $<
+
+clean: inform
+	@$(RM) $(CFG_VAR)/*.{exe,ilk,lib,obj,pdb} $(BUILT_SOURCES) || exit 0
diff --git a/pixman/Makefile.win32 b/pixman/Makefile.win32
index d2d018a..beff4a0 100644
--- a/pixman/Makefile.win32
+++ b/pixman/Makefile.win32
@@ -2,17 +2,7 @@ default: all
 
 top_srcdir = ..
 include $(top_srcdir)/pixman/Makefile.sources
-
-LIBRARY     = pixman-1
-
-CC   = cl
-LINK = link
-PERL = perl
-
-CFG_VAR = $(CFG)
-ifeq ($(CFG_VAR),)
-CFG_VAR=release
-endif
+include $(top_srcdir)/Makefile.win32.common
 
 MMX_VAR = $(MMX)
 ifeq ($(MMX_VAR),)
@@ -24,26 +14,18 @@ ifeq ($(SSE2_VAR),)
 SSE2_VAR=on
 endif
 
-CFLAGS     = -MD -nologo -D_CRT_SECURE_NO_DEPRECATE -D_CRT_NONSTDC_NO_DEPRECATE -I../pixman/src -I. -DPACKAGE=$(LIBRARY) -DPACKAGE_VERSION="" -DPACKAGE_BUGREPORT=""
 MMX_CFLAGS = -DUSE_MMX -w14710 -w14714
 SSE2_CFLAGS = -DUSE_SSE2
 
-# optimization flags
-ifeq ($(CFG_VAR),debug)
-CFLAGS += -Od -Zi
-else
-CFLAGS += -O2
-endif
-
 # MMX compilation flags
 ifeq ($(MMX_VAR),on)
-CFLAGS += $(MMX_CFLAGS)
+PIXMAN_CFLAGS += $(MMX_CFLAGS)
 libpixman_sources += pixman-mmx.c
 endif
 
 # SSE2 compilation flags
 ifeq ($(SSE2_VAR),on)
-CFLAGS += $(SSE2_CFLAGS)
+PIXMAN_CFLAGS += $(SSE2_CFLAGS)
 libpixman_sources += pixman-sse2.c
 endif
 
@@ -51,26 +33,6 @@ OBJECTS = $(patsubst %.c, $(CFG_VAR)/%.obj, $(libpixman_sources))
 
 # targets
 all: inform informMMX informSSE2 $(CFG_VAR)/$(LIBRARY).lib
-	@exit 0
-clean: inform clean_r 
-	@exit 0
-pixman: inform informMMX informSSE2 $(CFG_VAR)/$(LIBRARY).lib 
-	@exit 0
-
-inform:
-ifneq ($(CFG),release)
-ifneq ($(CFG),debug)
-ifneq ($(CFG),)
-	@echo "Invalid specified configuration option : "$(CFG)"."
-	@echo
-	@echo -n "Possible choices for configuration are "
-	@echo "'release' and 'debug'"
-	@echo ""
-	@exit 1
-endif
-	@echo "Using default RELEASE configuration... (use CFG=release or CFG=debug)"
-endif
-endif
 
 informMMX:
 ifneq ($(MMX),off)
@@ -78,8 +40,7 @@ ifneq ($(MMX),on)
 ifneq ($(MMX),)
 	@echo "Invalid specified MMX option : "$(MMX_VAR)"."
 	@echo
-	@echo -n "Possible choices for MMX are 'on' or 'off'"
-	@echo ""
+	@echo "Possible choices for MMX are 'on' or 'off'"
 	@exit 1
 endif
 	@echo "Setting MMX flag to default value 'on'... (use MMX=on or MMX=off)"
@@ -92,22 +53,14 @@ ifneq ($(SSE2),on)
 ifneq ($(SSE2),)
 	@echo "Invalid specified SSE option : "$(SSE2)"."
 	@echo
-	@echo -n "Possible choices for SSE2 are 'on' or 'off'"
-	@echo ""
+	@echo "Possible choices for SSE2 are 'on' or 'off'"
 	@exit 1
 endif
 	@echo "Setting SSE2 flag to default value 'on'... (use SSE2=on or SSE2=off)"
 endif
 endif
 
-# pixman compilation and linking
-$(CFG_VAR)/%.obj: %.c $(BUILT_SOURCES)
-	@mkdir -p $(CFG_VAR)
-	@$(CC) -c $(CFLAGS) -Fo"$@" $<
 
+# pixman linking
 $(CFG_VAR)/$(LIBRARY).lib: $(OBJECTS)
-	lib -NOLOGO -OUT:$@ $(OBJECTS) || exit 0
-
-clean_r:
-	@rm -f $(CFG_VAR)/*.obj $(CFG_VAR)/*.lib $(CFG_VAR)/*.pdb $(CFG)/*.ilk || exit 0
-	@rm -f $(CFG)/*.obj $(CFG)/*.lib $(CFG)/*.pdb $(CFG)/*.ilk $(BUILT_SOURCES) || exit 0
+	@$(AR) $(PIXMAN_ARFLAGS) -OUT:$@ $^
diff --git a/test/Makefile.win32 b/test/Makefile.win32
index 215fb04..c857db9 100644
--- a/test/Makefile.win32
+++ b/test/Makefile.win32
@@ -2,25 +2,12 @@ default: all
 
 top_srcdir = ..
 include $(top_srcdir)/test/Makefile.sources
+include $(top_srcdir)/Makefile.win32.common
 
-CC   = cl
-LINK = link
-
-CFG_VAR = $(CFG)
-ifeq ($(CFG_VAR),)
-CFG_VAR=release
-endif
-
-CFLAGS     = -MD -nologo -D_CRT_SECURE_NO_DEPRECATE -D_CRT_NONSTDC_NO_DEPRECATE -D_BIND_TO_CURRENT_VCLIBS_VERSION -D_MT -I../pixman -I. -I../
-TEST_LDADD = ../pixman/$(CFG_VAR)/pixman-1.lib $(CFG_VAR)/libutils.lib
-INCLUDES = -I../pixman -I$(top_builddir)/pixman
-
-# optimization flags
-ifeq ($(CFG_VAR),debug)
-CFLAGS += -Od -Zi
-else
-CFLAGS += -O2
-endif
+TEST_LDADD = \
+	$(top_builddir)/pixman/$(CFG_VAR)/$(LIBRARY).lib \
+	$(CFG_VAR)/libutils.lib \
+	$(NULL)
 
 libutils_OBJECTS = $(patsubst %.c, $(CFG_VAR)/%.obj, $(libutils_sources))
 
@@ -29,18 +16,13 @@ OBJECTS = $(patsubst %.c, $(CFG_VAR)/%.obj, $(SOURCES))
 TESTS   = $(patsubst %,   $(CFG_VAR)/%.exe, $(TESTPROGRAMS))
 BENCHS  = $(patsubst %,   $(CFG_VAR)/%.exe, $(BENCHMARKS))
 
-
-all: $(TESTS) $(BENCHS)
+all: inform $(TESTS) $(BENCHS)
 
 $(CFG_VAR)/libutils.lib: $(libutils_OBJECTS)
-	@lib -NOLOGO -OUT:$@ $^ || exit 0
-
-$(CFG_VAR)/%.obj: %.c
-	@mkdir -p $(CFG_VAR)
-	@$(CC) -c $(CFLAGS) -Fo"$@" $<
+	@$(AR) $(PIXMAN_ARFLAGS) -OUT:$@ $^
 
 $(CFG_VAR)/%.exe: $(CFG_VAR)/%.obj $(TEST_LDADD)
-	@$(LINK) /NOLOGO /OUT:$@ $^
+	@$(LD) $(PIXMAN_LDFLAGS) -OUT:$@ $^
 
-clean:
-	@rm -f $(CFG_VAR)/*.obj $(CFG_VAR)/*.pdb || exit 0
+$(top_builddir)/pixman/$(CFG_VAR)/$(LIBRARY).lib:
+	@$(MAKE) -C $(top_builddir)/pixman -f Makefile.win32
commit efdf65c0c4fff551fb3cd9104deda9adb6261e22
Author: Andrea Canciani <ranma42 at gmail.com>
Date:   Sun Sep 4 20:07:42 2011 +0200

    build: Reuse test sources
    
    Makefile.am and Makefile.win32 should not duplicate content, as this
    leads to breaking the build when they are not kept in sync.
    
    This can be avoided by listing sources, headers and common build
    variables/rules in a Makefile.sources file.
    
    In order to further simplify the test makefiles, the utility functions
    are now in a static library, which gets linked to all the tests and
    benchmarks.

diff --git a/test/Makefile.am b/test/Makefile.am
index 6687bed..4268cd7 100644
--- a/test/Makefile.am
+++ b/test/Makefile.am
@@ -1,50 +1,13 @@
+include $(top_srcdir)/test/Makefile.sources
+
 AM_CFLAGS = @OPENMP_CFLAGS@
 AM_LDFLAGS = @OPENMP_CFLAGS@ @TESTPROGS_EXTRA_LDFLAGS@
-LDADD = $(top_builddir)/pixman/libpixman-1.la -lm  @PNG_LIBS@
+LDADD = $(top_builddir)/pixman/libpixman-1.la libutils.la -lm  @PNG_LIBS@
 INCLUDES = -I$(top_srcdir)/pixman -I$(top_builddir)/pixman @PNG_CFLAGS@
 
-TESTPROGRAMS =			\
-	a1-trap-test		\
-	pdf-op-test		\
-	region-test		\
-	region-translate-test	\
-	fetch-test		\
-	oob-test		\
-	trap-crasher		\
-	alpha-loop		\
-	scaling-crash-test	\
-	scaling-helpers-test	\
-	gradient-crash-test	\
-	region-contains-test	\
-	alphamap		\
-	stress-test		\
-	composite-traps-test	\
-	blitters-test		\
-	scaling-test		\
-	affine-test		\
-	composite
-
-pdf_op_test_SOURCES = pdf-op-test.c utils.c utils.h
-region_test_SOURCES = region-test.c utils.c utils.h
-blitters_test_SOURCES = blitters-test.c utils.c utils.h
-region_contains_test_SOURCES = region-contains-test.c utils.c utils.h
-composite_traps_test_SOURCES = composite-traps-test.c utils.c utils.h
-scaling_test_SOURCES = scaling-test.c utils.c utils.h
-affine_test_SOURCES = affine-test.c utils.c utils.h
-alphamap_SOURCES = alphamap.c utils.c utils.h
-alpha_loop_SOURCES = alpha-loop.c utils.c utils.h
-composite_SOURCES = composite.c utils.c utils.h
-gradient_crash_test_SOURCES = gradient-crash-test.c utils.c utils.h
-stress_test_SOURCES = stress-test.c utils.c utils.h
-scaling_helpers_test_SOURCES = scaling-helpers-test.c utils.c utils.h
-
-# Benchmarks
-
-BENCHMARKS =			\
-	lowlevel-blt-bench
-
-lowlevel_blt_bench_SOURCES = lowlevel-blt-bench.c utils.c utils.h
+libutils_la_SOURCES = $(libutils_sources) $(libutils_headers)
 
+noinst_LTLIBRARIES = libutils.la
 noinst_PROGRAMS = $(TESTPROGRAMS) $(BENCHMARKS)
 
 TESTS = $(TESTPROGRAMS)
diff --git a/test/Makefile.sources b/test/Makefile.sources
new file mode 100644
index 0000000..99eb705
--- /dev/null
+++ b/test/Makefile.sources
@@ -0,0 +1,36 @@
+# Tests (sorted by expected completion time)
+TESTPROGRAMS =			\
+	a1-trap-test		\
+	pdf-op-test		\
+	region-test		\
+	region-translate-test	\
+	fetch-test		\
+	oob-test		\
+	trap-crasher		\
+	alpha-loop		\
+	scaling-crash-test	\
+	scaling-helpers-test	\
+	gradient-crash-test	\
+	region-contains-test	\
+	alphamap		\
+	stress-test		\
+	composite-traps-test	\
+	blitters-test		\
+	scaling-test		\
+	affine-test		\
+	composite		\
+	$(NULL)
+
+# Benchmarks
+BENCHMARKS =			\
+	lowlevel-blt-bench	\
+	$(NULL)
+
+# Utility functions
+libutils_sources =		\
+	utils.c			\
+	$(NULL)
+
+libutils_headers =		\
+	utils.h			\
+	$(NULL)
diff --git a/test/Makefile.win32 b/test/Makefile.win32
index a62b6fc..215fb04 100644
--- a/test/Makefile.win32
+++ b/test/Makefile.win32
@@ -1,3 +1,8 @@
+default: all
+
+top_srcdir = ..
+include $(top_srcdir)/test/Makefile.sources
+
 CC   = cl
 LINK = link
 
@@ -7,7 +12,7 @@ CFG_VAR=release
 endif
 
 CFLAGS     = -MD -nologo -D_CRT_SECURE_NO_DEPRECATE -D_CRT_NONSTDC_NO_DEPRECATE -D_BIND_TO_CURRENT_VCLIBS_VERSION -D_MT -I../pixman -I. -I../
-TEST_LDADD = ../pixman/$(CFG_VAR)/pixman-1.lib
+TEST_LDADD = ../pixman/$(CFG_VAR)/pixman-1.lib $(CFG_VAR)/libutils.lib
 INCLUDES = -I../pixman -I$(top_builddir)/pixman
 
 # optimization flags
@@ -17,60 +22,25 @@ else
 CFLAGS += -O2
 endif
 
-SOURCES =			\
-	a1-trap-test.c		\
-	pdf-op-test.c		\
-	region-test.c		\
-	region-translate-test.c	\
-	fetch-test.c		\
-	oob-test.c		\
-	trap-crasher.c		\
-	alpha-loop.c		\
-	scaling-crash-test.c	\
-	gradient-crash-test.c	\
-	alphamap.c		\
-	stress-test.c		\
-	composite-traps-test.c	\
-	blitters-test.c		\
-	scaling-test.c		\
-	affine-test.c		\
-	composite.c		\
-	lowlevel-blt-bench.c	\
-	utils.c
+libutils_OBJECTS = $(patsubst %.c, $(CFG_VAR)/%.obj, $(libutils_sources))
 
-TESTS =						\
-	$(CFG_VAR)/a1-trap-test.exe		\
-	$(CFG_VAR)/pdf-op-test.exe		\
-	$(CFG_VAR)/region-test.exe		\
-	$(CFG_VAR)/region-translate-test.exe	\
-	$(CFG_VAR)/fetch-test.exe		\
-	$(CFG_VAR)/oob-test.exe			\
-	$(CFG_VAR)/trap-crasher.exe		\
-	$(CFG_VAR)/alpha-loop.exe		\
-	$(CFG_VAR)/scaling-crash-test.exe	\
-	$(CFG_VAR)/gradient-crash-test.exe	\
-	$(CFG_VAR)/alphamap.exe			\
-	$(CFG_VAR)/stress-test.exe		\
-	$(CFG_VAR)/composite-traps-test.exe	\
-	$(CFG_VAR)/blitters-test.exe		\
-	$(CFG_VAR)/scaling-test.exe		\
-	$(CFG_VAR)/affine-test.exe		\
-	$(CFG_VAR)/composite.exe
+SOURCES = $(patsubst %,   %.c,              $(TESTPROGRAMS) $(BENCHMARKS))
+OBJECTS = $(patsubst %.c, $(CFG_VAR)/%.obj, $(SOURCES))
+TESTS   = $(patsubst %,   $(CFG_VAR)/%.exe, $(TESTPROGRAMS))
+BENCHS  = $(patsubst %,   $(CFG_VAR)/%.exe, $(BENCHMARKS))
 
-BENCHMARKS =					\
-	$(CFG_VAR)/lowlevel-blt-bench.exe
 
-OBJECTS     = $(patsubst %.c, $(CFG_VAR)/%.obj, $(SOURCES))
+all: $(TESTS) $(BENCHS)
+
+$(CFG_VAR)/libutils.lib: $(libutils_OBJECTS)
+	@lib -NOLOGO -OUT:$@ $^ || exit 0
 
 $(CFG_VAR)/%.obj: %.c
 	@mkdir -p $(CFG_VAR)
 	@$(CC) -c $(CFLAGS) -Fo"$@" $<
 
-$(CFG_VAR)/%.exe: $(CFG_VAR)/%.obj
-	$(LINK) /NOLOGO /OUT:$@ $< $(CFG_VAR)/utils.obj $(TEST_LDADD)
-
-all: $(OBJECTS) $(TESTS) $(BENCHMARKS)
-	@exit 0
+$(CFG_VAR)/%.exe: $(CFG_VAR)/%.obj $(TEST_LDADD)
+	@$(LINK) /NOLOGO /OUT:$@ $^
 
 clean:
 	@rm -f $(CFG_VAR)/*.obj $(CFG_VAR)/*.pdb || exit 0
commit a4f95d083b1aa644923d79e7b61df6c2eacca7c2
Author: Andrea Canciani <ranma42 at gmail.com>
Date:   Sun Sep 4 09:41:41 2011 -0700

    build: Reuse sources and pixman-combine build rules
    
    Makefile.am and Makefile.win32 should not duplicate content, as this
    leads to breaking the build when they are not kept in sync.
    
    This can be avoided by listing sources, headers and common build
    variables/rules in a Makefile.sources file.

diff --git a/pixman/Makefile.am b/pixman/Makefile.am
index 44e6b17..2421a4f 100644
--- a/pixman/Makefile.am
+++ b/pixman/Makefile.am
@@ -1,60 +1,25 @@
+include $(top_srcdir)/pixman/Makefile.sources
+
 lib_LTLIBRARIES = libpixman-1.la
+
 libpixman_1_la_LDFLAGS = -version-info $(LT_VERSION_INFO) -no-undefined @PTHREAD_LDFLAGS@ 
 libpixman_1_la_LIBADD = @PTHREAD_LIBS@ @DEP_LIBS@ -lm
-libpixman_1_la_SOURCES =			\
-	pixman.h				\
-	pixman-accessor.h			\
-	pixman-access.c				\
-	pixman-access-accessors.c		\
-	pixman-cpu.c				\
-	pixman-gradient-walker.c		\
-	pixman-region16.c			\
-	pixman-region32.c			\
-	pixman-compiler.h			\
-	pixman-private.h			\
-	pixman-image.c				\
-	pixman-implementation.c			\
-	pixman-combine32.c			\
-	pixman-combine32.h			\
-	pixman-combine64.c			\
-	pixman-combine64.h			\
-	pixman-general.c			\
-	pixman.c				\
-	pixman-noop.c				\
-	pixman-fast-path.c			\
-	pixman-solid-fill.c			\
-	pixman-conical-gradient.c		\
-	pixman-linear-gradient.c		\
-	pixman-radial-gradient.c		\
-	pixman-bits-image.c			\
-	pixman-utils.c				\
-	pixman-edge.c				\
-	pixman-edge-accessors.c			\
-	pixman-edge-imp.h			\
-	pixman-inlines.h			\
-	pixman-trap.c				\
-	pixman-timer.c				\
-	pixman-matrix.c
+libpixman_1_la_SOURCES = $(libpixman_sources) $(libpixman_headers)
 
 libpixmanincludedir = $(includedir)/pixman-1
 libpixmaninclude_HEADERS = pixman.h pixman-version.h
 noinst_LTLIBRARIES = 
 
-BUILT_SOURCES = pixman-combine32.h pixman-combine32.c pixman-combine64.h pixman-combine64.c
-
-pixman-combine32.c : pixman-combine.c.template pixman-combine32.h make-combine.pl
-	$(PERL) $(srcdir)/make-combine.pl 8 < $(srcdir)/pixman-combine.c.template > $@ || ($(RM) $@; exit 1)
-pixman-combine32.h : pixman-combine.h.template make-combine.pl
-	$(PERL) $(srcdir)/make-combine.pl 8 < $(srcdir)/pixman-combine.h.template > $@ || ($(RM) $@; exit 1)
-
-pixman-combine64.c : pixman-combine.c.template pixman-combine64.h make-combine.pl
-	$(PERL) $(srcdir)/make-combine.pl 16 < $(srcdir)/pixman-combine.c.template > $@ || ($(RM) $@; exit 1)
-pixman-combine64.h : pixman-combine.h.template make-combine.pl
-	$(PERL) $(srcdir)/make-combine.pl 16 < $(srcdir)/pixman-combine.h.template > $@ || ($(RM) $@; exit 1)
+EXTRA_DIST =				\
+	Makefile.win32			\
+	make-combine.pl			\
+	pixman-combine.c.template	\
+	pixman-combine.h.template	\
+	pixman-region.c			\
+	solaris-hwcap.mapfile		\
+	$(NULL)
 
-EXTRA_DIST = Makefile.win32 pixman-combine.c.template make-combine.pl pixman-region.c \
-	pixman-combine.h.template solaris-hwcap.mapfile
-CLEANFILES = pixman-combine32.c pixman-combine64.c pixman-combine32.h pixman-combine64.h
+DISTCLEANFILES = $(BUILT_SOURCES)
 
 # mmx code
 if USE_MMX
diff --git a/pixman/Makefile.sources b/pixman/Makefile.sources
new file mode 100644
index 0000000..ca3f001
--- /dev/null
+++ b/pixman/Makefile.sources
@@ -0,0 +1,55 @@
+libpixman_sources =			\
+	pixman.c			\
+	pixman-access.c			\
+	pixman-access-accessors.c	\
+	pixman-bits-image.c		\
+	pixman-combine32.c		\
+	pixman-combine64.c		\
+	pixman-conical-gradient.c	\
+	pixman-cpu.c			\
+	pixman-edge.c			\
+	pixman-edge-accessors.c		\
+	pixman-fast-path.c		\
+	pixman-general.c		\
+	pixman-gradient-walker.c	\
+	pixman-image.c			\
+	pixman-implementation.c		\
+	pixman-linear-gradient.c	\
+	pixman-matrix.c			\
+	pixman-noop.c			\
+	pixman-radial-gradient.c	\
+	pixman-region16.c		\
+	pixman-region32.c		\
+	pixman-solid-fill.c		\
+	pixman-timer.c			\
+	pixman-trap.c			\
+	pixman-utils.c			\
+	$(NULL)
+
+libpixman_headers =			\
+	pixman.h			\
+	pixman-accessor.h		\
+	pixman-combine32.h		\
+	pixman-combine64.h		\
+	pixman-compiler.h		\
+	pixman-edge-imp.h		\
+	pixman-inlines.h		\
+	pixman-private.h		\
+	$(NULL)
+
+BUILT_SOURCES =				\
+	pixman-combine32.c		\
+	pixman-combine32.h		\
+	pixman-combine64.c		\
+	pixman-combine64.h		\
+	$(NULL)
+
+pixman-combine32.c: pixman-combine.c.template make-combine.pl
+	$(PERL) $(lastword $+) 8 < $< > $@ || ($(RM) $@; exit 1)
+pixman-combine32.h: pixman-combine.h.template make-combine.pl
+	$(PERL) $(lastword $+) 8 < $< > $@ || ($(RM) $@; exit 1)
+
+pixman-combine64.c: pixman-combine.c.template make-combine.pl
+	$(PERL) $(lastword $+) 16 < $< > $@ || ($(RM) $@; exit 1)
+pixman-combine64.h: pixman-combine.h.template make-combine.pl
+	$(PERL) $(lastword $+) 16 < $< > $@ || ($(RM) $@; exit 1)
diff --git a/pixman/Makefile.win32 b/pixman/Makefile.win32
index 7c92722..d2d018a 100644
--- a/pixman/Makefile.win32
+++ b/pixman/Makefile.win32
@@ -1,7 +1,13 @@
+default: all
+
+top_srcdir = ..
+include $(top_srcdir)/pixman/Makefile.sources
+
 LIBRARY     = pixman-1
 
 CC   = cl
 LINK = link
+PERL = perl
 
 CFG_VAR = $(CFG)
 ifeq ($(CFG_VAR),)
@@ -29,49 +35,19 @@ else
 CFLAGS += -O2
 endif
 
-SOURCES =				\
-	pixman-image.c			\
-	pixman-access.c			\
-	pixman-access-accessors.c	\
-	pixman-region16.c		\
-	pixman-region32.c		\
-	pixman-combine32.c		\
-	pixman-combine64.c		\
-	pixman-utils.c			\
-	pixman-edge.c			\
-	pixman-edge-accessors.c		\
-	pixman-trap.c			\
-	pixman-timer.c			\
-	pixman-matrix.c			\
-	pixman-gradient-walker.c	\
-	pixman-conical-gradient.c	\
-	pixman-linear-gradient.c	\
-	pixman-radial-gradient.c	\
-	pixman-bits-image.c		\
-	pixman.c			\
-	pixman-noop.c			\
-	pixman-cpu.c			\
-	pixman-fast-path.c		\
-	pixman-implementation.c		\
-	pixman-solid-fill.c		\
-	pixman-general.c		\
-	$(NULL)
-
-BUILT_SOURCES = pixman-combine32.h pixman-combine32.c pixman-combine64.h pixman-combine64.c
-
 # MMX compilation flags
 ifeq ($(MMX_VAR),on)
 CFLAGS += $(MMX_CFLAGS)
-SOURCES += pixman-mmx.c
+libpixman_sources += pixman-mmx.c
 endif
 
 # SSE2 compilation flags
 ifeq ($(SSE2_VAR),on)
 CFLAGS += $(SSE2_CFLAGS)
-SOURCES += pixman-sse2.c
+libpixman_sources += pixman-sse2.c
 endif
 
-OBJECTS     = $(patsubst %.c, $(CFG_VAR)/%.obj, $(SOURCES))
+OBJECTS = $(patsubst %.c, $(CFG_VAR)/%.obj, $(libpixman_sources))
 
 # targets
 all: inform informMMX informSSE2 $(CFG_VAR)/$(LIBRARY).lib
@@ -132,16 +108,6 @@ $(CFG_VAR)/%.obj: %.c $(BUILT_SOURCES)
 $(CFG_VAR)/$(LIBRARY).lib: $(OBJECTS)
 	lib -NOLOGO -OUT:$@ $(OBJECTS) || exit 0
 
-pixman-combine32.c: pixman-combine.c.template pixman-combine32.h make-combine.pl
-	perl ./make-combine.pl 8 < $< > $@ || ($(RM) $@; exit 1)
-pixman-combine32.h: pixman-combine.h.template make-combine.pl
-	perl ./make-combine.pl 8 < $< > $@ || ($(RM) $@; exit 1)
-
-pixman-combine64.c: pixman-combine.c.template pixman-combine64.h make-combine.pl
-	perl ./make-combine.pl 16 < $< > $@ || ($(RM) $@; exit 1)
-pixman-combine64.h: pixman-combine.h.template make-combine.pl
-	perl ./make-combine.pl 16 < $< > $@ || ($(RM) $@; exit 1)
-
 clean_r:
 	@rm -f $(CFG_VAR)/*.obj $(CFG_VAR)/*.lib $(CFG_VAR)/*.pdb $(CFG)/*.ilk || exit 0
 	@rm -f $(CFG)/*.obj $(CFG)/*.lib $(CFG)/*.pdb $(CFG)/*.ilk $(BUILT_SOURCES) || exit 0
commit 25bd96a3d0e935646d54c938bf065696d3a79e07
Author: Andrea Canciani <ranma42 at gmail.com>
Date:   Sun Sep 4 20:07:57 2011 +0200

    test: Fix compilation on win32
    
    Adding scaling-helpers-test to the testsuite on win32 makes MSVC
    complain about int64_t being used as an expression:
    
    scaling-helpers-test.c(27) : error C2275: 'int64_t' : illegal use of
    this type as an expression

diff --git a/test/scaling-helpers-test.c b/test/scaling-helpers-test.c
index a38cac5..eb436d1 100644
--- a/test/scaling-helpers-test.c
+++ b/test/scaling-helpers-test.c
@@ -20,12 +20,12 @@ bilinear_pad_repeat_get_scanline_bounds_ref (int32_t        source_image_width,
 					     int32_t *      right_pad)
 {
     int w = *width;
+    int64_t vx = vx_;
     *left_pad = 0;
     *left_tz = 0;
     *width = 0;
     *right_tz = 0;
     *right_pad = 0;
-    int64_t vx = vx_;
     while (--w >= 0)
     {
 	if (vx < 0)


More information about the xorg-commit mailing list