# GNU Makefile for jsmond PROJ=jsmond # the .rst is the authoritative source for the version number. VERSION=$(shell fgrep '.. |version| replace::' $(PROJ).rst | cut -d' ' -f4) # maximum number of devices we can monitor. 16 seems like an awful lot... MAX_STICKS=16 # base name of joystick devices on your OS, gets numbers 0 to MAX_STICKS # appended to it during autodetection JSDEVBASE="/dev/input/js" # Override this, not CFLAGS OPTFLAGS=-Wall -ansi -pedantic -std=c89 -g # If you can think of a reason to compile without X11 support, # set this to 0 (or anything other than 1). Note that you can # compile with X11 and then disable it at runtime with -x. HAVE_X11=1 DEFINES=-DVERSION=\"$(VERSION)\" -DMAX_STICKS=$(MAX_STICKS) -DJSDEVBASE=\"$(JSDEVBASE)\" ifeq ($(HAVE_X11),1) CFLAGS+=$(shell pkg-config --cflags x11) LDFLAGS+=$(shell pkg-config --libs x11) DEFINES+=-DHAVE_X11 endif CFLAGS=$(OPTFLAGS) $(DEFINES) all: jsmond man: jsmond.rst rst2man.py jsmond.rst > jsmond.1 clean: rm -f $(PROJ) .PHONY: all man clean