summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJakob Kaivo <jkk@ung.org>2023-07-04 12:06:04 -0400
committerJakob Kaivo <jkk@ung.org>2023-07-04 12:06:04 -0400
commit0c31ba7f23c63f488315dcd73c471307b60cf44e (patch)
tree70fa6a7218c8af4e4b46e1d995cfceed29c5fbcf
parent24db71d36384d6985fe7eb7f5bd17424ee6c3070 (diff)
use maje to generate Makefileautorotate
-rw-r--r--Makefile36
-rw-r--r--autorotate.c6
2 files changed, 40 insertions, 2 deletions
diff --git a/Makefile b/Makefile
index ef20f6c..ecfc7dd 100644
--- a/Makefile
+++ b/Makefile
@@ -1,2 +1,34 @@
-LDLIBS=-lXrandr -lX11 -lXi
-autorotate: autorotate.c
+.POSIX:
+
+# This Makefile was generated by maje
+# See https://src.kaivo.net/dev/maje/ for more information
+# Do not edit this Makefile by hand
+
+CC=c99
+LD=$(CC)
+CFLAGS=-Wall -Wextra -Wpedantic -Werror -g
+LDFLAGS=
+LDLIBS= -lXrandr
+SRCDIR=.
+OBJDIR=.
+BINDIR=$(OBJDIR)
+LIBDIR=$(OBJDIR)
+DESTDIR=/usr/local
+
+all: $(BINDIR)/autorotate
+
+clean:
+ rm -f $(BINDIR)/autorotate $(OBJDIR)/*.o
+
+install: $(BINDIR)/autorotate
+ mkdir -p $(DESTDIR)/bin
+ cp $(BINDIR)/autorotate $(DESTDIR)/bin
+
+$(BINDIR)/autorotate: $(OBJDIR)/autorotate.o
+$(OBJDIR)/autorotate.o: $(SRCDIR)/autorotate.c
+ @mkdir -p $(@D)
+ $(CC) $(CFLAGS) -o $@ -c $(SRCDIR)/autorotate.c
+
+$(BINDIR)/autorotate:
+ @mkdir -p $(@D)
+ $(LD) $(LDFLAGS) -o $@ $(OBJDIR)/*.o $(LDLIBS)
diff --git a/autorotate.c b/autorotate.c
index 99b3fe2..b89f745 100644
--- a/autorotate.c
+++ b/autorotate.c
@@ -9,6 +9,12 @@
#include <X11/extensions/Xrandr.h>
#include <X11/extensions/XInput.h>
+/*
+MAJE_LDLIB=-lXrandr
+MAJE_LDLIB=-lX11
+MAJE_LDLIB=-lXi
+*/
+
#define ACPID_SOCK_PATH "/var/run/acpid.socket"
/* once to go into tablet mode, twice to come out */