summaryrefslogtreecommitdiff
path: root/build/Makefile.win32.common
blob: d00f554b6c50c0b26c17cbd4df7d4962a7768c5a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
default: all

#
# Edit build/Makefile.win32.features to enable features to build
#
include $(top_srcdir)/build/Makefile.win32.features

ifeq ($(top_builddir),)
top_builddir = $(top_srcdir)
endif

CC := cl
LINK := link

ifeq ($(CFG),debug)
OPT := -Od -Zi
else
OPT := -O2
endif

PIXMAN_CFLAGS := -I$(top_srcdir)/../pixman/pixman
PIXMAN_LIBS := $(top_builddir)/../pixman/pixman/$(CFG)/pixman-1.lib

CAIRO_LIBS =  gdi32.lib msimg32.lib user32.lib
ifeq ($(CAIRO_HAS_PNG_FUNCTIONS),1)
CAIRO_LIBS += libpng.lib
endif
ifeq ($(CAIRO_HAS_PS_SURFACE)$(CAIRO_HAS_PDF_SURFACE),00)
else
CAIRO_LIBS += zdll.lib
endif

DEFAULT_CFLAGS = -MD -nologo $(OPT)
DEFAULT_CFLAGS += -D_CRT_SECURE_NO_DEPRECATE -D_CRT_NONSTDC_NO_DEPRECATE
DEFAULT_CFLAGS += -I. -I$(top_srcdir)
DEFAULT_CFLAGS += $(PIXMAN_CFLAGS)

CAIRO_CFLAGS = $(DEFAULT_CFLAGS) $(CFLAGS)

inform:
	@echo
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) $(CAIRO_CFLAGS) -c -Fo"$@" $<

$(CFG)/%-static.obj: %.c
	@mkdir -p $(CFG)
	@$(CC) $(CAIRO_CFLAGS) -c -DCAIRO_WIN32_STATIC_BUILD=1 -Fo"$@" $<

clean:
	@rm -f $(CFG)/*.obj $(CFG)/*.dll $(CFG)/*.lib $(CFG)/*.pdb $(CFG)/*.ilk || exit 0