3 include $(TOPDIR)/common.mk
5 # Depend on the object files of all source-files in src/*.c and on all header files
6 AUTOGENERATED:=src/cfgparse.tab.c src/cfgparse.yy.c
7 FILES:=$(filter-out $(AUTOGENERATED),$(wildcard src/*.c))
9 HEADERS=$(wildcard include/*.h)
11 # Depend on the specific file (.c for each .o) and on all headers
12 src/%.o: src/%.c ${HEADERS}
14 $(CC) $(CFLAGS) -c -o $@ $<
16 all: src/cfgparse.y.o src/cfgparse.yy.o ${FILES}
18 $(CC) -o i3 ${FILES} src/cfgparse.y.o src/cfgparse.yy.o $(LDFLAGS)
21 $(MAKE) TOPDIR=$(TOPDIR) -C i3-msg
23 src/cfgparse.yy.o: src/cfgparse.l
25 lex -i -o $(@:.o=.c) $<
26 $(CC) $(CFLAGS) -c -o $@ $(@:.o=.c)
28 src/cfgparse.y.o: src/cfgparse.y
30 yacc --debug --verbose -b $(basename $< .y) -d $<
31 $(CC) $(CFLAGS) -c -o $@ $(<:.y=.tab.c)
35 $(INSTALL) -d -m 0755 $(DESTDIR)/usr/bin
36 $(INSTALL) -d -m 0755 $(DESTDIR)/etc/i3
37 $(INSTALL) -d -m 0755 $(DESTDIR)/usr/share/xsessions
38 $(INSTALL) -m 0755 i3 $(DESTDIR)/usr/bin/
39 test -e $(DESTDIR)/etc/i3/config || $(INSTALL) -m 0644 i3.config $(DESTDIR)/etc/i3/config
40 $(INSTALL) -m 0644 i3.desktop $(DESTDIR)/usr/share/xsessions/
41 $(MAKE) TOPDIR=$(TOPDIR) -C i3-msg install
44 [ ! -d i3-${VERSION} ] || rm -rf i3-${VERSION}
45 [ ! -e i3-${VERSION}.tar.bz2 ] || rm i3-${VERSION}.tar.bz2
47 cp DEPENDS GOALS LICENSE PACKAGE-MAINTAINER TODO RELEASE-NOTES-${VERSION} i3.config i3.desktop pseudo-doc.doxygen Makefile i3-${VERSION}
48 cp -r src i3-msg include man i3-${VERSION}
49 # Only copy toplevel documentation (important stuff)
50 mkdir i3-${VERSION}/docs
51 find docs -maxdepth 1 -type f ! -name "*.xcf" -exec cp '{}' i3-${VERSION}/docs \;
52 sed -e 's/^GIT_VERSION=\(.*\)/GIT_VERSION=${GIT_VERSION}/g;s/^VERSION=\(.*\)/VERSION=${VERSION}/g' common.mk > i3-${VERSION}/common.mk
53 # Pre-generate a manpage to allow distributors to skip this step and save some dependencies
55 cp man/i3.1 i3-${VERSION}/man/i3.1
56 tar cf i3-${VERSION}.tar i3-${VERSION}
57 bzip2 -9 i3-${VERSION}.tar
61 rm -f src/*.o src/cfgparse.tab.{c,h} src/cfgparse.yy.c
64 $(MAKE) TOPDIR=$(TOPDIR) -C i3-msg clean
68 $(MAKE) TOPDIR=$(TOPDIR) -C i3-msg distclean