JasonWoof Got questions, comments, patches, etc.? Contact Jason Woofenden
Fix fparseln flags to remove escape characters in the result.
[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 LVERS!= awk -F = '/major/ { printf( "%s.", $$2 ) } /minor/ { printf( "%s", $$2 ) }' ${.CURDIR}/../lib/shlib_version
11 BUILDVERSION!= sh "${.CURDIR}/../buildver.sh"
12 .if !${BUILDVERSION} == ""
13 CFLAGS+= -DSPECTRWM_BUILDSTR=\"$(BUILDVERSION)\"
14 .endif
15
16 CFLAGS+= -Wall -Wextra -I. -I${LOCALBASE}/include \
17          -I${LOCALBASE}/include/freetype2
18 CFLAGS+= -DSWM_LIB=\"$(SWM_LIBDIR)/libswmhack.so.$(LVERS)\"
19 LDADD+= -lutil -L${LOCALBASE}/lib -lX11 -lX11-xcb -lxcb \
20         -lxcb-icccm -lxcb-keysyms -lxcb-randr -lxcb-util -lxcb-xtest -lXft -lXcursor
21
22
23 all: spectrwm libswmhack.so.$(LVERS)
24
25 spectrwm.c:
26         ln -sf ../spectrwm.c
27         ln -sf ../version.h
28
29 swm_hack.c:
30         ln -sf ../lib/swm_hack.c
31
32 spectrwm: spectrwm.o
33         $(CC) $(LDFLAGS) $(LDADD) -o ${.TARGET} ${.ALLSRC}
34
35 swm_hack.so: swm_hack.c
36         $(CC) $(CFLAGS) -c -shared -fpic -DPIC -o ${.TARGET} ${.ALLSRC}
37
38 libswmhack.so.$(LVERS): swm_hack.so
39         $(CC) $(LDFLAGS) -shared -fpic -o ${.TARGET} ${.ALLSRC}
40
41 install: all
42         install -m 755 -d $(SWM_BINDIR)
43         install -m 755 -d $(SWM_LIBDIR)
44         install -m 755 -d $(SWM_MANDIR)/man1
45         install -m 755 spectrwm $(SWM_BINDIR)
46         install -m 755 libswmhack.so.$(LVERS) $(SWM_LIBDIR)
47         install -m 644 ../spectrwm.1 $(SWM_MANDIR)/man1/spectrwm.1
48         install -m 644 ../spectrwm_es.1 $(SWM_MANDIR)/man1/spectrwm_es.1
49         install -m 644 ../spectrwm_it.1 $(SWM_MANDIR)/man1/spectrwm_it.1
50         install -m 644 ../spectrwm_pt.1 $(SWM_MANDIR)/man1/spectrwm_pt.1
51         install -m 644 ../spectrwm_ru.1 $(SWM_MANDIR)/man1/spectrwm_ru.1
52         ln -sf $(SWM_BINDIR)/spectrwm $(SWM_BINDIR)/scrotwm
53
54 clean:
55         rm -f spectrwm *.o *.so libswmhack.so.* spectrwm.c swm_hack.c version.h
56
57 .PHONY: all install clean
58
59 .sinclude <bsd.port.post.mk>