aboutsummaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authortomsmeding <tom.smeding@gmail.com>2017-05-09 22:39:16 +0200
committertomsmeding <tom.smeding@gmail.com>2017-05-09 22:39:16 +0200
commit24de2cd600a4e108c24f6f77a5a4d30111fd9918 (patch)
treeb27f97f511fb3d6fd5ce7f8a3fad9687867dbfda /Makefile
parenta7a0ce278e661bf5d3f2b47556d8c30469d2bd6c (diff)
server: Add plugin framework
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile10
1 files changed, 8 insertions, 2 deletions
diff --git a/Makefile b/Makefile
index 8922662..307fbfa 100644
--- a/Makefile
+++ b/Makefile
@@ -1,9 +1,13 @@
CC = gcc
-CFLAGS = -Wall -Wextra -std=c11 -g -fwrapv
-LDFLAGS = -lsqlite3
+CFLAGS = -Wall -Wextra -std=c11 -g -fwrapv -D_BSD_SOURCE
+LDFLAGS = -lsqlite3 -ldl
TARGETS = tomsg_server
+PLUGINDIR = plugins
+
+PLUGINS = $(patsubst $(PLUGINDIR)/%,%,$(shell find $(PLUGINDIR)/ -maxdepth 1 -type d))
+
.PHONY: all clean remake
# Clear all implicit suffix rules
@@ -13,9 +17,11 @@ TARGETS = tomsg_server
.SECONDARY:
all: $(TARGETS)
+ for pl in $(PLUGINS); do make --no-print-directory -C $(PLUGINDIR) $@ PLUGINNAME=$$pl; done
clean:
rm -f $(TARGETS) *.o *.sql.h
+ for pl in $(PLUGINS); do make --no-print-directory -C $(PLUGINDIR) $@ PLUGINNAME=$$pl; done
remake: clean
$(MAKE) all