Permalink
Browse files

Add Makefile and Linux compilation tweaks

  • Loading branch information...
1 parent 66faff4 commit efb8a3a908aaaecb0313beef167f753b3dbd1ea7 @wickedchicken committed Mar 25, 2012
Showing with 34 additions and 19 deletions.
  1. +24 −0 Makefile
  2. +8 −3 README.md
  3. +2 −16 rain.c
View
@@ -0,0 +1,24 @@
+# pick a CC
+CC=clang
+#CC=gcc
+
+# CFLAGS="-Wall"
+CFLAGS=-O2 -Wall
+
+LIBS=-lcurses
+
+LDFLAGS=$(LIBS)
+
+#####################
+
+all: rain
+
+rain: rain.o
+ $(CC) $(LDFLAGS) $< -o $@
+
+rain.o: rain.c
+ $(CC) $(CFLAGS) -c $< -o $@
+
+.PHONY: clean
+clean:
+ -rm -rf *.o rain
View
@@ -2,8 +2,13 @@ rain -- a console screensaver
-----
-This is a port of the original NetBSD `rain`, which draws raindrops on your
-terminal. It has been modified to compile straight on Linux and have some better
-defaults.
+This is a port of the NetBSD `rain`, which draws raindrops on your terminal. It
+has been modified to compile straight on Linux and have some better defaults.
+
+installation: `make`, then copy `./rain` to wherever you like
usage: `rain [-d delay]`
+
+-----
+
+`rain` was originally authored by Eric P. Scott.
View
18 rain.c
@@ -1,5 +1,3 @@
-/* $NetBSD: rain.c,v 1.19.6.1 2008/09/18 04:39:58 wrstuden Exp $ */
-
/*
* Copyright (c) 1980, 1993
* The Regents of the University of California. All rights reserved.
@@ -30,18 +28,6 @@
*/
#include <sys/cdefs.h>
-#ifndef lint
-__COPYRIGHT("@(#) Copyright (c) 1980, 1993\
- The Regents of the University of California. All rights reserved.");
-#endif /* not lint */
-
-#ifndef lint
-#if 0
-static char sccsid[] = "@(#)rain.c 8.1 (Berkeley) 5/31/93";
-#else
-__RCSID("$NetBSD: rain.c,v 1.19.6.1 2008/09/18 04:39:58 wrstuden Exp $");
-#endif
-#endif /* not lint */
/*
* rain 11/3/1980 EPS/CITHEP
@@ -89,7 +75,7 @@ main(int argc, char **argv)
break;
default:
(void)fprintf(stderr, "Usage: %s [-d delay]\n",
- getprogname());
+ argv[0]);
return 1;
}
@@ -147,7 +133,7 @@ main(int argc, char **argv)
/* ARGSUSED */
static void
-onsig(int dummy __unused)
+onsig(int dummy)
{
sig_caught = 1;
}

0 comments on commit efb8a3a

Please sign in to comment.