-
Notifications
You must be signed in to change notification settings - Fork 3
/
Makefile
39 lines (28 loc) · 843 Bytes
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
VERSION?=2.1
PREFIX?=/usr
CFLAGS?=-Wall -O2 -DVERSION=$(VERSION)
CC?=gcc
all: cpulimit
osx:
$(CC) -o cpulimit cpulimit.c -D__APPLE__ $(CFLAGS) $(CPPFLAGS) $(LDFLAGS)
minix:
$(CC) -o cpulimit cpulimit.c $(CFLAGS) $(CPPFLAGS) $(LDFLAGS)
freebsd:
$(CC) -o cpulimit cpulimit.c -lrt -DFREEBSD $(CFLAGS) $(CPPFLAGS) $(LDFLAGS)
cpulimit: cpulimit.c
$(CC) -o cpulimit cpulimit.c -lrt -DLINUX $(CFLAGS) $(CPPFLAGS) $(LDFLAGS)
tests:
$(MAKE) -C test
install: cpulimit
mkdir -p ${PREFIX}/bin
mkdir -p ${PREFIX}/share/man/man1
cp cpulimit ${PREFIX}/bin/limitcpu
cp cpulimit.1.gz ${PREFIX}/share/man/man1/limitcpu.1.gz
deinstall:
rm -f ${PREFIX}/bin/limitcpu
rm -f ${PREFIX}/share/man/man1/limitcpu.1.gz
clean:
rm -f *~ cpulimit
$(MAKE) -C test clean
tarball: clean
cd .. && tar czf limitcpu-$(VERSION).tar.gz limitcpu-$(VERSION)