summaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorEuAndreh <eu@euandre.org>2024-02-20 11:26:48 -0300
committerEuAndreh <eu@euandre.org>2024-02-21 05:44:16 -0300
commit613398385703b6e99c8137a1b89454d977ccf2c8 (patch)
tree40c53155336296951b3475a3a0798a59f63edc14 /Makefile
parentMakefile: Include SQL migration files as installable artifacts (diff)
downloadpapod-613398385703b6e99c8137a1b89454d977ccf2c8.tar.gz
papod-613398385703b6e99c8137a1b89454d977ccf2c8.tar.xz
Remove C code and cleanup repository
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile152
1 files changed, 21 insertions, 131 deletions
diff --git a/Makefile b/Makefile
index 7ed1535..f150cf9 100644
--- a/Makefile
+++ b/Makefile
@@ -15,18 +15,14 @@ SRCDIR = $(PREFIX)/src/$(NAME)
SHAREDIR = $(PREFIX)/share
LOCALEDIR = $(SHAREDIR)/locale
MANDIR = $(SHAREDIR)/man
-CFLAGS.so = -fPIC
-LDFLAGS.so = --shared
-EXT.so = .so
EXEC = ./
## Where to store the installation. Empty by default.
DESTDIR =
-LDLIBS = -lsqlite3
.SUFFIXES:
-.SUFFIXES: .in .c .o .lo .to .ta .t .msg .cat
+.SUFFIXES: .in
.in:
sed \
@@ -38,88 +34,37 @@ LDLIBS = -lsqlite3
< $< > $@
if [ -x $< ]; then chmod +x $@; fi
-.c.o:
- $(CC) $(CFLAGS) $(CFLAGS.a) -o $@ -c $<
-
-.c.lo:
- $(CC) $(CFLAGS) $(CFLAGS.so) -o $@ -c $<
-
-.c.to:
- $(CC) $(CFLAGS) $(CFLAGS.a) -DTEST -o $@ -c $<
-
-.ta.t:
- $(CC) $(LDFLAGS) $(LDFLAGS.a) -o $@ $< $(LDLIBS)
-
all:
include deps.mk
-manpages.en.in = \
- doc/$(NAME).README.en.7.in \
- doc/$(NAME).CHANGELOG.en.7.in \
- doc/$(NAME).TODOs.en.7.in \
- doc/$(NAME).en.1.in \
- doc/$(NAME).en.3js.in \
- doc/$(NAME).tutorial.en.7.in \
- doc/$(NAME).recipes.en.7.in \
- doc/$(NAME).why.en.7.in
-manpages.in = $(manpages.en.in)
manpages = $(manpages.in:.in=)
-catalogs.en.msg = src/$(NAME).en.msg
-catalogs.msg = $(catalogs.en.msg)
-catalogs.cat = $(catalogs.msg:.msg=.cat)
-
-sources.o = $(sources.c:.c=.o)
-sources.lo = $(sources.c:.c=.lo)
-sources.to = $(sources.c:.c=.to)
-sources.ta = $(sources.c:.c=.ta)
-sources.t = $(sources.c:.c=.t)
-
sources = \
- $(sources.c) \
- $(sources.c:.c=.h) \
- src/config.h.in \
- src/config.h \
- $(catalogs.msg) \
- $(sources.js) \
- src/cli \
- src/napi-sqlite.c \
+ $(sources.js) \
+ src/cli \
installable = \
- $(sources.sql) \
- $(sources.js) \
- src/index.js \
- src/cli \
- src/napi-sqlite.node \
+ $(sources.sql) \
+ $(sources.js) \
+ src/index.js \
+ src/cli \
derived-assets = \
- $(NAME).bin \
- lib$(NAME)$(EXT.so) \
- src/config.h \
- $(manpages) \
- $(catalogs.cat) \
- $(sources.o) \
- $(sources.lo) \
- $(sources.to) \
- $(sources.ta) \
- $(sources.t) \
- tests/tests-lib.o \
- tests/slurp.o \
- src/index.js \
- node_modules/dir.sentinel \
- node_modules/ \
- node_modules/$(NAME) \
- src/napi-sqlite.lo \
- src/napi-sqlite.node \
+ $(NAME).bin \
+ $(manpages) \
+ src/index.js \
+ node_modules/dir.sentinel \
+ node_modules/ \
+ node_modules/$(NAME) \
side-assets = \
- src/logerr.c.txt \
- src/catalog.c.txt \
- ircd.sock \
- web.sock \
+ src/logerr.c.txt \
+ src/catalog.c.txt \
+ ircd.sock \
+ web.sock \
@@ -131,13 +76,7 @@ all: $(derived-assets)
$(NAME).bin:
ln -fs src/cli $@
-$(manpages) src/config.h: Makefile deps.mk
-$(sources.o) $(sources.lo) $(sources.to): src/config.h Makefile deps.mk
-tests/tests-lib.o: tests/tests-lib.h src/config.h Makefile deps.mk
-src/napi-sqlite.lo: src/config.h Makefile deps.mk
-$(sources.to): tests/tests-lib.h
-$(sources.ta): tests/tests-lib.o
-$(sources.js) $(tests.js): src/napi-sqlite.node
+$(manpages): Makefile deps.mk
src/index.js:
ln -fs api.js $@
@@ -153,23 +92,6 @@ node_modules/$(NAME): node_modules/dir.sentinel
node_modules/: node_modules/dir.sentinel node_modules/$(NAME)
-src/napi-sqlite.node: lib$(NAME)$(EXT.so)
- ln -f lib$(NAME)$(EXT.so) $@
-
-lib$(NAME)$(EXT.so): $(sources.lo) src/napi-sqlite.lo
- $(CC) $(LDFLAGS) $(LDFLAGS.so) -o $@ $(sources.lo) src/napi-sqlite.lo \
- $(LDLIBS)
-
-$(sources.ta):
- $(AR) $(ARFLAGS) $@ $?
-
-src/$(NAME).en.cat: src/i18n.t
- env DUMP_TRANSLATABLE_STRINGS=1 $(EXEC)src/i18n.t > $*.msg.new
- cmp -s $*.msg.new $*.msg || mv $*.msg.new $*.msg
- rm -f $*.msg.new
- gencat $@ $*.msg
- touch $@
-
.SUFFIXES: .js .js-t
@@ -177,25 +99,7 @@ tests.js-t = $(tests.js:.js=.js-t)
$(tests.js-t):
node $*.js
-check-js-t: $(tests.js-t)
-
-.SUFFIXES: .t-run
-sources.t-run = $(sources.c:.c=.t-run)
-$(sources.t-run):
- $(EXEC)$*.t
-
-check-t-run: $(sources.t-run)
-
-check-t: check-js-t check-t-run
-
-
-
-.SUFFIXES: .c-lint
-sources.c-lint = $(sources.c:.c=.c-lint)
-$(sources.c-lint):
- sh tests/c-lint.sh $*.c
-
-check-lint: $(sources.c-lint)
+check-unit: $(tests.js-t)
integration-tests = \
@@ -207,23 +111,10 @@ $(integration-tests): $(NAME).bin ALWAYS
check-integration: $(integration-tests)
-tests/assert-clean.sh tests/assert-install.sh tests/assert-uninstall.sh: all
-assert-tests = \
- tests/assert-clean.sh \
- tests/assert-deps.sh \
- tests/assert-install.sh \
- tests/assert-uninstall.sh \
-
-$(assert-tests): ALWAYS
- +sh $@
-
-check-asserts: $(assert-tests)
-
-
## Run all tests. Each test suite is isolated, so that a parallel
## build can run tests at the same time. The required artifacts
## are created if missing.
-check: check-t check-lint check-integration check-asserts
+check: check-unit check-integration
## Remove *all* derived artifacts produced during the build.
@@ -283,10 +174,9 @@ run: all
$(MAKE) run-ircd & $(MAKE) run-web & wait
-MAKEFILE = Makefile
## Show this help.
help:
- cat $(MAKEFILE) | sh tools/makehelp.sh
+ sh tools/makehelp.sh < Makefile
ALWAYS: