JasonWoof Got questions, comments, patches, etc.? Contact Jason Woofenden
Add new quirk IGNORESPAWNWS.
[spectrwm.git] / freebsd / Makefile
1 .sinclude <bsd.port.pre.mk>
2
3 PREFIX?= /usr/local
4 LOCALBASE?= /usr/local
5
6 SWM_BINDIR?= $(PREFIX)/bin
7 SWM_LIBDIR?= $(PREFIX)/lib
8 SWM_MANDIR?= $(PREFIX)/man
9
10 CC?= cc
11
12 LVERS!= awk -F = '/major/ { printf( "%s.", $$2 ) } /minor/ { printf( "%s", $$2 ) }' ${.CURDIR}/../lib/shlib_version
13 BUILDVERSION!= sh "${.CURDIR}/../buildver.sh"
14 .if !${BUILDVERSION} == ""
15 CFLAGS+= -DSPECTRWM_BUILDSTR=\"$(BUILDVERSION)\"
16 .endif
17
18 CFLAGS+= -std=c99 -Wmissing-prototypes -Wall -Wextra -Wshadow -Wno-uninitialized -g
19 CFLAGS+= -I. -I${LOCALBASE}/include -I${LOCALBASE}/include/freetype2
20 CFLAGS+= -DSWM_LIB=\"$(SWM_LIBDIR)/libswmhack.so.$(LVERS)\"
21 LDADD+= -lutil -L${LOCALBASE}/lib -lX11 -lX11-xcb -lxcb \
22         -lxcb-icccm -lxcb-keysyms -lxcb-randr -lxcb-util -lxcb-xtest -lXft -lXcursor
23
24
25 all: spectrwm libswmhack.so.$(LVERS)
26
27 spectrwm.c:
28         ln -sf ../spectrwm.c
29         ln -sf ../version.h
30
31 swm_hack.c:
32         ln -sf ../lib/swm_hack.c
33
34 spectrwm: spectrwm.o
35         $(CC) $(LDFLAGS) $(LDADD) -o ${.TARGET} ${.ALLSRC}
36
37 swm_hack.so: swm_hack.c
38         $(CC) $(CFLAGS) -c -shared -fpic -DPIC -o ${.TARGET} ${.ALLSRC}
39
40 libswmhack.so.$(LVERS): swm_hack.so
41         $(CC) $(LDFLAGS) -shared -fpic -o ${.TARGET} ${.ALLSRC}
42
43 install: all
44         install -m 755 -d $(SWM_BINDIR)
45         install -m 755 -d $(SWM_LIBDIR)
46         install -m 755 -d $(SWM_MANDIR)/man1
47         install -m 755 spectrwm $(SWM_BINDIR)
48         install -m 755 libswmhack.so.$(LVERS) $(SWM_LIBDIR)
49         install -m 644 ../spectrwm.1 $(SWM_MANDIR)/man1/spectrwm.1
50         install -m 644 ../spectrwm_es.1 $(SWM_MANDIR)/man1/spectrwm_es.1
51         install -m 644 ../spectrwm_it.1 $(SWM_MANDIR)/man1/spectrwm_it.1
52         install -m 644 ../spectrwm_pt.1 $(SWM_MANDIR)/man1/spectrwm_pt.1
53         install -m 644 ../spectrwm_ru.1 $(SWM_MANDIR)/man1/spectrwm_ru.1
54         ln -sf spectrwm $(SWM_BINDIR)/scrotwm
55
56 clean:
57         rm -f spectrwm *.o *.so libswmhack.so.* spectrwm.c swm_hack.c version.h
58
59 .PHONY: all install clean
60
61 .sinclude <bsd.port.post.mk>