releasing version 1.5-1
[debian/cpulimit.git] / Makefile
index 261a76a..b696393 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -1,25 +1,21 @@
-CC=gcc
-CFLAGS=-Wall -D_GNU_SOURCE -O2
-TARGETS=cpulimit ptest
-LIBS=process.o procutils.o list.o
+PREFIX?=/usr
+CFLAGS?=-Wall -O2
+CC?=gcc
 
-all::  $(TARGETS)
+all: cpulimit
 
-cpulimit:      cpulimit.c $(LIBS)
-       $(CC) -o cpulimit cpulimit.c $(LIBS) -lrt $(CFLAGS)
+cpulimit: cpulimit.c
+       $(CC) -o cpulimit cpulimit.c -lrt $(CFLAGS)
 
-ptest: ptest.c process.o procutils.o list.o
-       $(CC) -o ptest ptest.c process.o procutils.o list.o -lrt $(CFLAGS)
+install: cpulimit
+       mkdir -p ${PREFIX}/bin
+       mkdir -p ${PREFIX}/share/man/man1
+       cp cpulimit ${PREFIX}/bin
+       cp cpulimit.1.gz ${PREFIX}/share/man/man1
 
-process.o: process.c process.h
-       $(CC) -c process.c $(CFLAGS)
-
-procutils.o: procutils.c procutils.h
-       $(CC) -c procutils.c $(CFLAGS)
-
-list.o: list.c list.h
-       $(CC) -c list.c $(CFLAGS)
+deinstall:
+       rm -f ${PREFIX}/bin/cpulimit
+       rm -f ${PREFIX}/share/man/man1/cpulimit.1.gz
 
 clean:
-       rm -f *~ *.o $(TARGETS)
-
+       rm -f *~ cpulimit