From 0dd1d9d2e78e125595ba76c91da5b2c3bee75310 Mon Sep 17 00:00:00 2001 From: EuAndreh Date: Thu, 16 May 2024 11:12:01 -0300 Subject: Makefile: Fix installation of files under $(DATADIR) --- Makefile | 33 ++++++++++++++------------------- 1 file changed, 14 insertions(+), 19 deletions(-) diff --git a/Makefile b/Makefile index 4a48002..be54efe 100644 --- a/Makefile +++ b/Makefile @@ -3,40 +3,33 @@ DATE = 1970-01-01 VERSION = 0.1.0 NAME = papod NAME_UC = $(NAME) -MAILING_LIST = public-inbox -LANGUAGES = +LANGUAGES = en ## Installation prefix. Defaults to "/usr". PREFIX = /usr BINDIR = $(PREFIX)/bin -LIBDDIR = $(PREFIX)/lib/$(NAME) +LIBDIR = $(PREFIX)/lib +INCLUDEDIR = $(PREFIX)/include SRCDIR = $(PREFIX)/src/$(NAME) SHAREDIR = $(PREFIX)/share LOCALEDIR = $(SHAREDIR)/locale MANDIR = $(SHAREDIR)/man +DATADIR = $(SHAREDIR)/$(NAME) EXEC = ./ ## Where to store the installation. Empty by default. DESTDIR = +LDLIBS = .SUFFIXES: -.SUFFIXES: .in - -.in: - sed \ - -e 's:@MAILING_LIST@:$(MAILING_LIST):g' \ - -e 's:@VERSION@:$(VERSION):g' \ - -e 's:@DATE@:$(DATE):g' \ - -e 's:@NAME@:$(NAME):g' \ - -e 's:@URL@:$(URL):g' \ - < $< > $@ - if [ -x $< ]; then chmod +x $@; fi +.SUFFIXES: .go .bin all: include deps.mk + sources = \ src/lib.go \ src/cmd/main.go \ @@ -88,6 +81,7 @@ check-integration: $(integration-tests) check: check-unit check-integration + ## Remove *all* derived artifacts produced during the build. ## A dedicated test asserts that this is always true. clean: @@ -98,10 +92,11 @@ clean: ## ensures that all installable artifacts are crafted beforehand. install: all mkdir -p \ - '$(DESTDIR)$(BINDIR)' - cp $(NAME).bin '$(DESTDIR)$(BINDIR)'/$(NAME) + '$(DESTDIR)$(BINDIR)' \ + + cp $(NAME).bin '$(DESTDIR)$(BINDIR)'/$(NAME) for f in $(sources.sql) $(sources.static); do \ - dir='$(DESTDIR)$(LIBDDIR)'/"`dirname "$${f#src/}"`"; \ + dir='$(DESTDIR)$(DATADIR)'/"`dirname "$${f#src/}"`"; \ mkdir -p "$$dir"; \ cp -P "$$f" "$$dir"; \ done @@ -117,8 +112,8 @@ install: all uninstall: rm -rf \ '$(DESTDIR)$(BINDIR)'/$(NAME) \ - '$(DESTDIR)$(LIBDDIR)' \ - '$(DESTDIR)$(SRCDIR)' + '$(DESTDIR)$(DATADIR)' \ + '$(DESTDIR)$(SRCDIR)' \ run-papo: all -- cgit v1.2.3