JasonWoof Got questions, comments, patches, etc.? Contact Jason Woofenden
convert set_win_state() and getstate() to XCB.
[spectrwm.git] / linux / Makefile
1 CFLAGS+= -Wall -g -D_GNU_SOURCE -I.
2 CFLAGS+= -DSWM_LIB=\"$(LIBDIR)/libswmhack.so.$(LVERS)\"
3 LDADD+= -lX11 -lXrandr -lXtst
4
5 PREFIX?= /usr/local
6 BINDIR?= $(PREFIX)/bin
7 LIBDIR?= $(PREFIX)/lib
8 MANDIR?= $(PREFIX)/share/man
9
10 CC= gcc
11
12 LVERS= $(shell . ../lib/shlib_version; echo $$major.$$minor)
13
14 BUILDVERSION= $(shell sh $(CURDIR)/../buildver.sh)
15 ifneq ("${BUILDVERSION}", "")
16 CFLAGS+= -DSPECTRWM_BUILDSTR=\"$(BUILDVERSION)\"
17 endif
18
19 all: spectrwm libswmhack.so.$(LVERS)
20
21 spectrwm.c:
22         ln -sf ../spectrwm.c
23         ln -sf ../version.h
24
25 swm_hack.c:
26         ln -sf ../lib/swm_hack.c
27
28 spectrwm: spectrwm.o linux.o
29         $(CC) $(LDFLAGS) -o $@ $+ $(LDADD)
30
31 %.so: %.c
32         $(CC) $(CFLAGS) -c -fpic -DPIC $+ -o $@
33
34 libswmhack.so.$(LVERS): swm_hack.so
35         $(CC) -shared -fpic -o libswmhack.so.$(LVERS) swm_hack.so $(LDADD)
36
37 install: all
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
49
50 clean:
51         rm -f spectrwm *.o *.so libswmhack.so.* spectrwm.c swm_hack.c version.h
52
53 .PHONY: all install clean