From: Dana Jansens Date: Thu, 3 Apr 2003 21:02:13 +0000 (+0000) Subject: more build fixes, calling the other makefiles instead of including them X-Git-Url: https://git.dogcows.com/gitweb?a=commitdiff_plain;h=ce901a234111f0a6cf98b441c011289ce0d0bdfa;p=chaz%2Fopenbox more build fixes, calling the other makefiles instead of including them --- diff --git a/Makefile b/Makefile index 55aeecde..5fa73e6e 100644 --- a/Makefile +++ b/Makefile @@ -1,26 +1,20 @@ -include build/Makefile.incl - -depdir:=.deps - -all: alltargets - -include build/Makefile.render -include build/Makefile.kernel -include build/Makefile.themes -include build/Makefile.plugins -include build/Makefile.engines - -alltargets: $(kernel_target) $(plugins_targets) $(engines_targets) - -install: all render-install kernel-install themes-install plugins-install engines-install - -uninstall: render-uninstall kernel-uninstall themes-uninstall plugins-uninstall engines-uninstall - -clean: render-clean kernel-clean plugins-clean engines-clean +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.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.engines $@ +# @$(MAKE) -$(MAKEFLAGS) -f build/Makefile.themes $@ $(RM) *\~ distclean: clean $(RM) configure Makefile.incl $(RM) -r .deps/ -.PHONY: all clean distclean +.PHONY: all clean distclean install uninstall diff --git a/build/Makefile.incl.in b/build/Makefile.incl.in index 6bdf7082..603055a7 100644 --- a/build/Makefile.incl.in +++ b/build/Makefile.incl.in @@ -24,6 +24,7 @@ INSTALL = @INSTALL@ LIBTOOL = @LIBTOOL@ srcdir = @srcdir@ + # non-recursive! top_builddir = . @@ -41,4 +42,9 @@ plugindir = $(libdir)/openbox/plugins rcdir = $(datadir)/openbox themesdir = $(datadir)/openbox/themes -binary = openbox3 +depdir = .deps + +COMPILE = $(CC) $(DEFS) $(CPPFLAGS) $(CFLAGS) +DEPCOMPILE = $(CC) $(DEFS) $(CPPFLAGS) $(CFLAGS) +LINK = $(LIBTOOL) --mode=link $(CC) +LTCLEAN = $(LIBTOOL) --mode=clean $(RM) diff --git a/build/Makefile.kernel b/build/Makefile.kernel index f45d4f4c..ed7fe5b1 100644 --- a/build/Makefile.kernel +++ b/build/Makefile.kernel @@ -1,62 +1,65 @@ -kernel_dir:=kernel -kernel_target:=$(binary) -kernel_sources:=action.c client.c config.c dispatch.c engine.c event.c \ - extensions.c focus.c frame.c grab.c menu.c openbox.c \ - parse.c plugin.c prop.c screen.c stacking.c timer.c xerror.c \ - lex.yy.c parse.tab.c -kernel_lex:=parse.l -kernel_yacc:=parse.y -kernel_CPPFLAGS:=$(CPPFLAGS) $(GLIB_CFLAGS) $(GMODULE_CFLAGS) $(XFT_CFLAGS) \ - -DG_LOG_DOMAIN=\"Openbox\" -kernel_LIBS:=$(LIBS) $(GLIB_LIBS) $(GMODULE_LIBS) $(XFT_LIBS) -kernel_LDFLAGS:=-export-dynamic - -kernel_srcdir:=$(srcdir)/$(kernel_dir) -kernel_lex:=$(addprefix $(kernel_srcdir)/,$(kernel_lex)) -kernel_yacc:=$(addprefix $(kernel_srcdir)/,$(kernel_yacc)) -kernel_target:=$(addprefix $(kernel_dir)/,$(kernel_target)) -kernel_objects:=$(addprefix $(kernel_dir)/,$(kernel_sources:.c=.o)) -kernel_sources:=$(addprefix $(kernel_srcdir)/,$(kernel_sources)) -kernel_deps:=$(addprefix $(depdir)/,$(kernel_objects:.o=.d)) -kernel_depdir:=$(depdir)/$(kernel_dir) - -$(kernel_target): $(kernel_objects) $(render_target) - $(LIBTOOL) --mode=link $(CC) -o $@ $^ $(kernel_LIBS) $(kernel_LDFLAGS) - -$(kernel_dir): - @mkdir $@ - -$(kernel_dir)/%.o: $(kernel_srcdir)/%.c $(kernel_depdir)/%.d - $(CC) $(DEFS) $(kernel_CPPFLAGS) $(CFLAGS) -c -o $@ $< - -$(kernel_dir)/lex.yy.c: $(kernel_lex) - cd kernel && \ - $(FLEX) $(notdir $<) - -%.tab.h: %.tab.c - -$(kernel_dir)/%.tab.c: $(kernel_srcdir)/%.y - cd kernel && \ - $(BISON) -d $(notdir $<) - -$(kernel_depdir)/%.d: $(kernel_srcdir)/%.c +include build/Makefile.incl + +dir = kernel + +CPPFLAGS += $(GLIB_CFLAGS) $(GMODULE_CFLAGS) $(XFT_CFLAGS) \ + -DG_LOG_DOMAIN=\"Openbox\" +LIBS += $(GLIB_LIBS) $(GMODULE_LIBS) $(XFT_LIBS) +LDFLAGS = -export-dynamic + +target = openbox3 +sources = action.c client.c config.c dispatch.c engine.c event.c \ + extensions.c focus.c frame.c grab.c menu.c openbox.c \ + parse.c plugin.c prop.c screen.c stacking.c timer.c xerror.c \ + parse.lex.c parse.tab.c +lex = parse.l +yacc = parse.y + +srcdir := $(srcdir)/$(dir) +lex := $(addprefix $(srcdir)/,$(lex)) +yacc := $(addprefix $(srcdir)/,$(yacc)) +target := $(addprefix $(dir)/,$(target)) +objects := $(addprefix $(dir)/,$(sources:.c=.o)) +sources := $(addprefix $(srcdir)/,$(sources)) +deps := $(addprefix $(depdir)/,$(objects:.o=.d)) +depdir := $(depdir)/$(dir) + +all: $(target) + +$(target): $(objects) render/librender.a + $(LINK) -o $@ $^ $(LIBS) $(LDFLAGS) + +$(dir)/%.o: $(srcdir)/%.c $(depdir)/%.d + $(COMPILE) -c -o $@ $< + +%.lex.c: %.l + $(FLEX) -o$@ $< + +%.tab.c: %.y + $(BISON) -d -o $@ $< + +$(depdir)/%.d: $(srcdir)/%.c @echo Building dependancies for $< - $(INSTALL) -d $(dir $@) - @$(CC) $(kernel_CPPFLAGS) $(CFLAGS) -w -MM -MF $@ -MQ $(<:.c=.o) $< + $(INSTALL) -d $(depdir) + @$(CC) $(CPPFLAGS) $(CFLAGS) -w -MM -MF $@ -MQ $(<:.c=.o) $< -kernel-install: +install: $(INSTALL) -d $(DESTDIR)$(bindir)/ - $(INSTALL) $(kernel_target) $(DESTDIR)$(bindir)/$(notdir $(kernel_target)) + $(INSTALL) $(target) $(DESTDIR)$(bindir)/$(notdir $(target)) -kernel-uninstall: - -$(RM) $(DESTDIR)$(bindir)/$(notdir $(kernel_target)) +uninstall: + -$(RM) $(DESTDIR)$(bindir)/$(notdir $(target)) -rmdir $(DESTDIR)$(bindir)/ -kernel-clean: - $(RM) $(kernel_target) $(kernel_objects) $(kernel_dir)/*\~ - $(RM) $(kernel_srcdir)/lex.yy.c - $(RM) $(kernel_yacc:.y=.tab.c) $(kernel_yacc:.y=.tab.h) +clean: + $(LTCLEAN) $(target) + $(RM) $(objects) $(dir)/*\~ + $(RM) $(filter %.lex.c, $(sources)) + $(RM) $(filter %.tab.c, $(sources)) + $(RM) $(patsubst %.c,%.h, $(filter %.tab.c, $(sources))) + +distclean: --include $(kernel_deps) +-include $(deps) .PHONY: kernel-install kernel-uninstall kernel-clean diff --git a/build/Makefile.render b/build/Makefile.render index b551e127..f575f6fa 100644 --- a/build/Makefile.render +++ b/build/Makefile.render @@ -1,37 +1,41 @@ -render_dir:=render -render_target:=librender.a -render_sources:=color.c font.c gradient.c image.c mask.c render.c test.c -render_CPPFLAGS:=$(CPPFLAGS) $(GLIB_CFLAGS) $(XFT_CFLAGS) \ - -DG_LOG_DOMAIN=\"Render\" - -render_srcdir:=$(srcdir)/$(render_dir) -render_target:=$(addprefix $(render_dir)/,$(render_target)) -render_objects:=$(addprefix $(render_dir)/,$(render_sources:.c=.o)) -render_sources:=$(addprefix $(render_srcdir)/,$(render_sources)) -render_deps:=$(addprefix $(depdir)/,$(render_objects:.o=.d)) -render_depdir:=$(depdir)/$(render_dir) - -$(render_target): $(render_objects) - $(AR) r $@ $^ +include build/Makefile.incl + +dir = render + +CPPFLAGS += $(GLIB_CFLAGS) $(XFT_CFLAGS) -DG_LOG_DOMAIN=\"Render\" + +target = librender.a +sources = color.c font.c gradient.c image.c mask.c render.c test.c -$(render_dir): - @mkdir $@ +srcdir := $(srcdir)/$(dir) +target := $(addprefix $(dir)/, $(target)) +objects := $(addprefix $(dir)/, $(sources:.c=.o)) +sources := $(addprefix $(srcdir)/, $(sources)) +deps := $(addprefix $(depdir)/, $(objects:.o=.d)) +depdir := $(depdir)/$(dir) -$(render_dir)/%.o: $(render_srcdir)/%.c $(depdir)/%.d - $(CC) $(DEFS) $(render_CPPFLAGS) $(CFLAGS) -c -o $@ $< +all: $(target) -$(render_depdir)/%.d: $(render_srcdir)/%.c +$(target): $(objects) + $(AR) r $@ $^ + +$(dir)/%.o: $(srcdir)/%.c $(depdir)/%.d + $(COMPILE) -c -o $@ $< + +$(depdir)/%.d: $(srcdir)/%.c @echo Building dependancies for $< - $(INSTALL) -d $(dir $@) - @$(CC) $(render_CPPFLAGS) $(CFLAGS) -w -MM -MF $@ -MQ $(<:.c=.o) $< + @$(INSTALL) -d $(depdir) + @$(DEPCOMPILE) -w -MM -MF $@ -MQ $(<:.c=.o) $< + +install: -render-install: +uninstall: -render-uninstall: +clean: + $(RM) $(target) $(objects) $(srcdir)/*\~ -render-clean: - $(RM) $(render_target) $(render_objects) $(render_srcdir)/*\~ +distclean: --include $(render_deps) +-include $(deps) -.PHONY: render-install render-uninstall render-clean +.PHONY: all install uninstall clean distclean diff --git a/openbox/.cvsignore b/openbox/.cvsignore index 9f07b9e0..5060e191 100644 --- a/openbox/.cvsignore +++ b/openbox/.cvsignore @@ -3,3 +3,4 @@ lex.yy.c parse.tab.c parse.tab.h .libs +parse.lex.c diff --git a/openbox/parse.y b/openbox/parse.y index bc77fd9a..71cc5ba9 100644 --- a/openbox/parse.y +++ b/openbox/parse.y @@ -19,8 +19,8 @@ #include "parse.h" extern int yylex(); -/*extern int yyparse();*/ -/*void yyerror(char *err);*/ +extern int yyparse(); +void yyerror(char *err); extern int yylineno; extern FILE *yyin;