aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMattias Andrée <maandree@kth.se>2021-09-16 18:47:15 +0200
committerMattias Andrée <maandree@kth.se>2021-09-16 18:47:15 +0200
commit8cc4f92e393d778c0f7afb616f023f4656e2ea9c (patch)
tree208c572112477c2462e1e606a7cc6d776824286e
parentSimplify and cahgne license (diff)
downloadsleeping-getty-8cc4f92e393d778c0f7afb616f023f4656e2ea9c.tar.gz
sleeping-getty-8cc4f92e393d778c0f7afb616f023f4656e2ea9c.tar.bz2
sleeping-getty-8cc4f92e393d778c0f7afb616f023f4656e2ea9c.tar.xz
m + improve makefile + use <sys/ioctl.h> instead of <stropts.h> which doesn' exist anymore1.2
Signed-off-by: Mattias Andrée <maandree@kth.se>
Diffstat (limited to '')
-rw-r--r--Makefile9
-rw-r--r--config.mk6
-rw-r--r--sleeping-getty.c3
3 files changed, 11 insertions, 7 deletions
diff --git a/Makefile b/Makefile
index e13f531..383a915 100644
--- a/Makefile
+++ b/Makefile
@@ -3,26 +3,27 @@
CONFIGFILE = config.mk
include $(CONFIGFILE)
+
all: sleeping-getty
+.c.o:
+ $(CC) -c -o $@ $< $(CFLAGS) $(CPPFLAGS)
+
sleeping-getty: sleeping-getty.o
$(CC) -o $@ sleeping-getty.o $(LDFLAGS)
install: sleeping-getty
mkdir -p -- "$(DESTDIR)$(PREFIX)/sbin"
mkdir -p -- "$(DESTDIR)$(MANPREFIX)/man8"
- mkdir -p -- "$(DESTDIR)$(PREFIX)/share/licenses/sleeping-getty"
cp -- sleeping-getty "$(DESTDIR)$(PREFIX)/sbin/"
cp -- sleeping-getty.8 "$(DESTDIR)$(MANPREFIX)/man8/"
- cp -- LICENSE "$(DESTDIR)$(PREFIX)/share/licenses/sleeping-getty/"
uninstall:
-rm -f -- "$(DESTDIR)$(PREFIX)/sbin/sleeping-getty"
-rm -f -- "$(DESTDIR)$(MANPREFIX)/man8/sleeping-getty.8"
- -rm -rf -- "$(DESTDIR)$(PREFIX)/share/licenses/sleeping-getty"
clean:
- -rm -f -- sleeping-getty *.o
+ -rm -f -- sleeping-getty *.o *.su
.SUFFIXES:
.SUFFIXES: .o .c
diff --git a/config.mk b/config.mk
index ead8646..54fd36d 100644
--- a/config.mk
+++ b/config.mk
@@ -1,6 +1,8 @@
-PREFIX = /usr/local
+PREFIX = /usr
MANPREFIX = $(PREFIX)/share/man
+CC = cc
+
CPPFLAGS = -D_DEFAULT_SOURCE -D_BSD_SOURCE -D_XOPEN_SOURCE=700
-CFLAGS = -std=c99 -Wall -Wextra -Os $(CPPFLAGS)
+CFLAGS = -std=c99 -Wall -Os
LDFLAGS = -s
diff --git a/sleeping-getty.c b/sleeping-getty.c
index 25e95a9..9f7d09a 100644
--- a/sleeping-getty.c
+++ b/sleeping-getty.c
@@ -1,14 +1,15 @@
/* See LICENSE file for copyright and license details. */
#include <linux/vt.h>
+#include <sys/ioctl.h>
#include <ctype.h>
#include <errno.h>
#include <limits.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
-#include <stropts.h>
#include <unistd.h>
+
static char *argv0;
static void