aboutsummaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorB. Watson <yalhcru@gmail.com>2020-05-16 05:55:13 -0400
committerB. Watson <yalhcru@gmail.com>2020-05-16 05:55:13 -0400
commitf6690f23148f7bf1445dc6435742fccff0cb1b3e (patch)
treedb2fe0a659d49b4f06a8b69e428d988c43e17041 /Makefile
downloadunsaver-f6690f23148f7bf1445dc6435742fccff0cb1b3e.tar.gz
initial commit
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile41
1 files changed, 41 insertions, 0 deletions
diff --git a/Makefile b/Makefile
new file mode 100644
index 0000000..3c1379f
--- /dev/null
+++ b/Makefile
@@ -0,0 +1,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