From 0c2e4d8347dd440cd1d6d86e5b050af931966a0d Mon Sep 17 00:00:00 2001 From: Quentin Glidic Date: Wed, 16 May 2012 16:22:57 +0200 Subject: [PATCH] Move i3-config-wizard to the new Makefile layout --- Makefile | 3 ++- i3-config-wizard/i3-config-wizard.mk | 35 ++++++++++++++++++++++++++++ 2 files changed, 37 insertions(+), 1 deletion(-) create mode 100644 i3-config-wizard/i3-config-wizard.mk diff --git a/Makefile b/Makefile index 2ffdffcc..3f434427 100644 --- a/Makefile +++ b/Makefile @@ -2,7 +2,7 @@ TOPDIR=$(shell pwd) include $(TOPDIR)/common.mk -SUBDIRS:=i3-msg i3-input i3-nagbar i3-config-wizard i3bar i3-dump-log +SUBDIRS:=i3-msg i3-input i3-nagbar i3bar i3-dump-log ALL_TARGETS = INSTALL_TARGETS = @@ -13,6 +13,7 @@ all: real-all include libi3/libi3.mk include src/i3.mk +include i3-config-wizard/i3-config-wizard.mk real-all: $(ALL_TARGETS) subdirs diff --git a/i3-config-wizard/i3-config-wizard.mk b/i3-config-wizard/i3-config-wizard.mk new file mode 100644 index 00000000..ed41941b --- /dev/null +++ b/i3-config-wizard/i3-config-wizard.mk @@ -0,0 +1,35 @@ +ALL_TARGETS += i3-config-wizard/i3-config-wizard +INSTALL_TARGETS += install-i3-config-wizard +CLEAN_TARGETS += clean-i3-config-wizard + +i3_config_wizard_SOURCES_GENERATED = i3-config-wizard/cfgparse.tab.c i3-config-wizard/cfgparse.yy.c +i3_config_wizard_SOURCES := $(filter-out $(i3_config_wizard_SOURCES_GENERATED),$(wildcard i3-config-wizard/*.c)) +i3_config_wizard_HEADERS := $(wildcard i3-config-wizard/*.h) + +i3_config_wizard_OBJECTS := $(i3_config_wizard_SOURCES_GENERATED:.c=.o) $(i3_config_wizard_SOURCES:.c=.o) + + +i3-config-wizard/%.o: i3-config-wizard/%.c $(i3_config_wizard_HEADERS) + echo "[i3-config-wizard] CC $<" + $(CC) $(CPPFLAGS) $(CFLAGS) -c -o $@ $< + +i3-config-wizard/cfgparse.yy.c: i3-config-wizard/cfgparse.l i3-config-wizard/cfgparse.tab.o $(i3_config_wizard_HEADERS) + echo "[i3-config-wizard] LEX $<" + $(FLEX) -i -o $@ $< + +i3-config-wizard/cfgparse.tab.c: i3-config-wizard/cfgparse.y $(i3_config_wizard_HEADERS) + echo "[i3-config-wizard] YACC $<" + $(BISON) --debug --verbose -b $(basename $< .y) -d $< + +i3-config-wizard/i3-config-wizard: libi3.a $(i3_config_wizard_OBJECTS) + echo "[i3-config-wizard] Link i3-config-wizard" + $(CC) $(LDFLAGS) -o $@ $(filter-out libi3.a,$^) $(LIBS) + +install-i3-config-wizard: i3-config-wizard/i3-config-wizard + echo "[i3-config-wizard] Install" + $(INSTALL) -d -m 0755 $(DESTDIR)$(PREFIX)/bin + $(INSTALL) -m 0755 i3-config-wizard/i3-config-wizard $(DESTDIR)$(PREFIX)/bin/ + +clean-i3-config-wizard: + echo "[i3-config-wizard] Clean" + rm -f $(i3_config_wizard_OBJECTS) $(i3_config_wizard_SOURCES_GENERATED) i3-config-wizard/i3-config-wizard i3-config-wizard/cfgparse.{output,dot}