[cairo] Patch for enabling debug or release versions in Pixman's Windows makefiles
Antoine Azar
cairo at antoineazar.com
Sat Jan 19 16:26:39 PST 2008
This is Pixman's patch.
From ecac2f6233d4ecb1b9e37f2ca1a51baf82fda65f Mon Sep 17 00:00:00 2001
From: unknown <Antoine Azar at .(none)>
Date: Sat, 19 Jan 2008 19:23:37 -0500
Subject: [PATCH] Makefile support for debug and release configurations
---
pixman/Makefile.win32 | 37 ++++++++++++++++++++++++++++++++-----
1 files changed, 32 insertions(+), 5 deletions(-)
diff --git a/pixman/Makefile.win32 b/pixman/Makefile.win32
index e0a1828..510b74c 100644
--- a/pixman/Makefile.win32
+++ b/pixman/Makefile.win32
@@ -3,7 +3,17 @@ LIBRARY = pixman-1
CC = cl
LINK = link
-CFLAGS = -MD -Zi -nologo -O2 -D_CRT_SECURE_NO_DEPRECATE
-D_CRT_NONSTDC_NO_DEPRECATE -I../pixman/src -I. -DPACKAGE=$(LIBRARY)
-DPACKAGE_VERSION="" -DPACKAGE_BUGREPORT=""
+ifeq ($(CFG),)
+CFG=release
+endif
+
+CFLAGS = -MD -nologo -D_CRT_SECURE_NO_DEPRECATE
-D_CRT_NONSTDC_NO_DEPRECATE -I../pixman/src -I. -DPACKAGE=$(LIBRARY)
-DPACKAGE_VERSION="" -DPACKAGE_BUGREPORT=""
+
+ifeq ($(CFG),debug)
+CFLAGS += -Od -Zi
+else
+CFLAGS += -O2
+endif
SOURCES = \
pixman-region.c \
@@ -19,13 +29,30 @@ SOURCES = \
pixman-timer.c \
$(NULL)
-OBJECTS = $(subst .c,.obj,$(SOURCES))
+OBJECTS = $(patsubst %.c, $(CFG)/%.obj, $(SOURCES))
+
+all: inform $(CFG)/$(LIBRARY).lib
-%.obj: %.c
+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
+
+$(CFG)/%.obj: %.c
+ @mkdir -p $(CFG)
@$(CC) -c $(CFLAGS) -Fo"$@" $<
-$(LIBRARY).lib: $(OBJECTS)
+$(CFG)/$(LIBRARY).lib: $(OBJECTS)
lib -NOLOGO -OUT:$@ $(OBJECTS)
+
clean:
- @rm -f *.obj *.lib *.pdb *.ilk || exit 0
+ @rm -f $(CFG)/*.obj $(CFG)/*.lib $(CFG)/*.pdb $(CFG)/*.ilk || exit 0
--
1.5.4.rc3.941.gebb79
More information about the cairo
mailing list