6014b452cb
Source obtained from http://sourceforge.net/projects/wmacpi/files/. 2004 August 18 1.99r7 Implemented the libdockapp port - this seems to close Debian bug #227819, but it hasn't received sufficient testing. Implemented a capacity mode for calculating time remaining (as opposed to the normal current rate mode) - this mode samples the remaining capacity of the battery and notes the time at which it was sampled, and uses a history of samples to estimate the rate of drain on the battery. From there it calculates a value for time remaining. Also, various cleanups have gone in: * a reworking of the scrolling code * generic battery number support (rather than just using two pixmaps, one for b1 and one for b2) * stopped the battery glyph from blinking when running on AC
72 lines
1.6 KiB
Makefile
72 lines
1.6 KiB
Makefile
# set options. pick one, acpi or apm. comment out the other one. don't
|
|
# uncomment both, bad things will happen :)
|
|
|
|
OPT := -O2
|
|
|
|
# uncomment this to build the command line acpi tool
|
|
BUILD_CLI = 1
|
|
|
|
# uncomment this to make wmacpi use less system colors (looks uglier too)
|
|
#OPT += -DLOW_COLOR
|
|
|
|
# debugging options (don't bother with these)
|
|
#OPT = -pg -g
|
|
|
|
CC := gcc
|
|
CFLAGS := $(OPT) -Wall -W -g -ansi -I/usr/X11R6/include
|
|
LDFLAGS := $(OPT) -L/usr/X11R6/lib -lX11 -lXpm -lXext -ldockapp
|
|
|
|
WMSRC := wmacpi.c libacpi.c
|
|
HEADERS := libacpi.h wmacpi.h
|
|
targets := wmacpi
|
|
doc_targets := wmacpi.1
|
|
|
|
ifdef BUILD_CLI
|
|
targets += acpi
|
|
doc_targets += acpi.1
|
|
endif
|
|
|
|
PREFIX := /usr/local
|
|
|
|
all: $(targets)
|
|
|
|
# build the list of object files
|
|
WMOBJ := $(patsubst %.c,%.o,$(filter %.c,$(WMSRC)))
|
|
|
|
# include per-file dependencies
|
|
include $(WMOBJ:.o=.d)
|
|
|
|
wmacpi: $(WMOBJ)
|
|
$(CC) $(LDFLAGS) -o $@ $^
|
|
|
|
# for the Debian package, we want to make building the command line tools
|
|
# optional. So, we hide all the necessary stuff here . . .
|
|
ifdef BUILD_CLI
|
|
CLSRC := acpi.c libacpi.c
|
|
CLOBJ := $(patsubst %.c,%.o,$(filter %.c,$(CLSRC)))
|
|
include $(CLOBJ:.o=.d)
|
|
|
|
acpi: $(CLOBJ)
|
|
$(CC) $(LDFLAGS) -o $@ $^
|
|
endif
|
|
|
|
# build per-file dependencies - note that -MM may not be supported
|
|
# in gcc versions older than 2.95.4, but most likely is.
|
|
%.d: %.c
|
|
gcc -MM $(CFLAGS) $< > $@
|
|
|
|
clean:
|
|
rm -f TAGS *.o *~ trace *.out *.bb *.bbg
|
|
|
|
clean-all: clean
|
|
rm -f *.d $(targets)
|
|
|
|
install: $(targets)
|
|
install -d $(PREFIX)/bin/
|
|
install -pc $(targets) $(PREFIX)/bin/
|
|
install -d $(PREFIX)/man/man1/
|
|
install -pc $(doc_targets) $(PREFIX)/man/man1/
|
|
|
|
tags:
|
|
etags $(WMSRC) $(CLSRC) $(HEADERS)
|