]> Dogcows Code - chaz/openbox/commitdiff
more build fixes, calling the other makefiles instead of including them
authorDana Jansens <danakj@orodu.net>
Thu, 3 Apr 2003 21:02:13 +0000 (21:02 +0000)
committerDana Jansens <danakj@orodu.net>
Thu, 3 Apr 2003 21:02:13 +0000 (21:02 +0000)
Makefile
build/Makefile.incl.in
build/Makefile.kernel
build/Makefile.render
openbox/.cvsignore
openbox/parse.y

index 55aeecde9460058168711e1a1504ea914ec48195..5fa73e6ef9a59c0ac5d7c612e297d7fc3ef7fe07 100644 (file)
--- 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
index 6bdf7082e201ea617fff85f246ba553bf57da3b5..603055a7a46b762435e55cbfae1e3b10be363545 100644 (file)
@@ -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)
index f45d4f4cf3dee1ed497eb5acce117e697a9fef87..ed7fe5b19b94e8d38474a2a01766c9cedcbb2184 100644 (file)
@@ -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
index b551e127e76fcb81d6c0cc4c650117b3000f86a3..f575f6faf72f847a46e5e13ca57b0687b07404e2 100644 (file)
@@ -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
index 9f07b9e0ceec2ee3a30c29d7061f55fefd632068..5060e1919e55752ae65e133e8381240841f2a06b 100644 (file)
@@ -3,3 +3,4 @@ lex.yy.c
 parse.tab.c
 parse.tab.h
 .libs
+parse.lex.c
index bc77fd9a5b9c1ee3d754774492c49a4d4e70e61a..71cc5ba92288bd7cd2b861570c1add04083c293a 100644 (file)
@@ -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;
This page took 0.040742 seconds and 4 git commands to generate.