summaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authortomsmeding <tom.smeding@gmail.com>2016-12-25 22:55:21 +0100
committertomsmeding <tom.smeding@gmail.com>2016-12-25 22:56:13 +0100
commited2b3a38ec05c566c645dc2aabfd513edff8d63b (patch)
tree388cf0c5d6a425f5d7f86783e0c67e930f94c6a4 /Makefile
parent70431dcb67e33bd466d03fb41e5a90ba301127a4 (diff)
Plugins
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile8
1 files changed, 7 insertions, 1 deletions
diff --git a/Makefile b/Makefile
index 1583287..078b0a0 100644
--- a/Makefile
+++ b/Makefile
@@ -7,12 +7,18 @@ else
endif
BIN = cserver
+PLUGINDIR = plugins
+
+PLUGINS = $(patsubst $(PLUGINDIR)/%,%,$(shell find $(PLUGINDIR)/ -maxdepth 1 -type d))
+
.PHONY: all clean remake
all: $(BIN)
+ for pl in $(PLUGINS); do make -C $(PLUGINDIR) $@ PLUGINNAME=$$pl; done
clean:
rm -rf $(BIN) *.o *.dSYM
+ for pl in $(PLUGINS); do make -C $(PLUGINDIR) $@ PLUGINNAME=$$pl; done
remake: clean all
@@ -20,5 +26,5 @@ remake: clean all
$(BIN): $(patsubst %.c,%.o,$(wildcard *.c))
$(CC) -o $@ $^
-%.o: %.cpp $(wildcard *.h)
+%.o: %.c $(wildcard $(dir %.o)*.h)
$(CC) $(CFLAGS) -c -o $@ $<