summaryrefslogtreecommitdiff
path: root/Makefile
blob: b39c5d19532d20ee4ad6daf358c785033218a85d (plain)
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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
VERSION = 1.13

BINDIR=/usr/bin
LOCALESDIR=/usr/share/locale
MANDIR=/usr/share/man/man8
WARNFLAGS=-Wall -Wshadow -W -Wformat -Wimplicit-function-declaration -Wimplicit-int
CFLAGS?=-march=i686 -O2 -pipe -m32 ${WARNFLAGS}
CC?=gcc

CFLAGS+=-D VERSION=\"$(VERSION)\"

LDFLAGS+= -static

# 
# The w in -lncursesw is not a typo; it is the wide-character version
# of the ncurses library, needed for multi-byte character languages
# such as Japanese and Chinese etc.
#
# On Debian/Ubuntu distros, this can be found in the
# libncursesw5-dev package. 
#

OBJS = powertop.o config.o process.o misctips.o bluetooth.o display.o suggestions.o wireless.o cpufreq.o \
	sata.o xrandr.o ethernet.o cpufreqstats.o usb.o urbnum.o intelcstates.o wifi-new.o perf.o \
	alsa-power.o ahci-alpm.o dmesg.o devicepm.o
	

powertop: $(OBJS) Makefile powertop.h
	$(CC) ${CFLAGS} $(LDFLAGS) $(OBJS) -lncursesw -o powertop
	@(cd po/ && $(MAKE))

powertop.8.gz: powertop.8
	gzip -c $< > $@

install: powertop powertop.8.gz
	mkdir -p ${DESTDIR}${BINDIR}
	cp powertop ${DESTDIR}${BINDIR}
	mkdir -p ${DESTDIR}${MANDIR}
	cp powertop.8.gz ${DESTDIR}${MANDIR}
	@(cd po/ && env LOCALESDIR=$(LOCALESDIR) DESTDIR=$(DESTDIR) $(MAKE) $@)
	
valgrind: powertop
	 sudo valgrind ./powertop -d -t 5 1> /dev/null

# This is for translators. To update your po with new strings, do :
# svn up ; make uptrans LG=fr # or de, ru, hu, it, ...
uptrans:
	@(cd po/ && env LG=$(LG) $(MAKE) $@)

clean:
	rm -f *~ powertop powertop.8.gz po/powertop.pot DEADJOE svn-commit* *.o *.orig 
	@(cd po/ && $(MAKE) $@)


dist:
	git tag v$(VERSION)
	git archive --format=tar --prefix="powertop-$(VERSION)/" v$(VERSION) | \
		gzip > powertop-$(VERSION).tar.gz