Makefile (1640B)
1 # ttywm 2 VERSION = 0.6 3 PREFIX = /usr/local 4 5 PKGS = x11 xft fontconfig dbus-1 6 CFLAGS += -std=c99 -pedantic -Wall -Os -D_DEFAULT_SOURCE -DVERSION=\"$(VERSION)\" `pkg-config --cflags $(PKGS)` 7 LDLIBS += `pkg-config --libs $(PKGS)` -lpam 8 9 all: ttywm ttywmbg 10 11 ttywm: ttywm.c 12 $(CC) $(CFLAGS) -o $@ ttywm.c $(LDFLAGS) $(LDLIBS) 13 14 ttywmbg: ttywmbg.c 15 $(CC) -std=c99 -Wall -Os -D_DEFAULT_SOURCE `pkg-config --cflags x11 libpng` -o $@ ttywmbg.c $(LDFLAGS) `pkg-config --libs x11 libpng` -ljpeg 16 17 install: ttywm ttywmbg 18 @[ -n "$(DESTDIR)" ] || command -v tyrmel >/dev/null || { echo "ttywm needs tyrmel: install it first"; exit 1; } 19 mkdir -p $(DESTDIR)$(PREFIX)/bin 20 install -m 755 ttywm ttywmbg ttywm-term ttywm-session $(DESTDIR)$(PREFIX)/bin/ 21 mkdir -p $(DESTDIR)/usr/share/fonts/ttywm 22 install -m 644 vga.ttf $(DESTDIR)/usr/share/fonts/ttywm/ 23 -fc-cache -f $(DESTDIR)/usr/share/fonts/ttywm 24 mkdir -p $(DESTDIR)/usr/share/xsessions 25 sed 's|@PREFIX@|$(PREFIX)|' ttywm.desktop > $(DESTDIR)/usr/share/xsessions/ttywm.desktop 26 27 uninstall: 28 rm -rf $(DESTDIR)$(PREFIX)/bin/ttywm $(DESTDIR)$(PREFIX)/bin/ttywmbg $(DESTDIR)$(PREFIX)/bin/ttywm-term $(DESTDIR)$(PREFIX)/bin/ttywm-session $(DESTDIR)/usr/share/fonts/ttywm \ 29 $(DESTDIR)/usr/share/xsessions/ttywm.desktop 30 31 # fbttywm: the same on the framebuffer, without X. needs nothing but a libc 32 fbttywm: fbttywm.c 33 $(CC) -O2 -Wall -o $@ fbttywm.c 34 35 install-fb: fbttywm 36 mkdir -p $(DESTDIR)$(PREFIX)/bin 37 install -m 755 fbttywm $(DESTDIR)$(PREFIX)/bin/ 38 39 uninstall-fb: 40 rm -f $(DESTDIR)$(PREFIX)/bin/fbttywm 41 42 clean: 43 rm -f ttywm ttywmbg fbttywm 44 45 .PHONY: all install uninstall install-fb uninstall-fb clean