wmclockmon: update change-log
[dockapps.git] / wmacpi / Makefile
blobec97301fe7f8b075b73db4032eaa67b862317a2a
1 # set options. pick one, acpi or apm. comment out the other one. don't
2 # uncomment both, bad things will happen :)
4 WMACPI_VER = 2.4
6 OPT := -O2
8 # uncomment this to build the command line acpi tool
9 BUILD_CLI = 1
11 # uncomment this to make wmacpi use less system colors (looks uglier too)
12 #OPT += -DLOW_COLOR
14 # debugging options (don't bother with these)
15 #OPT = -pg -g
17 CC := gcc
18 CFLAGS += $(OPT) -Wall -W -g -ansi -DWMACPI_VER='"$(WMACPI_VER)"'
19 LDFLAGS += $(OPT) -lX11 -ldockapp
21 WMSRC := wmacpi.c libacpi.c
22 HEADERS := libacpi.h
23 targets := wmacpi
24 doc_targets := wmacpi.1
26 ifdef BUILD_CLI
27 targets += wmacpi-cli
28 doc_targets += wmacpi-cli.1
29 endif
31 PREFIX := /usr/local
33 all: $(targets)
35 # build the list of object files
36 WMOBJ := $(patsubst %.c,%.o,$(filter %.c,$(WMSRC)))
38 # include per-file dependencies
39 -include $(WMOBJ:.o=.d)
41 wmacpi: $(WMOBJ)
42 $(CC) -o $@ $^ $(LDFLAGS)
44 # for the Debian package, we want to make building the command line tools
45 # optional. So, we hide all the necessary stuff here . . .
46 ifdef BUILD_CLI
47 CLSRC := wmacpi-cli.c libacpi.c
48 CLOBJ := $(patsubst %.c,%.o,$(filter %.c,$(CLSRC)))
49 -include $(CLOBJ:.o=.d)
51 wmacpi-cli: $(CLOBJ)
52 $(CC) $(LDFLAGS) -o $@ $^
53 endif
55 # build per-file dependencies - note that -MM may not be supported
56 # in gcc versions older than 2.95.4, but most likely is.
57 %.d: %.c
58 gcc -MM $(CFLAGS) $< > $@
60 clean:
61 rm -f TAGS *.o *~ trace *.out *.bb *.bbg
62 rm -f *.d $(targets)
64 clean-all: clean
66 install: $(targets)
67 install -d $(DESTDIR)$(PREFIX)/bin/
68 install -pc $(targets) $(DESTDIR)$(PREFIX)/bin/
69 install -d $(DESTDIR)$(PREFIX)/share/man/man1/
70 install -pc $(doc_targets) $(DESTDIR)$(PREFIX)/share/man/man1/
72 tags:
73 etags $(WMSRC) $(CLSRC) $(HEADERS)