summaryrefslogtreecommitdiff
path: root/src/Makefile.win32
diff options
context:
space:
mode:
authorVladimir Vukicevic <vladimir@pobox.com>2006-09-09 17:08:18 -0700
committerU-CYCLONE\Vladimir Vukicevic <vladimir@cyclone.(none)>2006-09-09 17:08:18 -0700
commit0e59041321e49e1eae330567e0c7d27e7d71699d (patch)
treeebd31fe97c852485dbc9b117d408a83cc6198da6 /src/Makefile.win32
parent3c5a02c3edf300494cebfe746292b1eeeea08595 (diff)
[win32] win32-specific Makefiles for building with MSVC
This patch adds a bunch of makefiles for building cairo with Visual C++. gnu make is still required, and make must be run from a command prompt that has the Visual C++ paths set up, as well as has the cygwin environment in the path. Run 'make -f Makefile.win32'.
Diffstat (limited to 'src/Makefile.win32')
-rw-r--r--src/Makefile.win32107
1 files changed, 107 insertions, 0 deletions
diff --git a/src/Makefile.win32 b/src/Makefile.win32
new file mode 100644
index 00000000..50b419df
--- /dev/null
+++ b/src/Makefile.win32
@@ -0,0 +1,107 @@
+CC = cl
+LINK = link
+
+CFLAGS = /Zi /nologo /O2 /c /D_CRT_SECURE_NO_DEPRECATE /D_CRT_NONSTDC_NO_DEPRECATE /I../pixman/src /I. /DPACKAGE_VERSION="" /DPACKAGE_BUGREPORT=""
+
+DEFFILE = cairo.def
+srcdir = `pwd`
+
+SOURCES = \
+ cairo-arc.c \
+ cairo-array.c \
+ cairo-cache.c \
+ cairo-clip.c \
+ cairo-color.c \
+ cairo-debug.c \
+ cairo-fixed.c \
+ cairo-font-options.c \
+ cairo-font.c \
+ cairo-gstate.c \
+ cairo-hash.c \
+ cairo-hull.c \
+ cairo-image-surface.c \
+ cairo-lzw.c \
+ cairo-matrix.c \
+ cairo-meta-surface.c \
+ cairo-output-stream.c \
+ cairo-operator.c \
+ cairo-path-bounds.c \
+ cairo-path-data.c \
+ cairo-path-fill.c \
+ cairo-path-stroke.c \
+ cairo-path.c \
+ cairo-pattern.c \
+ cairo-pen.c \
+ cairo-polygon.c \
+ cairo-png.c \
+ cairo-rectangle.c \
+ cairo-region.c \
+ cairo-scaled-font.c \
+ cairo-slope.c \
+ cairo-spline.c \
+ cairo-stroke-style.c \
+ cairo-surface-fallback.c \
+ cairo-surface.c \
+ cairo-traps.c \
+ cairo-truetype-subset.c \
+ cairo-type1-fallback.c \
+ cairo-unicode.c \
+ cairo-wideint.c \
+ cairo-win32-font.c \
+ cairo.c \
+ cairo-svg-surface.c \
+ cairo-ps-surface.c \
+ cairo-pdf-surface.c \
+ cairo-scaled-font-subsets.c \
+ cairo-paginated-surface.c \
+ cairo-analysis-surface.c \
+ cairo-base85-stream.c \
+ $(NULL)
+
+STATIC_SOURCES = cairo-win32-surface.c
+
+cairo_headers = \
+ cairo.h \
+ cairo-pdf.h \
+ cairo-ps.h \
+ cairo-svg.h \
+ cairo-win32.h \
+ cairo-pdf-test.h \
+ cairo-ps-test.h \
+ cairo-scaled-font-test.h \
+ cairo-svg-test.h \
+ $(NULL)
+
+OBJECTS = $(subst .c,.obj,$(SOURCES))
+SHARED_OBJECTS = $(subst .c,.obj,$(STATIC_SOURCES))
+STATIC_OBJECTS = $(subst .c,-static.obj,$(STATIC_SOURCES))
+
+all: cairo.dll cairo-static.lib
+
+%.obj: %.c
+ @$(CC) $(CFLAGS) /Fo"$@" $<
+
+%-static.obj: %.c
+ @$(CC) $(CFLAGS) /DCAIRO_WIN32_STATIC_BUILD=1 /Fo"$@" $<
+
+$(DEFFILE):
+ (echo EXPORTS; \
+ (cd $(srcdir); cat $(cairo_headers) || echo 'cairo_ERROR ()' ) | \
+ grep -v -E '^# *include' | \
+ ( gcc -include cairo-features.h -E - || echo 'cairo_ERROR ()' ) | \
+ grep -E '^_?cairo_.* \(' | \
+ sed -e 's/[ ].*//' | \
+ sort; \
+ echo LIBRARY cairo.dll; \
+ ) >$@
+ @ ! grep -q cairo_ERROR $@ || ($(RM) $@; false)
+
+cairo.dll: $(OBJECTS) $(SHARED_OBJECTS) $(DEFFILE)
+ $(CC) /Zi /LD /Fe$@ ../pixman/src/pixman.lib $(OBJECTS) $(SHARED_OBJECTS) /link /DEF:$(DEFFILE) user32.lib gdi32.lib libpng.lib zlib.lib /NODEFAULTLIB:LIBCMT
+
+cairo-static.lib: $(OBJECTS) $(STATIC_OBJECTS)
+ lib /NOLOGO /OUT:$@ ../pixman/src/pixman.lib $(OBJECTS) $(STATIC_OBJECTS)
+
+
+clean:
+ @rm -f *.obj || rm -f *.dll || rm -f *.lib || rm -f *.exe || rm -f *.exe.manifest || rm -f *.pdb || rm -f *.ilk || exit 0