spectrwm/osx/Makefile
John C. Vernaleo 3f810281df Add some help to the OSX makefile if one wants to compile with
homebrew for the dependencies instead of macports.  Thanks Kyle Isom
<kyle@tyrfingr.is> for initially doing it.
2013-06-10 16:30:12 -04:00

61 lines
2 KiB
Makefile

# To use homebrew instead of macports, uncomment the following three lines.
#INCFLAGS+= -I/opt/X11/include
#LDADD+= -lX11 -lXcursor -lXft -L/opt/X11/lib
#INCFLAGS+= -I/usr/local/Cellar/freetype/2.4.10/include/freetype2
# To use homebrew instead of macports, comment out the following two lines.
INCFLAGS+= -I/opt/local/include/freetype2 -I/opt/local/include
LDADD+= -L/opt/local/lib -lX11 -lXcursor -lXft
LDADD+= -lxcb-keysyms -lxcb-util -lxcb-randr -lX11-xcb -lxcb-xtest -lxcb -lxcb-icccm
CFLAGS+= -O2 -Wall -g -D_GNU_SOURCE -D__OSX__ -I. -I.. ${INCFLAGS}
CFLAGS+= -DSWM_LIB=\"$(LIBDIR)/libswmhack.so.$(LVERS)\"
PREFIX?= /usr/local
BINDIR?= $(PREFIX)/bin
LIBDIR?= $(PREFIX)/lib
MANDIR?= $(PREFIX)/share/man
CC= gcc
LVERS= $(shell . ../lib/shlib_version; echo $$major.$$minor)
all: spectrwm libswmhack.so.$(LVERS)
spectrwm.c:
ln -sf ../linux/tree.h
ln -sf ../spectrwm.c
ln -sf ../version.h
swm_hack.c:
ln -sf ../lib/swm_hack.c
spectrwm: spectrwm.o osx.o
$(CC) $(LDFLAGS) -o $@ $+ $(LDADD)
%.so: %.c
$(CC) $(CFLAGS) -c -fpic -DPIC $+ -o $@
libswmhack.so.$(LVERS): swm_hack.so
$(CC) -shared -fpic -o libswmhack.so.$(LVERS) $(LDADD) swm_hack.so
# replace above line with this for OSX 10.5
# $(CC) -shared -bundle -fpic -o libswmhack.so.$(LVERS) $(LDADD) swm_hack.so
install: all
install -m 755 -d $(DESTDIR)$(BINDIR)
install -m 755 -d $(DESTDIR)$(LIBDIR)
install -m 755 -d $(DESTDIR)$(MANDIR)/man1
install -m 755 spectrwm $(DESTDIR)$(BINDIR)
install -m 755 libswmhack.so.$(LVERS) $(DESTDIR)$(LIBDIR)
install -m 644 ../spectrwm.1 $(DESTDIR)$(MANDIR)/man1/spectrwm.1
install -m 644 ../spectrwm_es.1 $(DESTDIR)$(MANDIR)/man1/spectrwm_es.1
install -m 644 ../spectrwm_it.1 $(DESTDIR)$(MANDIR)/man1/spectrwm_it.1
install -m 644 ../spectrwm_pt.1 $(DESTDIR)$(MANDIR)/man1/spectrwm_pt.1
install -m 644 ../spectrwm_ru.1 $(DESTDIR)$(MANDIR)/man1/spectrwm_ru.1
ln -sf $(DESTDIR)$(BINDIR)/spectrwm $(DESTDIR)$(BINDIR)/scrotwm
clean:
rm -f spectrwm *.o *.so libswmhack.so.* spectrwm.c swm_hack.c tree.h version.h
.PHONY: all install clean