11
2- SUBDIRS = redshift-gtk
2+ SUBDIRS = . redshift-gtk
3+
4+ if ENABLE_CONFIG_GUI
5+ SUBDIRS += redshift-config-gtk
6+ endif
37
48# I18n
59localedir = $(datadir ) /locale
@@ -8,75 +12,82 @@ AM_CPPFLAGS = -DLOCALEDIR=\"$(localedir)\"
812# redshift Program
913bin_PROGRAMS = redshift
1014
11- redshift_SOURCES = \
15+ noinst_LTLIBRARIES = libredshift_common.la
16+ libredshift_common_la_LIBADD =
17+
18+ libredshift_common_la_SOURCES = \
1219 colorramp.c colorramp.h \
1320 config-ini.c config-ini.h \
1421 gamma-dummy.c gamma-dummy.h \
15- hooks.c hooks.h \
1622 location-manual.c location-manual.h \
1723 options.c options.h \
18- pipeutils.c pipeutils.h \
19- redshift.c redshift.h \
20- signals.c signals.h \
21- solar.c solar.h \
22- systemtime.c systemtime.h
24+ pipeutils.c pipeutils.h
2325
24- EXTRA_redshift_SOURCES = \
26+ EXTRA_libredshift_common_la_SOURCES = \
2527 gamma-drm.c gamma-drm.h \
2628 gamma-randr.c gamma-randr.h \
2729 gamma-vidmode.c gamma-vidmode.h \
2830 gamma-quartz.c gamma-quartz.h \
2931 gamma-w32gdi.c gamma-w32gdi.h \
3032 location-geoclue2.c location-geoclue2.h \
31- location-corelocation.m location-corelocation.h \
33+ location-corelocation.m location-corelocation.h
34+
35+ redshift_SOURCES = \
36+ hooks.c hooks.h \
37+ redshift.c redshift.h \
38+ signals.c signals.h \
39+ solar.c solar.h \
40+ systemtime.c systemtime.h
41+
42+ EXTRA_redshift_SOURCES = \
3243 windows/appicon.rc \
3344 windows/versioninfo.rc
3445
3546AM_CFLAGS =
36- redshift_LDADD = @LIBINTL@
47+ redshift_LDADD = @LIBINTL@ libredshift_common.la
3748EXTRA_DIST = windows/redshift.ico
3849
3950if ENABLE_DRM
40- redshift_SOURCES += gamma-drm.c gamma-drm.h
51+ libredshift_common_la_SOURCES += gamma-drm.c gamma-drm.h
4152AM_CFLAGS += $(DRM_CFLAGS )
42- redshift_LDADD += \
53+ libredshift_common_la_LIBADD += \
4354 $(DRM_LIBS ) $(DRM_CFLAGS )
4455endif
4556
4657if ENABLE_RANDR
47- redshift_SOURCES += gamma-randr.c gamma-randr.h
58+ libredshift_common_la_SOURCES += gamma-randr.c gamma-randr.h
4859AM_CFLAGS += $(XCB_CFLAGS ) $(XCB_RANDR_CFLAGS )
49- redshift_LDADD += \
60+ libredshift_common_la_LIBADD += \
5061 $(XCB_LIBS ) $(XCB_CFLAGS ) \
5162 $(XCB_RANDR_LIBS ) $(XCB_RANDR_CFLAGS )
5263endif
5364
5465if ENABLE_VIDMODE
55- redshift_SOURCES += gamma-vidmode.c gamma-vidmode.h
66+ libredshift_common_la_SOURCES += gamma-vidmode.c gamma-vidmode.h
5667AM_CFLAGS += $(X11_CFLAGS ) $(XF86VM_CFLAGS )
57- redshift_LDADD += \
68+ libredshift_common_la_LIBADD += \
5869 $(X11_LIBS ) $(X11_CFLAGS ) \
5970 $(XF86VM_LIBS ) $(XF86VM_CFLAGS )
6071endif
6172
6273if ENABLE_QUARTZ
63- redshift_SOURCES += gamma-quartz.c gamma-quartz.h
74+ libredshift_common_la_SOURCES += gamma-quartz.c gamma-quartz.h
6475AM_CFLAGS += $(QUARTZ_CFLAGS )
65- redshift_LDADD += \
76+ libredshift_common_la_LIBADD += \
6677 $(QUARTZ_LIBS ) $(QUARTZ_CFLAGS )
6778endif
6879
6980if ENABLE_WINGDI
70- redshift_SOURCES += gamma-w32gdi.c gamma-w32gdi.h
71- redshift_LDADD += -lgdi32
81+ libredshift_common_la_SOURCES += gamma-w32gdi.c gamma-w32gdi.h
82+ libredshift_common_la_LIBADD += -lgdi32
7283endif
7384
7485
7586if ENABLE_GEOCLUE2
76- redshift_SOURCES += location-geoclue2.c location-geoclue2.h
87+ libredshift_common_la_SOURCES += location-geoclue2.c location-geoclue2.h
7788AM_CFLAGS += \
7889 $(GEOCLUE2_CFLAGS )
79- redshift_LDADD += \
90+ libredshift_common_la_LIBADD += \
8091 $(GEOCLUE2_LIBS ) $(GEOCLUE2_CFLAGS )
8192endif
8293
@@ -85,14 +96,14 @@ endif
8596# (Objective C).
8697
8798if ENABLE_CORELOCATION
88- noinst_LTLIBRARIES = liblocation-corelocation.la
99+ noinst_LTLIBRARIES + = liblocation-corelocation.la
89100liblocation_corelocation_la_SOURCES = \
90101 location-corelocation.m location-corelocation.h
91102liblocation_corelocation_la_OBJCFLAGS = \
92103 $(CORELOCATION_CFLAGS )
93104liblocation_corelocation_la_LIBADD = \
94105 $(CORELOCATION_CFLAGS ) $(CORELOCATION_LIBS )
95- redshift_LDADD += liblocation-corelocation.la
106+ libredshift_common_la_LIBADD += liblocation-corelocation.la
96107endif
97108
98109
0 commit comments