2013-02-04 08:35:23 -05:00
|
|
|
CFLAGS?=-Wall -Os
|
2012-08-27 06:24:30 -04:00
|
|
|
PREFIX?=$(DESTDIR)/usr
|
|
|
|
BINDIR?=$(PREFIX)/bin
|
2013-05-19 08:16:34 -04:00
|
|
|
MANDIR?=$(PREFIX)/share/man/man1
|
2012-06-29 13:10:13 -04:00
|
|
|
|
2013-01-20 07:01:13 -05:00
|
|
|
# Check deps.
|
|
|
|
|
|
|
|
PKG_CONFIG?=$(shell which pkg-config)
|
|
|
|
ifeq (${PKG_CONFIG},${EMPTY})
|
|
|
|
$(error Failed to find pkg-config. Please install pkg-config)
|
|
|
|
endif
|
|
|
|
|
|
|
|
LDADD?=$(shell ${PKG_CONFIG} --cflags --libs x11 xinerama xft)
|
|
|
|
|
|
|
|
ifeq (${LDADD},${EMPTY})
|
|
|
|
$(error Failed to find the required dependencies: x11, xinerama, xft)
|
|
|
|
endif
|
|
|
|
|
2012-06-29 13:10:13 -04:00
|
|
|
all: normal
|
|
|
|
|
|
|
|
normal:
|
2013-02-04 08:35:23 -05:00
|
|
|
$(CC) -o simpleswitcher simpleswitcher.c -std=c99 $(CFLAGS) $(LDADD) $(LDFLAGS)
|
2012-06-29 13:10:13 -04:00
|
|
|
|
|
|
|
debug:
|
2013-02-04 08:35:23 -05:00
|
|
|
$(CC) -o simpleswitcher-debug simpleswitcher.c -std=c99 $(CFLAGS) -Wunused-parameter -g -DDEBUG $(LDADD)
|
2012-06-29 13:10:13 -04:00
|
|
|
|
2013-05-19 08:16:34 -04:00
|
|
|
install: install-man
|
2012-08-27 06:24:30 -04:00
|
|
|
install -Dm 755 simpleswitcher $(BINDIR)/simpleswitcher
|
|
|
|
|
2013-05-19 08:16:34 -04:00
|
|
|
install-man:
|
|
|
|
install -Dm 644 simpleswitcher.1 $(MANDIR)
|
|
|
|
gzip $(MANDIR)/simpleswitcher.1
|
|
|
|
|
2012-06-29 13:10:13 -04:00
|
|
|
clean:
|
|
|
|
rm -f simpleswitcher simpleswitcher-debug
|