aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMattias Andrée <m@maandree.se>2025-03-04 20:06:52 +0100
committerMattias Andrée <m@maandree.se>2025-03-04 20:06:52 +0100
commit2943b14334acb599cd2363a3688be062ab5fd87a (patch)
tree250667fcffb4990fceea45a26e8e2689ab9eb4bc /src
parentREADME: Explain gamma ramps and why integrated features should be preferred (diff)
downloadredshift-ng-2943b14334acb599cd2363a3688be062ab5fd87a.tar.gz
redshift-ng-2943b14334acb599cd2363a3688be062ab5fd87a.tar.bz2
redshift-ng-2943b14334acb599cd2363a3688be062ab5fd87a.tar.xz
Cleanup, fix/update sv.po, begin use of plain make and renaming project to redshift-ng
Signed-off-by: Mattias Andrée <m@maandree.se>
Diffstat (limited to 'src')
-rw-r--r--src/Makefile53
-rw-r--r--src/Makefile.am105
-rw-r--r--src/config.mk13
-rw-r--r--src/options.c3
4 files changed, 66 insertions, 108 deletions
diff --git a/src/Makefile b/src/Makefile
new file mode 100644
index 0000000..802fdea
--- /dev/null
+++ b/src/Makefile
@@ -0,0 +1,53 @@
+.POSIX:
+
+CONFIGFILE = config.mk
+include $(CONFIGFILE)
+
+OBJ =\
+ colorramp.o\
+ config-ini.o\
+ gamma-drm.o\
+ gamma-dummy.o\
+ gamma-randr.o\
+ gamma-vidmode.o\
+ hooks.o\
+ location-geoclue2.o\
+ location-manual.o\
+ options.o\
+ pipeutils.o\
+ redshift.o\
+ signals.o\
+ solar.o\
+ systemtime.o
+
+HDR = $(OBJ:.o=.h)
+
+PACKAGE_STRING = redshift-ng 1.13
+
+all: redshift
+$(OBJ): $(HDR)
+
+.c.o:
+ $(CC) -c -o $@ $< $(CFLAGS) $(CPPFLAGS) -D'PACKAGE_STRING="$(PACKAGE_STRING)"'
+
+redshift: $(OBJ)
+ $(CC) -o $@ $(OBJ) $(LDFLAGS)
+
+install: redshift
+ mkdir -p -- "$(DESTDIR)$(PREFIX)/bin"
+ mkdir -p -- "$(DESTDIR)$(MANPREFIX)/man1/"
+ cp -- redshift "$(DESTDIR)$(PREFIX)/bin/"
+ cp -- redshift.1 "$(DESTDIR)$(MANPREFIX)/man1/"
+
+uninstall:
+ -rm -f -- "$(DESTDIR)$(PREFIX)/bin/redshift"
+ -rm -f -- "$(DESTDIR)$(MANPREFIX)/man1/redshift.1"
+
+clean:
+ -rm -f -- *.o *.a *.lo *.su
+ -rm -f -- redshift
+
+.SUFFIXES:
+.SUFFIXES: .o .c
+
+.PHONY: all install uninstall clean
diff --git a/src/Makefile.am b/src/Makefile.am
deleted file mode 100644
index 8aa96ea..0000000
--- a/src/Makefile.am
+++ /dev/null
@@ -1,105 +0,0 @@
-
-SUBDIRS = redshift-gtk
-
-# I18n
-localedir = $(datadir)/locale
-AM_CPPFLAGS = -DLOCALEDIR=\"$(localedir)\"
-
-# redshift Program
-bin_PROGRAMS = redshift
-
-redshift_SOURCES = \
- colorramp.c colorramp.h \
- config-ini.c config-ini.h \
- gamma-dummy.c gamma-dummy.h \
- hooks.c hooks.h \
- location-manual.c location-manual.h \
- options.c options.h \
- pipeutils.c pipeutils.h \
- redshift.c redshift.h \
- signals.c signals.h \
- solar.c solar.h \
- systemtime.c systemtime.h
-
-EXTRA_redshift_SOURCES = \
- gamma-drm.c gamma-drm.h \
- gamma-randr.c gamma-randr.h \
- gamma-vidmode.c gamma-vidmode.h \
- gamma-quartz.c gamma-quartz.h \
- gamma-w32gdi.c gamma-w32gdi.h \
- location-geoclue2.c location-geoclue2.h \
- location-corelocation.m location-corelocation.h \
- windows/appicon.rc \
- windows/versioninfo.rc
-
-AM_CFLAGS =
-redshift_LDADD = @LIBINTL@
-EXTRA_DIST = windows/redshift.ico
-
-if ENABLE_DRM
-redshift_SOURCES += gamma-drm.c gamma-drm.h
-AM_CFLAGS += $(DRM_CFLAGS)
-redshift_LDADD += \
- $(DRM_LIBS) $(DRM_CFLAGS)
-endif
-
-if ENABLE_RANDR
-redshift_SOURCES += gamma-randr.c gamma-randr.h
-AM_CFLAGS += $(XCB_CFLAGS) $(XCB_RANDR_CFLAGS)
-redshift_LDADD += \
- $(XCB_LIBS) $(XCB_CFLAGS) \
- $(XCB_RANDR_LIBS) $(XCB_RANDR_CFLAGS)
-endif
-
-if ENABLE_VIDMODE
-redshift_SOURCES += gamma-vidmode.c gamma-vidmode.h
-AM_CFLAGS += $(X11_CFLAGS) $(XF86VM_CFLAGS)
-redshift_LDADD += \
- $(X11_LIBS) $(X11_CFLAGS) \
- $(XF86VM_LIBS) $(XF86VM_CFLAGS)
-endif
-
-if ENABLE_QUARTZ
-redshift_SOURCES += gamma-quartz.c gamma-quartz.h
-AM_CFLAGS += $(QUARTZ_CFLAGS)
-redshift_LDADD += \
- $(QUARTZ_LIBS) $(QUARTZ_CFLAGS)
-endif
-
-if ENABLE_WINGDI
-redshift_SOURCES += gamma-w32gdi.c gamma-w32gdi.h
-redshift_LDADD += -lgdi32
-endif
-
-
-if ENABLE_GEOCLUE2
-redshift_SOURCES += location-geoclue2.c location-geoclue2.h
-AM_CFLAGS += \
- $(GEOCLUE2_CFLAGS)
-redshift_LDADD += \
- $(GEOCLUE2_LIBS) $(GEOCLUE2_CFLAGS)
-endif
-
-# Build CoreLocation module as a separate convenience
-# library since it is using a separate compiler
-# (Objective C).
-
-if ENABLE_CORELOCATION
-noinst_LTLIBRARIES = liblocation-corelocation.la
-liblocation_corelocation_la_SOURCES = \
- location-corelocation.m location-corelocation.h
-liblocation_corelocation_la_OBJCFLAGS = \
- $(CORELOCATION_CFLAGS)
-liblocation_corelocation_la_LIBADD = \
- $(CORELOCATION_CFLAGS) $(CORELOCATION_LIBS)
-redshift_LDADD += liblocation-corelocation.la
-endif
-
-
-# Windows resources
-if ENABLE_WINDOWS_RESOURCE
-redshift_SOURCES += windows/appicon.rc windows/versioninfo.rc
-endif
-
-.rc.o:
- $(AM_V_GEN)$(WINDRES) -I$(top_builddir) -i $< -o $@
diff --git a/src/config.mk b/src/config.mk
new file mode 100644
index 0000000..f8f7751
--- /dev/null
+++ b/src/config.mk
@@ -0,0 +1,13 @@
+PREFIX = /usr
+MANPREFIX = $(PREFIX)/share/man
+
+CC = c99
+
+DRM_LIBS = libdrm
+GEOCLUE_LIBS = glib-2.0 gio-2.0
+RANDR_LIBS = xcb xcb-randr
+VIDMODE_LIBS = x11 xxf86vm
+
+CPPFLAGS = -D_DEFAULT_SOURCE -D_BSD_SOURCE -D_XOPEN_SOURCE=700 -D_GNU_SOURCE
+CFLAGS = $$(pkg-config --cflags $(DRM_LIBS) $(GEOCLUE_LIBS) $(RANDR_LIBS) $(VIDMODE_LIBS))
+LDFLAGS = $$(pkg-config --libs $(DRM_LIBS) $(GEOCLUE_LIBS) $(RANDR_LIBS) $(VIDMODE_LIBS)) -lm
diff --git a/src/options.c b/src/options.c
index 33bf623..729140e 100644
--- a/src/options.c
+++ b/src/options.c
@@ -213,9 +213,6 @@ print_help(const char *program_name)
DEFAULT_DAY_TEMP, DEFAULT_NIGHT_TEMP);
fputs("\n", stdout);
-
- /* TRANSLATORS: help output 7 */
- printf(_("Please report bugs to <%s>\n"), PACKAGE_BUGREPORT);
}
/* Print list of adjustment methods. */