build: Improve win32 build system

Handle cross-directory dependencies using PHONY targets and clean up
some redundancies.
This commit is contained in:
Andrea Canciani
2012-06-21 06:07:07 +02:00
parent c89efdd211
commit 46e4faf8ef
4 changed files with 19 additions and 11 deletions

View 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

View 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

View File

@@ -64,3 +64,5 @@ endif
# pixman linking
$(CFG_VAR)/$(LIBRARY).lib: $(OBJECTS)
@$(AR) $(PIXMAN_ARFLAGS) -OUT:$@ $^
.PHONY: all informMMX informSSE2

View 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