From da2d463ab77ff99dc80d41351390830f6b4d5f88 Mon Sep 17 00:00:00 2001 From: Bob Polis Date: Tue, 27 Oct 2020 15:27:46 +0100 Subject: [PATCH] changed for plugin support --- Makefile | 20 +++++++++++++++++--- RectSaver.cpp => rects/RectSaver.cpp | 0 RectSaver.hpp => rects/RectSaver.hpp | 0 3 files changed, 17 insertions(+), 3 deletions(-) rename RectSaver.cpp => rects/RectSaver.cpp (100%) rename RectSaver.hpp => rects/RectSaver.hpp (100%) diff --git a/Makefile b/Makefile index 807570a..c985c1c 100644 --- a/Makefile +++ b/Makefile @@ -1,4 +1,5 @@ BIN := $(shell basename $$(pwd)) +PLUGINS := rect MANSECTION := 1 MANPAGE := $(BIN).$(MANSECTION) @@ -27,11 +28,11 @@ else CXXFLAGS += -D NDEBUG -O3 endif -LDLIBS := -lm -lpthread -lscgui -lSDL2 -lcairo -lscerror +LDLIBS := -lm -lpthread -lscgui -lSDL2 -lcairo -lscerror -lscstring -.PHONY: all clean install +.PHONY: all clean install modules -all: $(BIN) +all: $(BIN) $(PLUGINS) $(BIN): $(OBJS) $(DEPS) $(CXX) $(OBJS) $(LDFLAGS) $(LDLIBS) -o $(BIN) @@ -43,8 +44,21 @@ $(BIN): $(OBJS) $(DEPS) %.d: ; +modules: $(PLUGINS) + mkdir -p plugins + @for plug in $(PLUGINS) ;\ + do \ + cd $$plug && $(MAKE) && $(MAKE) install ;\ + cd .. ;\ + done + clean: $(RM) $(OBJS) $(DEPS) $(BIN) + $(RM) -r plugins + @for plug in $(PLUGINS) ;\ + do \ + $(MAKE) -C $$plug clean ;\ + done install: $(BIN) $(INSTALL) -d $(BINDIR) diff --git a/RectSaver.cpp b/rects/RectSaver.cpp similarity index 100% rename from RectSaver.cpp rename to rects/RectSaver.cpp diff --git a/RectSaver.hpp b/rects/RectSaver.hpp similarity index 100% rename from RectSaver.hpp rename to rects/RectSaver.hpp