summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEuAndreh <eu@euandre.org>2023-11-27 09:06:19 -0300
committerEuAndreh <eu@euandre.org>2023-11-27 09:10:20 -0300
commitda4d8a7b62ca33c58c1f37dfdcb8294abefc8afa (patch)
treec2c359ab841a830c4f2095ee5949b14f0bbd76e2
parentMakefile: Also recompile `src/napi-sqlite.lo` when Makefile changes (diff)
downloadpapod-da4d8a7b62ca33c58c1f37dfdcb8294abefc8afa.tar.gz
papod-da4d8a7b62ca33c58c1f37dfdcb8294abefc8afa.tar.xz
Makefile: Include SQL migration files as installable artifacts
-rw-r--r--Makefile13
-rw-r--r--deps.mk3
-rwxr-xr-xmkdeps.sh1
3 files changed, 16 insertions, 1 deletions
diff --git a/Makefile b/Makefile
index 9ba1055..7ed1535 100644
--- a/Makefile
+++ b/Makefile
@@ -87,6 +87,13 @@ sources = \
src/cli \
src/napi-sqlite.c \
+installable = \
+ $(sources.sql) \
+ $(sources.js) \
+ src/index.js \
+ src/cli \
+ src/napi-sqlite.node \
+
derived-assets = \
$(NAME).bin \
@@ -231,8 +238,12 @@ install: all
mkdir -p \
'$(DESTDIR)$(BINDIR)' \
'$(DESTDIR)$(JSLIBDIR)'
- cp -P src/cli src/*.node src/*.js '$(DESTDIR)$(JSLIBDIR)'
ln -fs '$(DESTDIR)$(JSLIBDIR)'/cli '$(DESTDIR)$(BINDIR)'/$(NAME)
+ for f in $(installable); do \
+ dir='$(DESTDIR)$(JSLIBDIR)'/"`dirname "$${f#src/}"`"; \
+ mkdir -p "$$dir"; \
+ cp -P "$$f" "$$dir"; \
+ done
for f in $(sources); do \
dir='$(DESTDIR)$(SRCDIR)'/"`dirname "$${f#src/}"`"; \
mkdir -p "$$dir"; \
diff --git a/deps.mk b/deps.mk
index 99eaa1f..6ffd21d 100644
--- a/deps.mk
+++ b/deps.mk
@@ -16,6 +16,9 @@ tests.js = \
tests/js/utils.js \
tests/js/web.js \
+sources.sql = \
+ src/sql/migrations/2023-11-16T15:46:27-03:00-init-auth-data.sql \
+
src/catalog.o src/catalog.lo src/catalog.to: src/catalog.h
src/i18n.o src/i18n.lo src/i18n.to: src/i18n.h
src/logerr.o src/logerr.lo src/logerr.to: src/logerr.h
diff --git a/mkdeps.sh b/mkdeps.sh
index 1f63dbd..b4506f9 100755
--- a/mkdeps.sh
+++ b/mkdeps.sh
@@ -11,6 +11,7 @@ export LANG=POSIX.UTF-8
find src/*.c -not -name napi-sqlite.c | sort | varlist 'sources.c'
find src/*.js -not -name index.js | sort | varlist 'sources.js'
find tests/js/*.js | sort | varlist 'tests.js'
+find src/sql/migrations/*.sql | sort | varlist 'sources.sql'
sh tools/cdeps.sh `find src/*.c -not -name napi-sqlite.c | sort`