mirror of
https://github.com/SwallowOS/image_pixman
synced 2025-11-04 05:35:47 +08:00
build: Improve win32 build system
Handle cross-directory dependencies using PHONY targets and clean up some redundancies.
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -64,3 +64,5 @@ endif
|
||||
# pixman linking
|
||||
$(CFG_VAR)/$(LIBRARY).lib: $(OBJECTS)
|
||||
@$(AR) $(PIXMAN_ARFLAGS) -OUT:$@ $^
|
||||
|
||||
.PHONY: all informMMX informSSE2
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user