summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEuAndreh <eu@euandre.org>2024-05-16 11:12:01 -0300
committerEuAndreh <eu@euandre.org>2024-05-16 11:12:01 -0300
commit0dd1d9d2e78e125595ba76c91da5b2c3bee75310 (patch)
tree7f78eeb4b82d093d38bb01897aa34ef7888cad49
parentRename source files to "lib.go" and "main.go" (diff)
downloadpapod-0dd1d9d2e78e125595ba76c91da5b2c3bee75310.tar.gz
papod-0dd1d9d2e78e125595ba76c91da5b2c3bee75310.tar.xz
Makefile: Fix installation of files under $(DATADIR)
-rw-r--r--Makefile33
1 files 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