aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJeff Mickey <jmickey@netapp.com>2009-12-02 15:31:49 -0500
committerJeff Mickey <jmickey@netapp.com>2009-12-02 15:31:49 -0500
commit8a780a685967984924f7fd3a89cfd8cd2d9704be (patch)
tree452cf6449fc2b1667cda252cbbb6890b3cdfa030
parentb621065e297c934c9b5e24f96fd83dde354e8b17 (diff)
downloadministat-8a780a685967984924f7fd3a89cfd8cd2d9704be.zip
ministat-8a780a685967984924f7fd3a89cfd8cd2d9704be.tar.xz
Ported to linux
* Removed some unused headers * Updated makefile to support DESTDIR & -lm Signed-off-by: Jeff Mickey <j@codemac.net>
-rw-r--r--Makefile22
-rw-r--r--ministat.c6
2 files changed, 16 insertions, 12 deletions
diff --git a/Makefile b/Makefile
index 22845f1..33a07e3 100644
--- a/Makefile
+++ b/Makefile
@@ -1,17 +1,23 @@
-PREFIX=/usr/local
+PREFIX=/usr
+BINDIR=$(PREFIX)/bin
+MANDIR=$(PREFIX)/man1
+DESTDIR=
ministat:
- gcc ministat.c -o ministat
+ gcc -lm ministat.c -o ministat
clean:
- rm -rf *o ministat
+ rm -rf *.o ministat ministat.1.gz
all: ministat
-install: ministat
- install -m 0755 ministat $(PREFIX)/bin
- install -m 0644 ministat.1 $(PREFIX)/man/man1
+install-man:
+ gzip -c ministat.1 > ministat.1.gz
+
+install: install-man ministat
+ install -m 0755 ministat $(DESTDIR)$(BINDIR)
+ install -m 0644 ministat.1.gz $(DESTDIR)$(MANDIR)
uninstall:
- rm $(PREFIX)/bin/ministat
- rm $(PREFIX)/man/man1/ministat.1 \ No newline at end of file
+ rm $(DESTDIR)$(BINDIR)/minista
+ rm $(DESTDIR)$(MANDIR)/ministat.1.gz
diff --git a/ministat.c b/ministat.c
index 69a3647..1275e49 100644
--- a/ministat.c
+++ b/ministat.c
@@ -5,19 +5,17 @@
* can do whatever you want with this stuff. If we meet some day, and you think
* this stuff is worth it, you can buy me a beer in return. Poul-Henning Kamp
* ----------------------------------------------------------------------------
- *
+ *
+ * Ported to linux by Jeff Mickey <j@codemac.net>
*/
-#include <sys/cdefs.h>
#include <stdio.h>
#include <math.h>
-#include <err.h>
#include <string.h>
#include <stdlib.h>
#include <unistd.h>
#include <sys/ioctl.h>
#include <sys/queue.h>
-#include <sys/ttycom.h>
#define NSTUDENT 100
#define NCONF 6