1 CFLAGS+= -Wall -Wextra -g -D_GNU_SOURCE -I. -I/usr/include/freetype2
2 CFLAGS+= -DSWM_LIB=\"$(LIBDIR)/libswmhack.so.$(LVERS)\"
3 LDADD+= -lX11 -lX11-xcb -lxcb -lxcb-icccm -lxcb-randr -lxcb-keysyms -lxcb-util -lxcb-xtest -lXft
8 MANDIR?= $(PREFIX)/share/man
12 LVERS= $(shell . ../lib/shlib_version; echo $$major.$$minor)
14 BUILDVERSION= $(shell sh $(CURDIR)/../buildver.sh)
15 ifneq ("${BUILDVERSION}", "")
16 CFLAGS+= -DSPECTRWM_BUILDSTR=\"$(BUILDVERSION)\"
19 all: spectrwm libswmhack.so.$(LVERS)
26 ln -sf ../lib/swm_hack.c
28 spectrwm: spectrwm.o linux.o
29 $(CC) $(LDFLAGS) -o $@ $+ $(LDADD)
32 $(CC) $(CFLAGS) -c -fpic -DPIC $+ -o $@
34 libswmhack.so.$(LVERS): swm_hack.so
35 $(CC) -shared -fpic -o libswmhack.so.$(LVERS) swm_hack.so $(LDADD)
38 install -m 755 -d $(DESTDIR)$(BINDIR)
39 install -m 755 -d $(DESTDIR)$(LIBDIR)
40 install -m 755 -d $(DESTDIR)$(MANDIR)/man1
41 install -m 755 spectrwm $(DESTDIR)$(BINDIR)
42 install -m 755 libswmhack.so.$(LVERS) $(DESTDIR)$(LIBDIR)
43 install -m 644 ../spectrwm.1 $(DESTDIR)$(MANDIR)/man1/spectrwm.1
44 install -m 644 ../spectrwm_es.1 $(DESTDIR)$(MANDIR)/man1/spectrwm_es.1
45 install -m 644 ../spectrwm_it.1 $(DESTDIR)$(MANDIR)/man1/spectrwm_it.1
46 install -m 644 ../spectrwm_pt.1 $(DESTDIR)$(MANDIR)/man1/spectrwm_pt.1
47 install -m 644 ../spectrwm_ru.1 $(DESTDIR)$(MANDIR)/man1/spectrwm_ru.1
48 ln -sf $(DESTDIR)$(BINDIR)/spectrwm $(DESTDIR)$(BINDIR)/scrotwm
51 rm -f spectrwm *.o *.so libswmhack.so.* spectrwm.c swm_hack.c version.h
53 .PHONY: all install clean