1BINDIR=/usr/bin
2LOCALESDIR=/usr/share/locale
3MANDIR=/usr/share/man/man1
4WARNFLAGS=-Wall  -W -Wshadow
5CFLAGS?=-O1 -g ${WARNFLAGS}
6CC?=gcc
7
8
9#
10# The w in -lncursesw is not a typo; it is the wide-character version
11# of the ncurses library, needed for multi-byte character languages
12# such as Japanese and Chinese etc.
13#
14# On Debian/Ubuntu distros, this can be found in the
15# libncursesw5-dev package.
16#
17
18OBJS = powertop.o config.o process.o misctips.o bluetooth.o display.o suggestions.o wireless.o cpufreq.o \
19	sata.o xrandr.o ethernet.o cpufreqstats.o usb.o urbnum.o intelcstates.o
20
21
22powertop: $(OBJS) Makefile powertop.h
23	$(CC) ${CFLAGS}  $(OBJS) -lncursesw -o powertop
24	@(cd po/ && $(MAKE))
25
26powertop.1.gz: powertop.1
27	gzip -c $< > $@
28
29install: powertop powertop.1.gz
30	mkdir -p ${DESTDIR}${BINDIR}
31	cp powertop ${DESTDIR}${BINDIR}
32	mkdir -p ${DESTDIR}${MANDIR}
33	cp powertop.1.gz ${DESTDIR}${MANDIR}
34	@(cd po/ && env LOCALESDIR=$(LOCALESDIR) DESTDIR=$(DESTDIR) $(MAKE) $@)
35
36# This is for translators. To update your po with new strings, do :
37# svn up ; make uptrans LG=fr # or de, ru, hu, it, ...
38uptrans:
39	xgettext -C -s -k_ -o po/powertop.pot *.c *.h
40	@(cd po/ && env LG=$(LG) $(MAKE) $@)
41
42clean:
43	rm -f *~ powertop powertop.1.gz po/powertop.pot DEADJOE svn-commit* *.o *.orig
44	@(cd po/ && $(MAKE) $@)
45
46
47dist:
48	rm -rf .svn po/.svn DEADJOE po/DEADJOE todo.txt Lindent svn-commit.* dogit.sh git/ *.rej *.orig
49