From 0c31ba7f23c63f488315dcd73c471307b60cf44e Mon Sep 17 00:00:00 2001 From: Jakob Kaivo Date: Tue, 4 Jul 2023 12:06:04 -0400 Subject: use maje to generate Makefile --- Makefile | 36 ++++++++++++++++++++++++++++++++++-- autorotate.c | 6 ++++++ 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 #include +/* +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 */ -- cgit v1.2.1