2011-03-25 18:45:13 +00:00
|
|
|
# set options. pick one, acpi or apm. comment out the other one. don't
|
|
|
|
# uncomment both, bad things will happen :)
|
|
|
|
|
2014-08-18 22:56:10 +00:00
|
|
|
OPT := -O2
|
2011-03-25 18:45:13 +00:00
|
|
|
|
|
|
|
# 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 -DPRO -DACPI
|
|
|
|
|
2014-08-18 22:56:10 +00:00
|
|
|
CC := gcc
|
|
|
|
CFLAGS := $(OPT) -Wall -W -g -ansi -I/usr/X11R6/include
|
|
|
|
LDFLAGS := $(OPT) -L/usr/X11R6/lib -lX11 -lXpm -lXext
|
2011-03-25 18:45:13 +00:00
|
|
|
|
2014-08-18 22:56:10 +00:00
|
|
|
WMSRC := wmacpi-ng.c libacpi.c
|
|
|
|
CLSRC := acpi-ng.c libacpi.c
|
|
|
|
HEADERS := libacpi.h wmacpi-ng.h
|
|
|
|
targets := wmacpi-ng acpi-ng
|
2014-08-18 22:56:11 +00:00
|
|
|
doc_targets := debian/wmacpi-ng.1 debian/acpi-ng.1
|
|
|
|
|
|
|
|
PREFIX := /usr/local
|
2011-03-25 18:45:13 +00:00
|
|
|
|
2014-08-18 22:56:10 +00:00
|
|
|
all: $(targets)
|
2011-03-25 18:45:13 +00:00
|
|
|
|
2014-08-18 22:56:10 +00:00
|
|
|
# build the list of object files
|
|
|
|
WMOBJ := $(patsubst %.c,%.o,$(filter %.c,$(WMSRC)))
|
|
|
|
CLOBJ := $(patsubst %.c,%.o,$(filter %.c,$(CLSRC)))
|
|
|
|
|
|
|
|
# include per-file dependencies
|
|
|
|
include $(WMOBJ:.o=.d)
|
|
|
|
include $(CLOBJ:.o=.d)
|
|
|
|
|
|
|
|
wmacpi-ng: $(WMOBJ)
|
2014-08-18 22:56:11 +00:00
|
|
|
$(CC) $(LDFLAGS) -o $@ $^
|
2014-08-18 22:56:10 +00:00
|
|
|
|
|
|
|
acpi-ng: $(CLOBJ)
|
2014-08-18 22:56:11 +00:00
|
|
|
$(CC) $(LDFLAGS) -o $@ $^
|
2014-08-18 22:56:10 +00:00
|
|
|
|
|
|
|
# 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) $< > $@
|
2011-03-25 18:45:13 +00:00
|
|
|
|
|
|
|
clean:
|
2014-08-18 22:56:10 +00:00
|
|
|
rm -f TAGS *.o *~ trace *.out *.bb *.bbg
|
|
|
|
|
|
|
|
clean-all: clean
|
|
|
|
rm -f *.d $(targets)
|
|
|
|
|
2014-08-18 22:56:11 +00:00
|
|
|
install: $(targets)
|
|
|
|
install -d $(PREFIX)/bin/
|
|
|
|
install -pc $(targets) $(PREFIX)/bin/
|
|
|
|
install -d $(PREFIX)/man/man1/
|
|
|
|
install -pc $(doc_targets) $(PREFIX)/man/man1/
|
|
|
|
|
2014-08-18 22:56:10 +00:00
|
|
|
tags:
|
|
|
|
etags $(WMSRC) $(CLSRC) $(HEADERS)
|