1 # set options. pick one, acpi or apm. comment out the other one. don't
2 # uncomment both, bad things will happen :)
8 # uncomment this to build the command line acpi tool
11 # uncomment this to make wmacpi use less system colors (looks uglier too)
14 # debugging options (don't bother with these)
18 CFLAGS
+= $(OPT
) -Wall
-W
-g
-ansi
-DWMACPI_VER
='"$(WMACPI_VER)"'
19 LDFLAGS
+= $(OPT
) -lX11
-ldockapp
21 WMSRC
:= wmacpi.c libacpi.c
24 doc_targets
:= wmacpi
.1
28 doc_targets
+= wmacpi-cli
.1
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
)
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 . . .
47 CLSRC
:= wmacpi-cli.c libacpi.c
48 CLOBJ
:= $(patsubst %.c
,%.o
,$(filter %.c
,$(CLSRC
)))
49 -include $(CLOBJ
:.o
=.d
)
52 $(CC
) $(LDFLAGS
) -o
$@
$^
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.
58 gcc
-MM
$(CFLAGS
) $< > $@
61 rm -f TAGS
*.o
*~ trace
*.out
*.bb
*.bbg
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
/
73 etags
$(WMSRC
) $(CLSRC
) $(HEADERS
)