blob: 6b8746d5f9199a160d67a22e28be9258cb9a0adc (
plain) (
blame)
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
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
|
.POSIX:
LIB_MAJOR = 0
LIB_MINOR = 8
LIB_VERSION = $(LIB_MAJOR).$(LIB_MINOR)
X_RANDR_METHOD = no
X_VIDMODE_METHOD = no
LINUX_DRM_METHOD = no
W32_GDI_METHOD = no
QUARTZ_CG_METHOD = no
DUMMY_METHOD = yes
CONFIGFILE = config.mk
include $(CONFIGFILE)
OS = linux
# Linux: linux
# Mac OS: macos
# Windows: windows
include mk/$(OS).mk
HDR_METHODS =
CPPFLAGS_METHODS =
METHODS_PARAMS =
QUARTZ_CORE_GRAPHICS_METHOD = $(QUARTZ_CG_METHOD)
include mk/method-x-randr=$(X_RANDR_METHOD).mk
include mk/method-x-vidmode=$(X_VIDMODE_METHOD).mk
include mk/method-linux-drm=$(LINUX_DRM_METHOD).mk
include mk/method-w32-gdi=$(W32_GDI_METHOD).mk
include mk/method-quartz-cg=$(QUARTZ_CORE_GRAPHICS_METHOD).mk
include mk/method-dummy=$(DUMMY_METHOD).mk
OBJ_PUBLIC =\
libgamma_behex_edid.o\
libgamma_behex_edid_lowercase.o\
libgamma_behex_edid_uppercase.o\
libgamma_connector_type_count.o\
libgamma_const_of_connector_type.o\
libgamma_const_of_method.o\
libgamma_const_of_subpixel_order.o\
libgamma_crtc_destroy.o\
libgamma_crtc_free.o\
libgamma_crtc_get_gamma_ramps16.o\
libgamma_crtc_get_gamma_ramps32.o\
libgamma_crtc_get_gamma_ramps64.o\
libgamma_crtc_get_gamma_ramps8.o\
libgamma_crtc_get_gamma_rampsd.o\
libgamma_crtc_get_gamma_rampsf.o\
libgamma_crtc_info_count.o\
libgamma_crtc_information_destroy.o\
libgamma_crtc_information_free.o\
libgamma_crtc_initialise.o\
libgamma_crtc_restore.o\
libgamma_crtc_set_gamma_ramps16.o\
libgamma_crtc_set_gamma_ramps16_f.o\
libgamma_crtc_set_gamma_ramps32.o\
libgamma_crtc_set_gamma_ramps32_f.o\
libgamma_crtc_set_gamma_ramps64.o\
libgamma_crtc_set_gamma_ramps64_f.o\
libgamma_crtc_set_gamma_ramps8.o\
libgamma_crtc_set_gamma_ramps8_f.o\
libgamma_crtc_set_gamma_rampsd.o\
libgamma_crtc_set_gamma_rampsd_f.o\
libgamma_crtc_set_gamma_rampsf.o\
libgamma_crtc_set_gamma_rampsf_f.o\
libgamma_error_min.o\
libgamma_gamma_ramps16_destroy.o\
libgamma_gamma_ramps16_free.o\
libgamma_gamma_ramps16_initialise.o\
libgamma_gamma_ramps32_destroy.o\
libgamma_gamma_ramps32_free.o\
libgamma_gamma_ramps32_initialise.o\
libgamma_gamma_ramps64_destroy.o\
libgamma_gamma_ramps64_free.o\
libgamma_gamma_ramps64_initialise.o\
libgamma_gamma_ramps8_destroy.o\
libgamma_gamma_ramps8_free.o\
libgamma_gamma_ramps8_initialise.o\
libgamma_gamma_rampsd_destroy.o\
libgamma_gamma_rampsd_free.o\
libgamma_gamma_rampsd_initialise.o\
libgamma_gamma_rampsf_destroy.o\
libgamma_gamma_rampsf_free.o\
libgamma_gamma_rampsf_initialise.o\
libgamma_get_crtc_information.o\
libgamma_group_gid.o\
libgamma_group_name.o\
libgamma_is_method_available.o\
libgamma_list_methods.o\
libgamma_method_capabilities.o\
libgamma_method_count.o\
libgamma_method_default_site.o\
libgamma_method_default_site_variable.o\
libgamma_name_of_connector_type.o\
libgamma_name_of_error.o\
libgamma_name_of_method.o\
libgamma_name_of_subpixel_order.o\
libgamma_partition_destroy.o\
libgamma_partition_free.o\
libgamma_partition_initialise.o\
libgamma_partition_restore.o\
libgamma_perror.o\
libgamma_site_destroy.o\
libgamma_site_free.o\
libgamma_site_initialise.o\
libgamma_site_restore.o\
libgamma_strerror.o\
libgamma_strerror_r.o\
libgamma_subpixel_order_count.o\
libgamma_unhex_edid.o\
libgamma_value_of_connector_type.o\
libgamma_value_of_error.o\
libgamma_value_of_method.o\
libgamma_value_of_subpixel_order.o
OBJ_INTERNAL =\
libgamma_internal_allocated_any_ramp.o\
libgamma_internal_parse_edid.o\
libgamma_internal_translated_ramp_get_.o\
libgamma_internal_translated_ramp_set_.o\
libgamma_internal_translate_from_64.o\
libgamma_internal_translate_to_64.o\
OBJ = $(OBJ_PUBLIC) $(OBJ_INTERNAL)
LOBJ = $(OBJ:.o=.lo)
HDR =\
common.h\
config.h\
get_ramps.h\
libgamma.h\
set_ramps.h\
set_ramps_fun.h\
$(HDR_METHODS)
all: libgamma.a libgamma.$(LIBEXT)
$(OBJ): $(@:.o=.c) $(HDR)
$(LOBJ): $(@:.lo=.c) $(HDR)
config.h: FORCE
printf '/* This file is auto-generated.mk */\n' > $@~
printf '#include "%s"\n' $(HDR_METHODS) >> $@~
printf '#define LIST_AVAILABLE_METHODS(_)' >> $@~
printf '\\\n\t_(%s, %s, %s, %s)' $(METHODS_PARAMS) >> $@~
printf '\n' >> $@~
if ! test -f $@ || ! test "$$(cat < $@)" = "$$(cat < $@~)"; then mv -- $@~ $@; fi
libgamma.a: $(OBJ)
-rm -f -- $@
$(AR) -rc $@ $(OBJ)
$(AR) -s $@
libgamma.$(LIBEXT): $(LOBJ)
$(CC) $(LIBFLAGS) $(LDFLAGS_METHODS) -o $@ $(LOBJ) $(LDFLAGS)
.c.o:
$(CC) -c -o $@ $< $(CFLAGS) $(CFLAGS_METHODS) $(CPPFLAGS) $(CPPFLAGS_METHODS)
.c.lo:
$(CC) -fPIC -c -o $@ $< $(CFLAGS) $(CFLAGS_METHODS) $(CPPFLAGS) $(CPPFLAGS_METHODS)
install: libgamma.a libgamma.$(LIBEXT)
mkdir -p -- "$(DESTDIR)$(PREFIX)/lib/"
mkdir -p -- "$(DESTDIR)$(PREFIX)/include/"
cp -- libgamma.$(LIBEXT) "$(DESTDIR)$(PREFIX)/lib/libgamma.$(LIBMINOREXT)"
ln -sf -- libgamma.$(LIBMINOREXT) "$(DESTDIR)$(PREFIX)/lib/libgamma.$(LIBMAJOREXT)"
ln -sf -- libgamma.$(LIBMAJOREXT) "$(DESTDIR)$(PREFIX)/lib/libgamma.$(LIBEXT)"
cp -- libgamma.a "$(DESTDIR)$(PREFIX)/lib/"
cp -- libgamma.h "$(DESTDIR)$(PREFIX)/include/"
uninstall:
-rm -f -- "$(DESTDIR)$(PREFIX)/lib/libgamma.$(LIBMAJOREXT)"
-rm -f -- "$(DESTDIR)$(PREFIX)/lib/libgamma.$(LIBMINOREXT)"
-rm -f -- "$(DESTDIR)$(PREFIX)/lib/libgamma.$(LIBEXT)"
-rm -f -- "$(DESTDIR)$(PREFIX)/lib/libgamma.a"
-rm -f -- "$(DESTDIR)$(PREFIX)/include/libgamma.h"
clean:
-rm -f -- *.o *.lo *.su *.a *.$(LIBEXT)
.SUFFIXES:
.SUFFIXES: .lo .o .c
FORCE:
.PHONY: all install uninstall clean FORCE
|