From: Dana Jansens Date: Thu, 3 Apr 2003 22:02:18 +0000 (+0000) Subject: build the resistance/placement plugins X-Git-Url: https://git.dogcows.com/gitweb?a=commitdiff_plain;h=609a9925beef935217ca2cb24c6b5d5d64a6035e;p=chaz%2Fopenbox build the resistance/placement plugins --- diff --git a/Makefile b/Makefile index 5fa73e6e..3d6ea2b6 100644 --- a/Makefile +++ b/Makefile @@ -1,14 +1,14 @@ all install uninstall: @$(MAKE) -$(MAKEFLAGS) -f build/Makefile.render $@ @$(MAKE) -$(MAKEFLAGS) -f build/Makefile.kernel $@ -# @$(MAKE) -$(MAKEFLAGS) -f build/Makefile.plugins $@ + @$(MAKE) -$(MAKEFLAGS) -f build/Makefile.plugins $@ # @$(MAKE) -$(MAKEFLAGS) -f build/Makefile.engines $@ # @$(MAKE) -$(MAKEFLAGS) -f build/Makefile.themes $@ clean: @$(MAKE) -$(MAKEFLAGS) -f build/Makefile.render $@ @$(MAKE) -$(MAKEFLAGS) -f build/Makefile.kernel $@ -# @$(MAKE) -$(MAKEFLAGS) -f build/Makefile.plugins $@ + @$(MAKE) -$(MAKEFLAGS) -f build/Makefile.plugins $@ # @$(MAKE) -$(MAKEFLAGS) -f build/Makefile.engines $@ # @$(MAKE) -$(MAKEFLAGS) -f build/Makefile.themes $@ $(RM) *\~ diff --git a/build/Makefile.incl.in b/build/Makefile.incl.in index 603055a7..1ada8e3c 100644 --- a/build/Makefile.incl.in +++ b/build/Makefile.incl.in @@ -45,6 +45,8 @@ themesdir = $(datadir)/openbox/themes depdir = .deps COMPILE = $(CC) $(DEFS) $(CPPFLAGS) $(CFLAGS) +LTCOMPILE = $(LIBTOOL) --mode=compile $(CC) $(DEFS) $(CPPFLAGS) $(CFLAGS) DEPCOMPILE = $(CC) $(DEFS) $(CPPFLAGS) $(CFLAGS) LINK = $(LIBTOOL) --mode=link $(CC) LTCLEAN = $(LIBTOOL) --mode=clean $(RM) +LTRM = $(LIBTOOL) --mode=uninstall $(RM) diff --git a/build/Makefile.kernel b/build/Makefile.kernel index 46770379..69c8ac69 100644 --- a/build/Makefile.kernel +++ b/build/Makefile.kernel @@ -49,7 +49,7 @@ uninstall: clean: $(LTCLEAN) $(target) - $(RM) $(objects) $(dir)/*\~ + $(RM) $(objects) $(srcdir)/*\~ $(RM) $(filter %.lex.c, $(sources)) $(RM) $(filter %.tab.c, $(sources)) $(RM) $(patsubst %.c,%.h, $(filter %.tab.c, $(sources))) diff --git a/build/Makefile.plugins b/build/Makefile.plugins index d3c390b1..79e3ce44 100644 --- a/build/Makefile.plugins +++ b/build/Makefile.plugins @@ -1,97 +1,5 @@ -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 diff --git a/build/Makefile.plugins.placement b/build/Makefile.plugins.placement new file mode 100644 index 00000000..1134c6af --- /dev/null +++ b/build/Makefile.plugins.placement @@ -0,0 +1,46 @@ +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 diff --git a/build/Makefile.plugins.resistance b/build/Makefile.plugins.resistance new file mode 100644 index 00000000..8a5529b2 --- /dev/null +++ b/build/Makefile.plugins.resistance @@ -0,0 +1,46 @@ +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