aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMattias Andrée <maandree@kth.se>2021-09-16 16:23:23 +0200
committerMattias Andrée <maandree@kth.se>2021-09-16 16:23:23 +0200
commit0ae720729039b317276c5c8083a5864d8f99a6cb (patch)
treec307e2295d76cf70e6927db5254f0a0c26ba8bec
parentmisc + change license + remove info manual (diff)
downloadcrt-calibrator-0ae720729039b317276c5c8083a5864d8f99a6cb.tar.gz
crt-calibrator-0ae720729039b317276c5c8083a5864d8f99a6cb.tar.bz2
crt-calibrator-0ae720729039b317276c5c8083a5864d8f99a6cb.tar.xz
Improve makefile, fix uninstall rule, and fix style erros1.3.3
Signed-off-by: Mattias Andrée <maandree@kth.se>
-rw-r--r--Makefile9
-rw-r--r--config.mk2
-rw-r--r--drmgamma.c2
-rw-r--r--framebuffer.c6
-rw-r--r--gamma.c8
5 files changed, 17 insertions, 10 deletions
diff --git a/Makefile b/Makefile
index 0dc11a2..2e70368 100644
--- a/Makefile
+++ b/Makefile
@@ -12,8 +12,9 @@ OBJ =\
HDR = common.h
+
all: crt-calibrator
-$(OBJ): $(@:.o=.c) $(HDR)
+$(OBJ): $(HDR)
crt-calibrator: $(OBJ)
$(CC) -o $@ $(OBJ) $(LDFLAGS)
@@ -28,11 +29,11 @@ install: crt-calibrator
cp -- crt-calibrator.1 "$(DESTDIR)$(MANPREFIX)/man1/"
uninstall:
- -rm -- "$(DESTDIR)$(BINDIR)/crt-calibrator"
- -rm -- "$(DESTDIR)$(MAN1DIR)/crt-calibrator.1"
+ -rm -- "$(DESTDIR)$(PREFIX)/bin/crt-calibrator"
+ -rm -- "$(DESTDIR)$(MANPREFIX)/man1/crt-calibrator.1"
clean:
- -rm -rf -- crt-calibrator *.o
+ -rm -rf -- crt-calibrator *.o *.su
.SUFFIXES:
.SUFFIXES: .o .c
diff --git a/config.mk b/config.mk
index 1288e57..ceaca55 100644
--- a/config.mk
+++ b/config.mk
@@ -1,6 +1,8 @@
PREFIX = /usr
MANPREFIX = $(PREFIX)/share/man
+CC = cc
+
CPPFLAGS = -D_DEFAULT_SOURCE -D_BSD_SOURCE -D_XOPEN_SOURCE=700
CFLAGS = -std=c99 -Wall $$(pkg-config --cflags libdrm)
LDFLAGS = -lm $$(pkg-config --libs libdrm)
diff --git a/drmgamma.c b/drmgamma.c
index 43adb2e..8608351 100644
--- a/drmgamma.c
+++ b/drmgamma.c
@@ -6,7 +6,7 @@
* The number of elements to allocates to a buffer for a DRM device pathname
*/
#define DRM_DEV_NAME_MAX_LEN\
- ((sizeof(DRM_DEV_NAME) + sizeof(DRM_DIR_NAME)) / sizeof(char) + 3 * sizeof(int))
+ ((sizeof(DRM_DEV_NAME) + sizeof(DRM_DIR_NAME)) / sizeof(char) + 3 * sizeof(int))
diff --git a/framebuffer.c b/framebuffer.c
index 29459ac..69e6354 100644
--- a/framebuffer.c
+++ b/framebuffer.c
@@ -152,7 +152,8 @@ fb_fill_rectangle(framebuffer_t *restrict fb, uint32_t colour, uint32_t x, uint3
* @param y The starting pixel on the Y axis for the line segment
* @param length The length of the line segment, in pixels
*/
-void fb_draw_horizontal_line(framebuffer_t *restrict fb, uint32_t colour, uint32_t x, uint32_t y, uint32_t length)
+void
+fb_draw_horizontal_line(framebuffer_t *restrict fb, uint32_t colour, uint32_t x, uint32_t y, uint32_t length)
{
int8_t *mem = fb->mem + y * fb->line_length;
size_t x1 = x * fb->bytes_per_pixel;
@@ -172,7 +173,8 @@ void fb_draw_horizontal_line(framebuffer_t *restrict fb, uint32_t colour, uint32
* @param y The starting pixel on the Y axis for the line segment
* @param length The length of the line segment, in pixels
*/
-void fb_draw_vertical_line(framebuffer_t *restrict fb, uint32_t colour, uint32_t x, uint32_t y, uint32_t length)
+void
+fb_draw_vertical_line(framebuffer_t *restrict fb, uint32_t colour, uint32_t x, uint32_t y, uint32_t length)
{
int8_t *mem = fb->mem + y * fb->line_length + x * fb->bytes_per_pixel;
size_t y2 = y + length;
diff --git a/gamma.c b/gamma.c
index d15f3b6..6cee36a 100644
--- a/gamma.c
+++ b/gamma.c
@@ -11,8 +11,9 @@
* @param contrast Output parameter for the contrast
* @param brightness Output parameter for the brightness
*/
-void gamma_analyse(size_t stops, const uint16_t *restrict ramp, double *restrict gamma,
- double *restrict contrast, double *restrict brightness)
+void
+gamma_analyse(size_t stops, const uint16_t *restrict ramp, double *restrict gamma,
+ double *restrict contrast, double *restrict brightness)
{
double min, middle, max;
*brightness = min = (double)(ramp[0]) / (double)0xFFFF;
@@ -38,7 +39,8 @@ void gamma_analyse(size_t stops, const uint16_t *restrict ramp, double *restrict
* @param contrast The contrast
* @param brightness The brightness
*/
-void gamma_generate(size_t stops, uint16_t *restrict ramp, double gamma, double contrast, double brightness)
+void
+gamma_generate(size_t stops, uint16_t *restrict ramp, double gamma, double contrast, double brightness)
{
double diff = contrast - brightness;
double gamma_ = (double)1 / gamma;