include build/Makefile.incl dir = kernel CPPFLAGS += $(GLIB_CFLAGS) $(GMODULE_CFLAGS) $(XFT_CFLAGS) $(X_CFLAGS) \ -DG_LOG_DOMAIN=\"Openbox\" LIBS += $(GLIB_LIBS) $(GMODULE_LIBS) $(XFT_LIBS) $(X_LIBS) $(XINERAMA_LIBS) LDFLAGS += -export-dynamic target = openbox3 sources = action.c client.c dispatch.c engine.c event.c group.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 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) all: $(target) $(target): $(objects) render/librender.a $(LINK) -o $@ $^ $(LIBS) $(LDFLAGS) # kill the implicit .c.y rule $(srcdir)/%.c: $(srcdir)/%.y @ $(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 $(depdir) @$(CC) $(CPPFLAGS) $(CFLAGS) -w -MM -MF $@ -MQ $(<:.c=.o) $< install: $(INSTALL) -d $(DESTDIR)$(bindir)/ $(INSTALL) $(target) $(DESTDIR)$(bindir)/$(notdir $(target)) uninstall: -$(RM) $(DESTDIR)$(bindir)/$(notdir $(target)) -rmdir $(DESTDIR)$(bindir)/ clean: $(LTCLEAN) $(target) $(RM) $(objects) $(srcdir)/*\~ $(RM) $(filter %.lex.c, $(sources)) $(RM) $(filter %.tab.c, $(sources)) $(RM) $(patsubst %.c,%.h, $(filter %.tab.c, $(sources))) distclean: -include $(deps) .PHONY: all install uninstall clean distclean