summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBehdad Esfahbod <behdad@behdad.org>2008-09-22 19:43:08 -0400
committerBehdad Esfahbod <behdad@behdad.org>2008-09-22 20:11:38 -0400
commit0ac7a242f829bd31fd7fe12e886fba687ea6dc5e (patch)
tree42f3a2521d4c2ada6d5bf5677534cd334b553838
parent984320dff11d42d698ff5355c6befe0c5d32df59 (diff)
[build] Add Makefile.win32.common
-rw-r--r--Makefile.win3257
-rw-r--r--boilerplate/Makefile.win3221
-rw-r--r--build/Makefile.win32.common47
-rw-r--r--perf/Makefile.win3226
-rw-r--r--src/Makefile.win3223
-rw-r--r--test/Makefile.win3222
-rw-r--r--test/pdiff/Makefile.win326
7 files changed, 60 insertions, 142 deletions
diff --git a/Makefile.win32 b/Makefile.win32
index e1a78a4e9..1e80365c2 100644
--- a/Makefile.win32
+++ b/Makefile.win32
@@ -1,34 +1,7 @@
-#
-# Win32 makefile
-#
-
-CC := cl
-LINK := link
-
-ifeq ($(CFG),debug)
-OPT := -Od -Zi
-else
-OPT := -O2
-endif
-
-PIXMAN_CFLAGS := -I../../pixman/pixman
-PIXMAN_LIBS := ../../pixman/pixman/$(CFG)/pixman-1.lib
-
-EXE_LDFLAGS = libpng.lib zlib.lib gdi32.lib msimg32.lib user32.lib
-
-DEFAULT_CFLAGS = -MD -nologo $(OPT)
-DEFAULT_CFLAGS += -D_CRT_SECURE_NO_DEPRECATE -D_CRT_NONSTDC_NO_DEPRECATE
-DEFAULT_CFLAGS += -I.
-DEFAULT_CFLAGS += $(PIXMAN_CFLAGS)
-
-CFLAGS := $(DEFAULT_CFLAGS)
-
-
-# Only if this was called as the top-level makefile
-ifeq ($(SUBMAKEFILE),)
+top_srcdir = .
+include $(top_srcdir)/build/Makefile.win32.common
SUBDIRS = src
-
TEST_SUBDIRS = boilerplate test
all: inform cairo
@@ -52,29 +25,3 @@ test: cairo
html:
@(cd test ; make -f Makefile.win32 html)
-
-inform:
-ifneq ($(CFG),release)
-ifneq ($(CFG),debug)
- @echo "Invalid configuration "$(CFG)" specified."
- @echo -n "You must specify a configuration when "
- @echo "running make, e.g. make CFG=debug"
- @echo
- @echo -n "Possible choices for configuration are "
- @echo "'release' and 'debug'"
- @exit 1
-endif
-endif
-
-endif
-
-# Some generic rules
-
-$(CFG)/%.obj: %.c
- @mkdir -p $(CFG)
- @$(CC) $(CFLAGS) -c -Fo"$@" $<
-
-$(CFG)/%-static.obj: %.c
- @mkdir -p $(CFG)
- @$(CC) $(CFLAGS) -c -DCAIRO_WIN32_STATIC_BUILD=1 -Fo"$@" $<
-
diff --git a/boilerplate/Makefile.win32 b/boilerplate/Makefile.win32
index b1fcf3650..4ea9a52e3 100644
--- a/boilerplate/Makefile.win32
+++ b/boilerplate/Makefile.win32
@@ -1,6 +1,5 @@
-SUBMAKEFILE = 1
-
-include ../Makefile.win32
+top_srcdir = ..
+include $(top_srcdir)/build/Makefile.win32.common
include Makefile.win32.config
CFLAGS += -I../src
@@ -18,19 +17,3 @@ all: $(CFG)/boiler.lib
$(CFG)/boiler.lib: $(OBJECTS)
lib -NOLOGO -OUT:$@ $(OBJECTS) $(WIN_LIBS)
-
-clean:
- @rm -f $(CFG)/*.obj $(CFG)/*.dll $(CFG)/*.lib $(CFG)/*.pdb $(CFG)/*.ilk || exit 0
-
-inform:
-ifneq ($(CFG),release)
-ifneq ($(CFG),debug)
- @echo "Invalid configuration "$(CFG)" specified."
- @echo -n "You must specify a configuration when "
- @echo "running make, e.g. make CFG=debug"
- @echo
- @echo -n "Possible choices for configuration are "
- @echo "'release' and 'debug'"
- @exit 1
-endif
-endif
diff --git a/build/Makefile.win32.common b/build/Makefile.win32.common
new file mode 100644
index 000000000..09cafa9be
--- /dev/null
+++ b/build/Makefile.win32.common
@@ -0,0 +1,47 @@
+
+CC := cl
+LINK := link
+
+ifeq ($(CFG),debug)
+OPT := -Od -Zi
+else
+OPT := -O2
+endif
+
+PIXMAN_CFLAGS := -I../../pixman/pixman
+PIXMAN_LIBS := ../../pixman/pixman/$(CFG)/pixman-1.lib
+
+EXE_LDFLAGS = libpng.lib zlib.lib gdi32.lib msimg32.lib user32.lib
+
+DEFAULT_CFLAGS = -MD -nologo $(OPT)
+DEFAULT_CFLAGS += -D_CRT_SECURE_NO_DEPRECATE -D_CRT_NONSTDC_NO_DEPRECATE
+DEFAULT_CFLAGS += -I.
+DEFAULT_CFLAGS += $(PIXMAN_CFLAGS)
+
+CFLAGS := $(DEFAULT_CFLAGS)
+
+inform:
+ifneq ($(CFG),release)
+ifneq ($(CFG),debug)
+ @echo "Invalid configuration "$(CFG)" specified."
+ @echo -n "You must specify a configuration when "
+ @echo "running make, e.g. make CFG=debug"
+ @echo
+ @echo -n "Possible choices for configuration are "
+ @echo "'release' and 'debug'"
+ @exit 1
+endif
+endif
+
+# Some generic rules
+
+$(CFG)/%.obj: %.c
+ @mkdir -p $(CFG)
+ @$(CC) $(CFLAGS) -c -Fo"$@" $<
+
+$(CFG)/%-static.obj: %.c
+ @mkdir -p $(CFG)
+ @$(CC) $(CFLAGS) -c -DCAIRO_WIN32_STATIC_BUILD=1 -Fo"$@" $<
+
+clean:
+ @rm -f $(CFG)/*.obj $(CFG)/*.dll $(CFG)/*.lib $(CFG)/*.pdb $(CFG)/*.ilk || exit 0
diff --git a/perf/Makefile.win32 b/perf/Makefile.win32
index 37b514396..47e73c4e4 100644
--- a/perf/Makefile.win32
+++ b/perf/Makefile.win32
@@ -1,11 +1,5 @@
-#
-# Win32 makefile
-#
-
-
-SUBMAKEFILE = 1
-
-include ../Makefile.win32
+top_srcdir = ..
+include $(top_srcdir)/build/Makefile.win32.common
LDFLAGS += ../src/$(CFG)/cairo-static.lib $(PIXMAN_LIBS) ../boilerplate/$(CFG)/boiler.lib $(EXE_LDFLAGS)
@@ -44,19 +38,3 @@ $(CFG)/cairo-perf.exe: $(OBJECTS)
cairo-perf-diff-files:
@mkdir -p $(CFG)
@$(CC) $(CFLAGS) -Fe"$@" cairo-perf-diff-files.c cairo-stats.c -link $(LDFLAGS)
-
-clean:
- @rm -f $(CFG)/*.obj $(CFG)/*.exe $(CFG)/*.dll $(CFG)/*.lib $(CFG)/*.pdb $(CFG)/*.ilk || exit 0
-
-inform:
-ifneq ($(CFG),release)
-ifneq ($(CFG),debug)
- @echo "Invalid configuration "$(CFG)" specified."
- @echo -n "You must specify a configuration when "
- @echo "running make, e.g. make CFG=debug"
- @echo
- @echo -n "Possible choices for configuration are "
- @echo "'release' and 'debug'"
- @exit 1
-endif
-endif
diff --git a/src/Makefile.win32 b/src/Makefile.win32
index b57478db6..6f4e89d85 100644
--- a/src/Makefile.win32
+++ b/src/Makefile.win32
@@ -1,7 +1,6 @@
-SUBMAKEFILE = 1
-
-include ../Makefile.win32
-include Makefile.win32.config
+top_srcdir = ..
+include $(top_srcdir)/build/Makefile.win32.common
+include Makefile.win32.features
SOURCES = $(enabled_cairo_sources)
@@ -19,19 +18,3 @@ $(CFG)/cairo.dll: $(OBJECTS)
$(CFG)/cairo-static.lib: $(OBJECTS) $(STATIC_OBJECTS)
lib -NOLOGO -OUT:$@ $(PIXMAN_LIBS) $(OBJECTS) $(STATIC_OBJECTS)
-
-clean:
- @rm -f $(CFG)/*.obj $(CFG)/*.dll $(CFG)/*.lib $(CFG)/*.pdb $(CFG)/*.ilk || exit 0
-
-inform:
-ifneq ($(CFG),release)
-ifneq ($(CFG),debug)
- @echo "Invalid configuration "$(CFG)" specified."
- @echo -n "You must specify a configuration when "
- @echo "running make, e.g. make CFG=debug"
- @echo
- @echo -n "Possible choices for configuration are "
- @echo "'release' and 'debug'"
- @exit 1
-endif
-endif
diff --git a/test/Makefile.win32 b/test/Makefile.win32
index e8fea2880..003d96a23 100644
--- a/test/Makefile.win32
+++ b/test/Makefile.win32
@@ -1,7 +1,5 @@
-
-SUBMAKEFILE = 1
-
-include ../Makefile.win32
+top_srcdir = ..
+include $(top_srcdir)/build/Makefile.win32.common
CFLAGS += -I../src -I../boilerplate -I./pdiff
@@ -121,19 +119,3 @@ test: $(TEST_EXE)
html:
@echo Creating index.html...
@perl make-html.pl > index.html
-
-clean:
- @rm -f $(CFG)/*.obj $(CFG)/*.dll $(CFG)/*.lib $(CFG)/*.pdb $(CFG)/*.ilk $(CFG)/*.exe || exit 0
-
-inform:
-ifneq ($(CFG),release)
-ifneq ($(CFG),debug)
- @echo "Invalid configuration "$(CFG)" specified."
- @echo -n "You must specify a configuration when "
- @echo "running make, e.g. make CFG=debug"
- @echo
- @echo -n "Possible choices for configuration are "
- @echo "'release' and 'debug'"
- @exit 1
-endif
-endif
diff --git a/test/pdiff/Makefile.win32 b/test/pdiff/Makefile.win32
index fccd7e944..5e6680dd5 100644
--- a/test/pdiff/Makefile.win32
+++ b/test/pdiff/Makefile.win32
@@ -1,7 +1,5 @@
-
-SUBMAKEFILE = 1
-
-include ../../Makefile.win32
+top_srcdir = ../..
+include $(top_srcdir)/build/Makefile.win32.common
CFLAGS += -I../../src