aboutsummaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
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