Load cpulimit/ into cpulimit/branches/upstream/current.
[debian/cpulimit.git] / Makefile
index 9013c277bd29040549a8e39f1ce1232dc082554f..7bd54eca921ad30818f4f9863c041b6022205046 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)
+
+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)
+
+ptest: ptest.c
+       $(CC) -o ptest ptest.c -lrt $(CFLAGS)
 
 clean:
-       rm -f *~ cpulimit
+       rm -f *~ *.o $(TARGETS)
+