--- makefile.orig 2023-06-15 07:30:09 UTC +++ makefile @@ -3,7 +3,7 @@ FLAGS+= -Wall -Wextra -Werror=vla -Wno-unused-paramete FLAGS = -std=c99 -pedantic -g FLAGS+= -Wall -Wextra -Werror=vla -Wno-unused-parameter #FLAGS+= -DDEBUG -FLAGS+= -DLY_VERSION=\"$(shell git describe --long --tags | sed 's/\([^-]*-g\)/r\1/;s/-/./g')\" +FLAGS+= -DLY_VERSION=\"${DISTVERSIONFULL}\" LINK = -lpam -lxcb VALGRIND = --show-leak-kinds=all --track-origins=yes --leak-check=full --suppressions=../res/valgrind.supp CMD = ./$(NAME) @@ -12,6 +12,10 @@ endif ifeq ($(OS), Linux) FLAGS+= -D_DEFAULT_SOURCE endif +ifeq ($(OS), FreeBSD) + FLAGS+= -D_DEFAULT_SOURCE ${CPPFLAGS} ${CFLAGS} + LINK+= ${LIBS} -lutil +endif BIND = bin OBJD = obj @@ -20,7 +24,7 @@ TESTD = tests RESD = res TESTD = tests -DATADIR ?= ${DESTDIR}/etc/ly +DATADIR ?= ${DESTDIR}$(PREFIX)/etc/ly FLAGS+= -DDATADIR=\"$(DATADIR)\" INCL = -I$(SRCD) @@ -71,14 +75,14 @@ install: $(BIND)/$(NAME) install: $(BIND)/$(NAME) @echo "installing ly" - @install -dZ ${DESTDIR}/etc/ly - @install -DZ $(BIND)/$(NAME) -t ${DESTDIR}/usr/bin - @install -DZ $(RESD)/config.ini -t ${DESTDIR}/etc/ly - @install -DZ $(RESD)/xsetup.sh -t $(DATADIR) - @install -DZ $(RESD)/wsetup.sh -t $(DATADIR) - @install -dZ $(DATADIR)/lang - @install -DZ $(RESD)/lang/* -t $(DATADIR)/lang - @install -DZ $(RESD)/pam.d/ly -m 644 -t ${DESTDIR}/etc/pam.d + @install -d ${DESTDIR}$(PREFIX)/etc/ly + @install $(BIND)/$(NAME) ${DESTDIR}$(PREFIX)/bin + @install $(RESD)/config.ini ${DESTDIR}$(PREFIX)/etc/ly + @install $(RESD)/xsetup.sh $(DATADIR) + @install $(RESD)/wsetup.sh $(DATADIR) + @install -d $(DATADIR)/lang + @install $(RESD)/lang/* $(DATADIR)/lang + @install -m 644 $(RESD)/pam.d/ly ${DESTDIR}$(PREFIX)/etc/pam.d installnoconf: $(BIND)/$(NAME) @echo "installing ly without the configuration file"