build: Improve win32 build system
authorAndrea Canciani <ranma42@gmail.com>
Thu, 21 Jun 2012 04:07:07 +0000 (06:07 +0200)
committerAndrea Canciani <ranma42@gmail.com>
Sat, 15 Sep 2012 05:49:53 +0000 (07:49 +0200)
Handle cross-directory dependencies using PHONY targets and clean up
some redundancies.

Makefile.win32
Makefile.win32.common
pixman/Makefile.win32
test/Makefile.win32

index 91cd12a..c3ca3bc 100644 (file)
@@ -3,23 +3,23 @@ default: all
 top_srcdir = .
 include $(top_srcdir)/Makefile.win32.common
 
-# Recursive targets
-pixman_r:
+all: pixman test
+
+pixman:
        @$(MAKE) -C pixman -f Makefile.win32
 
-test_r:
+test:
        @$(MAKE) -C test -f Makefile.win32
 
 clean_r:
        @$(MAKE) -C pixman -f Makefile.win32 clean
        @$(MAKE) -C test   -f Makefile.win32 clean
 
-check_r:
+check:
        @$(MAKE) -C test -f Makefile.win32 check
 
-# Base targets
-all: test_r
 
 clean: clean_r
 
-check: check_r
+
+.PHONY: all pixman test clean check
index 56c3593..777f94c 100644 (file)
@@ -46,9 +46,11 @@ endif
 endif
 
 
-$(CFG_VAR)/%.obj: %.c $(BUILT_SOURCES)
+$(CFG_VAR)/%.obj: %.c $(libpixman_headers)
        @mkdir -p $(CFG_VAR)
        @$(CC) -c $(PIXMAN_CFLAGS) -Fo"$@" $<
 
 clean: inform
        @$(RM) $(CFG_VAR)/*.{exe,ilk,lib,obj,pdb} $(BUILT_SOURCES) || exit 0
+
+.PHONY: inform clean
index 381f2cd..57ed7a5 100644 (file)
@@ -64,3 +64,5 @@ endif
 # pixman linking
 $(CFG_VAR)/$(LIBRARY).lib: $(OBJECTS)
        @$(AR) $(PIXMAN_ARFLAGS) -OUT:$@ $^
+
+.PHONY: all informMMX informSSE2
index c88d087..b6254a3 100644 (file)
@@ -16,9 +16,9 @@ OBJECTS = $(patsubst %.c, $(CFG_VAR)/%.obj, $(SOURCES))
 TESTS   = $(patsubst %,   $(CFG_VAR)/%.exe, $(TESTPROGRAMS))
 BENCHS  = $(patsubst %,   $(CFG_VAR)/%.exe, $(BENCHMARKS))
 
-all: inform $(TESTS) $(BENCHS)
+all: pixman inform $(TESTS) $(BENCHS)
 
-check: inform $(TESTS)
+check: pixman inform $(TESTS)
        @failures=0 ; \
        total=0 ; \
        for test in $(TESTS) ; \
@@ -46,5 +46,9 @@ $(CFG_VAR)/libutils.lib: $(libutils_OBJECTS)
 $(CFG_VAR)/%.exe: $(CFG_VAR)/%.obj $(TEST_LDADD)
        @$(LD) $(PIXMAN_LDFLAGS) -OUT:$@ $^
 
-$(top_builddir)/pixman/$(CFG_VAR)/$(LIBRARY).lib:
+$(top_builddir)/pixman/$(CFG_VAR)/$(LIBRARY).lib: pixman
+
+pixman:
        @$(MAKE) -C $(top_builddir)/pixman -f Makefile.win32
+
+.PHONY: all check pixman