aboutsummaryrefslogtreecommitdiff
path: root/Makefile
blob: 3c1379fd49211567537674ee1aecaf78ce40e8a8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
# 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