Implement and document --syslog
[darkstat] / Makefile.in
1 # darkstat 3
2 # copyright (c) 2001-2009 Emil Mikulic.
3 #
4 # You may use, modify and redistribute this file under the terms of the
5 # GNU General Public License version 2. (see COPYING.GPL)
6
7 CC = @CC@
8 CFLAGS = @CFLAGS@
9 CPP = @CPP@
10 CPPFLAGS = @CPPFLAGS@
11 INSTALL = @INSTALL@
12 LDFLAGS = @LDFLAGS@
13 LIBS = @LIBS@
14
15 HOSTCC ?= $(CC)
16 HOSTCFLAGS ?= $(CFLAGS)
17
18 prefix = @prefix@
19 exec_prefix = @exec_prefix@
20 sbindir = @sbindir@
21 datarootdir = @datarootdir@
22 mandir = @mandir@
23
24 # Optimizations FIXME: dead code. push into autoconf?
25 #CPPFLAGS += -D__OPTIMIZE__ -DNDEBUG
26
27 SRCS = \
28 acct.c \
29 cap.c \
30 conv.c \
31 darkstat.c \
32 daylog.c \
33 db.c \
34 decode.c \
35 dns.c \
36 err.c \
37 graph_db.c \
38 hosts_db.c \
39 hosts_sort.c \
40 http.c \
41 localip.c \
42 ncache.c \
43 pidfile.c \
44 str.c
45
46 OBJS = $(SRCS:%.c=%.o)
47
48 all: darkstat
49
50 darkstat: $(OBJS)
51 @echo Linking $@
52 $(CC) $(CFLAGS) $(OBJS) $(LDFLAGS) $(LIBS) -o $@
53
54 .c.o:
55 $(CC) $(CPPFLAGS) $(CFLAGS) -c $< -o $@
56
57 clean:
58 rm -f darkstat $(OBJS) c-ify graphjs.h stylecss.h
59
60 depend: stylecss.h graphjs.h config.status
61 cp Makefile.in Makefile.in.old
62 sed '/^# Automatically generated dependencies$$/,$$d' \
63 <Makefile.in.old >Makefile.in
64 echo "# Automatically generated dependencies" >>Makefile.in
65 $(CPP) $(CPPFLAGS) -MM $(SRCS) >>Makefile.in
66 ./config.status
67 rm -f Makefile.in.old
68
69 show-dep:
70 @echo $(CPP) $(CPPFLAGS) -MM $(SRCS)
71
72 # Statics: (FIXME?)
73 graphjs.h: static/graph.js c-ify
74 ./c-ify graph_js <static/graph.js >$@
75
76 stylecss.h: static/style.css c-ify
77 ./c-ify style_css <static/style.css >$@
78
79 c-ify: static/c-ify.c
80 $(HOSTCC) $(HOSTCFLAGS) static/c-ify.c -o $@
81
82 install: darkstat
83 $(INSTALL) -d $(DESTDIR)$(sbindir)
84 $(INSTALL) -m 555 darkstat $(DESTDIR)$(sbindir)
85 $(INSTALL) -d $(DESTDIR)$(mandir)/man8
86 $(INSTALL) -m 444 darkstat.8 $(DESTDIR)$(mandir)/man8
87
88 # Automatically generated dependencies
89 acct.o: acct.c darkstat.h config.h acct.h decode.h conv.h daylog.h \
90 graph_db.h err.h hosts_db.h str.h localip.h now.h
91 cap.o: cap.c darkstat.h config.h cap.h conv.h decode.h hosts_db.h str.h \
92 localip.h err.h
93 conv.o: conv.c darkstat.h config.h conv.h err.h
94 darkstat.o: darkstat.c darkstat.h config.h acct.h decode.h cap.h conv.h \
95 daylog.h graph_db.h db.h dns.h http.h hosts_db.h str.h localip.h \
96 ncache.h pidfile.h err.h now.h
97 daylog.o: daylog.c darkstat.h config.h err.h daylog.h graph_db.h str.h \
98 now.h
99 db.o: db.c darkstat.h config.h err.h hosts_db.h str.h graph_db.h db.h
100 decode.o: decode.c darkstat.h config.h acct.h decode.h cap.h err.h
101 dns.o: dns.c darkstat.h config.h conv.h decode.h dns.h err.h hosts_db.h \
102 str.h queue.h tree.h
103 err.o: err.c darkstat.h config.h conv.h err.h pidfile.h
104 graph_db.o: graph_db.c cap.h conv.h darkstat.h config.h db.h acct.h \
105 decode.h err.h str.h html.h graph_db.h now.h
106 hosts_db.o: hosts_db.c darkstat.h config.h conv.h decode.h dns.h err.h \
107 hosts_db.h str.h db.h html.h ncache.h now.h
108 hosts_sort.o: hosts_sort.c darkstat.h config.h hosts_db.h str.h err.h
109 http.o: http.c darkstat.h config.h http.h conv.h hosts_db.h str.h \
110 graph_db.h err.h queue.h now.h stylecss.h graphjs.h
111 localip.o: localip.c darkstat.h config.h conv.h decode.h err.h localip.h
112 ncache.o: ncache.c darkstat.h config.h conv.h err.h ncache.h tree.h
113 pidfile.o: pidfile.c darkstat.h config.h err.h str.h pidfile.h
114 str.o: str.c darkstat.h config.h conv.h err.h str.h