[svn-upgrade] Integrating new upstream version, cpulimit (1.12~svn10)
[debian/cpulimit.git] / Makefile
index 9013c27..261a76a 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -1,7 +1,25 @@
-all::  cpulimit
+CC=gcc
+CFLAGS=-Wall -D_GNU_SOURCE -O2
+TARGETS=cpulimit ptest
+LIBS=process.o procutils.o list.o
 
-cpulimit:      cpulimit.c
-       gcc -o cpulimit cpulimit.c -lrt -Wall -O2
+all::  $(TARGETS)
+
+cpulimit:      cpulimit.c $(LIBS)
+       $(CC) -o cpulimit cpulimit.c $(LIBS) -lrt $(CFLAGS)
+
+ptest: ptest.c process.o procutils.o list.o
+       $(CC) -o ptest ptest.c process.o procutils.o list.o -lrt $(CFLAGS)
+
+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)
 
 clean:
-       rm -f *~ cpulimit
+       rm -f *~ *.o $(TARGETS)
+