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