-plugins_dir:=plugins
-plugins_srcdir:=$(srcdir)/$(plugins_dir)
-plugins_depdir:=$(depdir)/$(plugins_dir)
+all install uninstall clean distclean:
+ @$(MAKE) -$(MAKEFLAGS) -f build/Makefile.plugins.resistance $@
+ @$(MAKE) -$(MAKEFLAGS) -f build/Makefile.plugins.placement $@
-plugins_resistance_dir:=$(plugins_dir)
-plugins_resistance_srcdir:=$(plugins_srcdir)
-plugins_resistance_target:=resistance.la
-plugins_resistance_sources:=resistance.c
-plugins_resistance_CPPFLAGS:=$(CPPFLAGS) $(GLIB_CFLAGS) $(XFT_CFLAGS) \
- -DG_LOG_DOMAIN=\"Plugin-Resistance\"
-
-plugins_placement_dir:=$(plugins_dir)/placement
-plugins_placement_srcdir:=$(plugins_srcdir)/placement
-plugins_placement_target:=placement.la
-plugins_placement_sources:=placement.c history.c
-plugins_placement_CPPFLAGS:=$(CPPFLAGS) $(GLIB_CFLAGS) $(XFT_CFLAGS) \
- -DG_LOG_DOMAIN=\"Plugin-Placement\"
-
-plugins_targets:=$(plugins_resistance_dir)/$(plugins_resistance_target)
-plugins_targets:=$(plugins_targets) $(plugins_placement_dir)/$(plugins_placement_target)
-
-plugins_resistance_objects:=$(addprefix $(plugins_resistance_dir)/,$(plugins_resistance_sources:.c=.lo))
-plugins_resistance_sources:=$(addprefix $(plugins_resistance_srcdir)/,$(plugins_resistance_sources))
-plugins_resistance_target:=$(addprefix $(plugins_resistance_dir)/,$(plugins_resistance_target))
-plugins_resistance_deps:=$(addprefix $(depdir)/,$(plugins_resistance_objects:.lo=.d))
-plugins_resistance_depdir:=$(depdir)/$(plugins_resistance_dir)
-
-plugins_placement_objects:=$(addprefix $(plugins_placement_dir)/,$(plugins_placement_sources:.c=.lo))
-plugins_placement_sources:=$(addprefix $(plugins_placement_srcdir)/,$(plugins_placement_sources))
-plugins_placement_target:=$(addprefix $(plugins_placement_dir)/,$(plugins_placement_target))
-plugins_placement_deps:=$(addprefix $(depdir)/,$(plugins_placement_objects:.lo=.d))
-plugins_placement_depdir:=$(depdir)/$(plugins_placement_dir)
-
-## plugins_resistance
-
-$(plugins_resistance_target): $(plugins_resistance_objects)
- $(LIBTOOL) --mode=link $(CC) -rpath $(plugindir) $(plugins_resistance_CPPFLAGS) \
- $(CFLAGS) -module -avoid-version -o $@ $^
-
-$(plugins_resistance_dir):
- @mkdir $@
-
-$(plugins_resistance_dir)/%.lo: $(plugins_resistance_srcdir)/%.c $(plugins_resistance_depdir)/%.d
- $(LIBTOOL) --mode=compile $(CC) $(DEFS) \
- $(plugins_resistance_CPPFLAGS) $(CFLAGS) -c -o $@ $<
-
-$(plugins_resistance_depdir)/%.d: $(plugins_resistance_srcdir)/%.c $(depdir)
- @echo Building dependancies for $<
- $(INSTALL) -d $(dir $@)
- @$(CC) $(plugins_resistance_CPPFLAGS) $(CFLAGS) -w -MM -MF $@ -MQ $(<:.c=.lo) $<
-
-## end plugins_resistance
-
-## plugins_placement
-
-$(plugins_placement_target): $(plugins_placement_objects)
- $(LIBTOOL) --mode=link $(CC) -rpath $(plugindir) $(plugins_placement_CPPFLAGS) \
- $(CFLAGS) -module -avoid-version -o $@ $^
-
-$(plugins_placement_dir):
- @mkdir $@
-
-$(plugins_placement_dir)/%.lo: $(plugins_placement_srcdir)/%.c $(plugins_placement_depdir)/%.d
- $(LIBTOOL) --mode=compile $(CC) $(DEFS) \
- $(plugins_placement_CPPFLAGS) $(CFLAGS) -c -o $@ $<
-
-$(plugins_placement_depdir)/%.d: $(plugins_placement_srcdir)/%.c
- @echo Building dependancies for $<
- $(INSTALL) -d $(dir $@)
- @$(CC) $(plugins_placement_CPPFLAGS) $(CFLAGS) -w -MM -MF $@ -MQ $(<:.c=.lo) $<
-
-## end plugins_placement
-
-plugins-install:
- $(INSTALL) -d $(DESTDIR)$(plugindir)/
- $(LIBTOOL) --mode=install $(INSTALL) $(plugins_resistance_target) \
- $(DESTDIR)$(plugindir)/$(notdir $(plugins_resistance_target))
- $(LIBTOOL) --mode=install $(INSTALL) $(plugins_placement_target) \
- $(DESTDIR)$(plugindir)/$(notdir $(plugins_placement_target))
- $(LIBTOOL) --mode=finish $(DESTDIR)$(plugindir)
-
-plugins-uninstall:
- $(LIBTOOL) --mode=uninstall $(RM) \
- $(DESTDIR)$(plugindir)/$(notdir $(plugins_placement_target))
- $(LIBTOOL) --mode=uninstall $(RM) \
- $(DESTDIR)$(plugindir)/$(notdir $(plugins_resistance_target))
- -rmdir $(DESTDIR)$(plugindir)/
-
-plugins-clean:
- $(RM) $(plugins_resistance_target) $(plugins_resistance_objects)
- $(RM) $(plugins_resistance_dir)/*\~
- $(RM) $(plugins_placement_target) $(plugins_placement_objects)
- $(RM) $(plugins_placement_dir)/*\~
-
--include $(plugins_resistance_deps) $(plugins_placement_deps)
-
-.PHONY: plugins-install plugins-uninstall plugins-clean
+.PHONY: all clean distclean install uninstall
--- /dev/null
+include build/Makefile.incl
+
+dir = plugins/placement
+
+CPPFLAGS += $(GLIB_CFLAGS) $(XFT_CFLAGS) -DG_LOG_DOMAIN=\"Plugin-Placement\"
+LDFLAGS = -module -avoid-version
+
+target = placement.la
+sources = history.c placement.c
+
+srcdir := $(srcdir)/$(dir)
+target := $(addprefix $(dir)/,$(target))
+objects := $(addprefix $(dir)/,$(sources:.c=.lo))
+sources := $(addprefix $(srcdir)/,$(sources))
+deps := $(addprefix $(depdir)/,$(objects:.lo=.d))
+depdir := $(depdir)/$(dir)
+
+all: $(target)
+
+$(target): $(objects)
+ $(LINK) -rpath $(plugindir) -o $@ $^ $(LDFLAGS)
+
+$(dir)/%.lo: $(srcdir)/%.c $(depdir)/%.d
+ $(LTCOMPILE) -c -o $@ $<
+
+$(depdir)/%.d: $(srcdir)/%.c
+ @echo Building dependancies for $<
+ $(INSTALL) -d $(depdir)
+ @$(DEPCOMPILE) -w -MM -MF $@ -MQ $(<:.c=.lo) $<
+
+install:
+ $(INSTALL) -d $(DESTDIR)$(plugindir)/
+ $(LIBTOOL) --mode=install $(INSTALL) $(target) \
+ $(DESTDIR)$(plugindir)/$(notdir $(target))
+ $(LIBTOOL) --mode=finish $(DESTDIR)$(plugindir)
+
+uninstall:
+ $(LTRM) $(DESTDIR)$(plugindir)/$(notdir $(target))
+
+clean:
+ $(RM) $(target) $(objects)
+ $(RM) $(srcdir)/*\~
+
+-include $(deps)
+
+.PHONY: all install uninstall clean distclean
--- /dev/null
+include build/Makefile.incl
+
+dir = plugins
+
+CPPFLAGS += $(GLIB_CFLAGS) $(XFT_CFLAGS) -DG_LOG_DOMAIN=\"Plugin-Resistance\"
+LDFLAGS = -module -avoid-version
+
+target = resistance.la
+sources = resistance.c
+
+srcdir := $(srcdir)/$(dir)
+target := $(addprefix $(dir)/,$(target))
+objects := $(addprefix $(dir)/,$(sources:.c=.lo))
+sources := $(addprefix $(srcdir)/,$(sources))
+deps := $(addprefix $(depdir)/,$(objects:.lo=.d))
+depdir := $(depdir)/$(dir)
+
+all: $(target)
+
+$(target): $(objects)
+ $(LINK) -rpath $(plugindir) -o $@ $^ $(LDFLAGS)
+
+$(dir)/%.lo: $(srcdir)/%.c $(depdir)/%.d
+ $(LTCOMPILE) -c -o $@ $<
+
+$(depdir)/%.d: $(srcdir)/%.c
+ @echo Building dependancies for $<
+ $(INSTALL) -d $(depdir)
+ @$(DEPCOMPILE) -w -MM -MF $@ -MQ $(<:.c=.lo) $<
+
+install:
+ $(INSTALL) -d $(DESTDIR)$(plugindir)/
+ $(LIBTOOL) --mode=install $(INSTALL) $(target) \
+ $(DESTDIR)$(plugindir)/$(notdir $(target))
+ $(LIBTOOL) --mode=finish $(DESTDIR)$(plugindir)
+
+uninstall:
+ $(LTRM) $(DESTDIR)$(plugindir)/$(notdir $(target))
+
+clean:
+ $(RM) $(target) $(objects)
+ $(RM) $(srcdir)/*\~
+
+-include $(deps)
+
+.PHONY: all install uninstall clean distclean