1 # set options. pick one, acpi or apm. comment out the other one. don't
2 # uncomment both, bad things will happen :)
6 # uncomment this to build the command line acpi tool
9 # uncomment this to make wmacpi use less system colors (looks uglier too)
12 # debugging options (don't bother with these)
16 CFLAGS
+= $(OPT
) -Wall
-W
-g
-ansi
17 LDFLAGS
+= $(OPT
) -lX11
-ldockapp
19 WMSRC
:= wmacpi.c libacpi.c
22 doc_targets
:= wmacpi
.1
26 doc_targets
+= wmacpi-cli
.1
33 # build the list of object files
34 WMOBJ
:= $(patsubst %.c
,%.o
,$(filter %.c
,$(WMSRC
)))
36 # include per-file dependencies
37 -include $(WMOBJ
:.o
=.d
)
40 $(CC
) -o
$@
$^
$(LDFLAGS
)
42 # for the Debian package, we want to make building the command line tools
43 # optional. So, we hide all the necessary stuff here . . .
45 CLSRC
:= wmacpi-cli.c libacpi.c
46 CLOBJ
:= $(patsubst %.c
,%.o
,$(filter %.c
,$(CLSRC
)))
47 -include $(CLOBJ
:.o
=.d
)
50 $(CC
) $(LDFLAGS
) -o
$@
$^
53 # build per-file dependencies - note that -MM may not be supported
54 # in gcc versions older than 2.95.4, but most likely is.
56 gcc
-MM
$(CFLAGS
) $< > $@
59 rm -f TAGS
*.o
*~ trace
*.out
*.bb
*.bbg
65 install -d
$(DESTDIR
)$(PREFIX
)/bin
/
66 install -pc $(targets
) $(DESTDIR
)$(PREFIX
)/bin
/
67 install -d
$(DESTDIR
)$(PREFIX
)/share
/man
/man1
/
68 install -pc $(doc_targets
) $(DESTDIR
)$(PREFIX
)/share
/man
/man1
/
71 etags
$(WMSRC
) $(CLSRC
) $(HEADERS
)