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
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
|
LIBRARY = pixman-1
CC = cl
LINK = link
CFG_VAR = $(CFG)
ifeq ($(CFG_VAR),)
CFG_VAR=release
endif
MMX_VAR = $(MMX)
ifeq ($(MMX_VAR),)
MMX_VAR=on
endif
SSE2_VAR = $(SSE2)
ifeq ($(SSE2_VAR),)
SSE2_VAR=on
endif
CFLAGS = -MD -nologo -D_CRT_SECURE_NO_DEPRECATE -D_CRT_NONSTDC_NO_DEPRECATE -I../pixman/src -I. -DPACKAGE=$(LIBRARY) -DPACKAGE_VERSION="" -DPACKAGE_BUGREPORT=""
MMX_CFLAGS = -DUSE_MMX -w14710 -w14714
SSE2_CFLAGS = -DUSE_SSE2
# optimization flags
ifeq ($(CFG_VAR),debug)
CFLAGS += -Od -Zi
else
CFLAGS += -O2
endif
SOURCES = \
pixman-image.c \
pixman-access.c \
pixman-access-accessors.c \
pixman-region16.c \
pixman-region32.c \
pixman-compose.c \
pixman-compose-accessors.c \
pixman-combine32.c \
pixman-combine64.c \
pixman-pict.c \
pixman-source.c \
pixman-transformed.c \
pixman-transformed-accessors.c \
pixman-utils.c \
pixman-edge.c \
pixman-edge-accessors.c \
pixman-trap.c \
pixman-compute-region.c \
pixman-timer.c \
$(NULL)
# MMX compilation flags
ifeq ($(MMX_VAR),on)
CFLAGS += $(MMX_CFLAGS)
SOURCES += pixman-mmx.c
endif
# SSE2 compilation flags
ifeq ($(SSE2_VAR),on)
CFLAGS += $(SSE2_CFLAGS)
SOURCES += pixman-sse2.c
endif
OBJECTS = $(patsubst %.c, $(CFG_VAR)/%.obj, $(SOURCES))
# targets
all: inform informMMX informSSE2 $(CFG_VAR)/$(LIBRARY).lib
@exit 0
clean: inform clean_r
@exit 0
pixman: inform informMMX informSSE2 $(CFG_VAR)/$(LIBRARY).lib
@exit 0
inform:
ifneq ($(CFG),release)
ifneq ($(CFG),debug)
ifneq ($(CFG),)
@echo "Invalid specified configuration option : "$(CFG)"."
@echo
@echo -n "Possible choices for configuration are "
@echo "'release' and 'debug'"
@echo ""
@exit 1
endif
@echo "Using default RELEASE configuration... (use CFG=release or CFG=debug)"
endif
endif
informMMX:
ifneq ($(MMX),off)
ifneq ($(MMX),on)
ifneq ($(MMX),)
@echo "Invalid specified MMX option : "$(MMX_VAR)"."
@echo
@echo -n "Possible choices for MMX are 'on' or 'off'"
@echo ""
@exit 1
endif
@echo "Setting MMX flag to default value 'on'... (use MMX=on or MMX=off)"
endif
endif
informSSE2:
ifneq ($(SSE2),off)
ifneq ($(SSE2),on)
ifneq ($(SSE2),)
@echo "Invalid specified SSE option : "$(SSE2)"."
@echo
@echo -n "Possible choices for SSE2 are 'on' or 'off'"
@echo ""
@exit 1
endif
@echo "Setting SSE2 flag to default value 'on'... (use SSE2=on or SSE2=off)"
endif
endif
# pixman compilation and linking
$(CFG_VAR)/%.obj: %.c
@mkdir -p $(CFG_VAR)
@$(CC) -c $(CFLAGS) -Fo"$@" $<
$(CFG_VAR)/$(LIBRARY).lib: $(OBJECTS)
lib -NOLOGO -OUT:$@ $(OBJECTS) || exit 0
pixman-combine32.c: combine.inc pixman-combine32.h combine.pl
perl ./combine.pl 8 < $< > $@ || ($(RM) $@; exit 1)
pixman-combine32.h: combine.h.inc combine.pl
perl ./combine.pl 8 < $< > $@ || ($(RM) $@; exit 1)
pixman-combine64.c: combine.inc pixman-combine64.h combine.pl
perl ./combine.pl 16 < $< > $@ || ($(RM) $@; exit 1)
pixman-combine64.h: combine.h.inc combine.pl
perl ./combine.pl 16 < $< > $@ || ($(RM) $@; exit 1)
clean_r:
@rm -f $(CFG_VAR)/*.obj $(CFG_VAR)/*.lib $(CFG_VAR)/*.pdb $(CFG)/*.ilk || exit 0
@rm -f $(CFG)/*.obj $(CFG)/*.lib $(CFG)/*.pdb $(CFG)/*.ilk pixman-combine32.c pixman-combine64.c || exit 0
|