From 0068d30579e6b80d018267008d337fd55894f49f Mon Sep 17 00:00:00 2001
From: Yann Dirson <ydirson@free.fr>
Date: Sat, 10 Mar 2018 22:13:51 +0100
Subject: [PATCH] Add Makefile and .gitignore

---
 .gitignore |  2 ++
 Makefile   | 37 +++++++++++++++++++++++++++++++++++++
 2 files changed, 39 insertions(+)
 create mode 100644 .gitignore
 create mode 100644 Makefile

diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..31cabb4
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,2 @@
+crazywa
+crazywa.6.gz
diff --git a/Makefile b/Makefile
new file mode 100644
index 0000000..08b7b29
--- /dev/null
+++ b/Makefile
@@ -0,0 +1,37 @@
+srcdir = .
+
+CC?=gcc
+CFLAGS?= -O2 -s
+
+prefix=/usr/local
+DATADIR=`xboard --show-config Datadir`
+
+ALL= crazywa crazywa.6.gz
+
+all: ${ALL}
+
+crazywa: dropper.c
+	$(CC) $(CPPFLAGS) $(CFLAGS) $(LDFLAGS) $^ -o $@
+
+install: ${ALL}
+	install -d -m0755 $(DESTDIR)$(prefix)/games
+	cp -u ${srcdir}/crazywa $(DESTDIR)$(prefix)/games
+	install -d -m0755 $(DESTDIR)$(prefix)/share/man/man6
+	cp -u ${srcdir}/crazywa.6.gz $(DESTDIR)$(prefix)/share/man/man6
+
+crazywa.6.gz: crazywa.pod
+	pod2man -s 6 crazywa.pod | gzip -9n > crazywa.6.gz
+
+clean:
+	rm -f ${ALL} *.o
+
+dist-clean:
+	rm -f ${ALL} *~ md5sums
+
+dist:
+	REV=$(git describe --tags); \
+	  git archive --prefix=crazywa-$REV/ --format=tar.gz -o crazywa-$REV.tar.gz HEAD
+
+uninstall:
+	rm -f $(DESTDIR)$(prefix)/share/man/man6/crazywa.6.gz
+	rm -f $(DESTDIR)$(prefix)/games/crazywa
-- 
2.20.1

