]> git.sur5r.net Git - i3/i3/commitdiff
Move i3-config-wizard to the new Makefile layout
authorQuentin Glidic <sardemff7+git@sardemff7.net>
Wed, 16 May 2012 14:22:57 +0000 (16:22 +0200)
committerQuentin Glidic <sardemff7+git@sardemff7.net>
Sun, 22 Jul 2012 17:57:21 +0000 (19:57 +0200)
Makefile
i3-config-wizard/i3-config-wizard.mk [new file with mode: 0644]

index 2ffdffcc5bf282c9bdb25a75c4b5d31a08535c95..3f434427d3746fd95c47fd366d3095efa5545726 100644 (file)
--- 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 (file)
index 0000000..ed41941
--- /dev/null
@@ -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}