]> git.neil.brown.name Git - susman.git/blob - Makefile
wakealarmd: cope with delta between system time and RTC time.
[susman.git] / Makefile
1 # Copyright (C) 2011 Neil Brown <neilb@suse.de>
2 #
3 #    This program is free software; you can redistribute it and/or modify
4 #    it under the terms of the GNU General Public License as published by
5 #    the Free Software Foundation; either version 2 of the License, or
6 #    (at your option) any later version.
7 #
8 #    This program is distributed in the hope that it will be useful,
9 #    but WITHOUT ANY WARRANTY; without even the implied warranty of
10 #    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
11 #    GNU General Public License for more details.
12 #
13 #    You should have received a copy of the GNU General Public License along
14 #    with this program; if not, write to the Free Software Foundation, Inc.,
15 #    51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
16
17 PROGS = lsusd lsused request_suspend wakealarmd susman
18 TESTS = block_test watch_test event_test alarm_test
19 LIBS = suspend_block.o watcher.o wakeevent.o wakealarm.o
20
21 DEST = /usr/local/bin
22 LIBDEST = /usr/local/lib
23 all: $(PROGS) $(TESTS)
24
25 lsusd: lsusd.o
26
27 lsused: lsused.o libsus.a
28         $(CC) -o lsused lsused.o libsus.a -levent
29
30 wakealarmd: wakealarmd.o libsus.a
31         $(CC) -o wakealarmd wakealarmd.o libsus.a -levent
32
33 %-m.o: %.c
34         $(CC) -o $@ -c $(CFLAGS) -Dmain=$* $<
35
36 susman: susman.o lsusd-m.o lsused-m.o wakealarmd-m.o libsus.a
37         $(CC) -o susman susman.o lsusd-m.o lsused-m.o wakealarmd-m.o libsus.a -levent
38
39 request_suspend: request_suspend.o
40
41 install: susman suspend.py block.sh libsus.a
42         cp susman suspend.py $(DEST)
43         cp block.sh $(DEST)/suspend.sh
44         chmod 755 $(DEST)/susman $(DEST)/suspend.py $(DEST)/suspend.sh
45         cp libsus.a $(LIBDEST)
46         chmod 644 $(LIBDEST)/libsus.a
47
48 block_test: block_test.o libsus.a
49         $(CC) -o block_test block_test.o libsus.a
50 watch_test: watch_test.o libsus.a
51         $(CC) -o watch_test watch_test.o libsus.a -levent
52 event_test: event_test.o libsus.a
53         $(CC) -o event_test event_test.o libsus.a -levent
54 alarm_test: alarm_test.o libsus.a
55         $(CC) -o alarm_test alarm_test.o libsus.a -levent
56
57 libsus.a: $(LIBS)
58         ar cr libsus.a $(LIBS)
59
60 clean:
61         rm -f *.o *.a *.pyc $(PROGS) $(TESTS)
62