JasonWoof Got questions, comments, patches, etc.? Contact Jason Woofenden
Fix xterm resource.
[spectrwm.git] / osx / Makefile
1 CFLAGS+= -O2 -Wall -ggdb -D_GNU_SOURCE -D__OSX__ -I. -I..
2 CFLAGS+= -DSWM_LIB=\"$(LIBDIR)/libswmhack.so.$(LVERS)\"
3 LDADD+=  -L/usr/X11/lib/ -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 all: spectrwm libswmhack.so.$(LVERS)
15
16 spectrwm.c:
17         ln -sf ../spectrwm.c
18
19 swm_hack.c:
20         ln -sf ../lib/swm_hack.c
21
22 spectrwm: spectrwm.o osx.o
23         $(CC) $(LDFLAGS) -o $@ $+ $(LDADD)
24
25 %.so: %.c
26         $(CC) $(CFLAGS) -c -fpic -DPIC $+ -o $@
27
28 libswmhack.so.$(LVERS): swm_hack.so
29         $(CC) -shared -fpic -o libswmhack.so.$(LVERS) $(LDADD) swm_hack.so
30 # replace above line with this for OSX 10.5
31 #       $(CC) -shared -bundle -fpic -o libswmhack.so.$(LVERS) $(LDADD) swm_hack.so
32
33 install: all
34         install -m 755 -d $(DESTDIR)$(BINDIR)
35         install -m 755 -d $(DESTDIR)$(LIBDIR)
36         install -m 755 -d $(DESTDIR)$(MANDIR)/man1
37         install -m 755 spectrwm $(DESTDIR)$(BINDIR)
38         install -m 755 libswmhack.so.$(LVERS) $(DESTDIR)$(LIBDIR)
39         install -m 644 ../spectrwm.1 $(DESTDIR)$(MANDIR)/man1/spectrwm.1
40         install -m 644 ../spectrwm_es.1 $(DESTDIR)$(MANDIR)/man1/spectrwm_es.1
41         install -m 644 ../spectrwm_it.1 $(DESTDIR)$(MANDIR)/man1/spectrwm_it.1
42         install -m 644 ../spectrwm_pt.1 $(DESTDIR)$(MANDIR)/man1/spectrwm_pt.1
43         install -m 644 ../spectrwm_ru.1 $(DESTDIR)$(MANDIR)/man1/spectrwm_ru.1
44         ln -sf $(DESTDIR)$(BINDIR)/spectrwm $(DESTDIR)$(BINDIR)/scrotwm
45
46 clean:
47         rm -f spectrwm *.o *.so libswmhack.so.* spectrwm.c swm_hack.c
48
49 .PHONY: all install clean