Did some fixes to the opposite hosts table and added some nice features
[darkstat] / Makefile.in
1 # darkstat 3
2 # copyright (c) 2001-2011 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__
26
27 SRCS = \
28 acct.c \
29 addr.c \
30 cap.c \
31 conv.c \
32 darkstat.c \
33 daylog.c \
34 db.c \
35 decode.c \
36 dns.c \
37 err.c \
38 graph_db.c \
39 hosts_db.c \
40 hosts_sort.c \
41 html.c \
42 http.c \
43 localip.c \
44 ncache.c \
45 pidfile.c \
46 str.c
47
48 OBJS = $(SRCS:%.c=%.o)
49
50 all: darkstat
51
52 darkstat: $(OBJS)
53 @echo "===> Linking $@"
54 @$(CC) $(CFLAGS) $(OBJS) $(LDFLAGS) $(LIBS) -o $@
55
56 .c.o:
57 @echo "===> Compiling $@"
58 @$(CC) $(CPPFLAGS) $(CFLAGS) -c $< -o $@
59
60 clean:
61 rm -f darkstat $(OBJS) c-ify graphjs.h stylecss.h
62
63 depend: stylecss.h graphjs.h config.status
64 cp Makefile.in Makefile.in.old
65 sed '/^# Automatically generated dependencies$$/,$$d' \
66 <Makefile.in.old >Makefile.in
67 echo "# Automatically generated dependencies" >>Makefile.in
68 $(CPP) $(CPPFLAGS) -MM $(SRCS) >>Makefile.in
69 ./config.status
70 rm -f Makefile.in.old
71
72 show-dep:
73 @echo $(CPP) $(CPPFLAGS) -MM $(SRCS)
74
75 # Statics: (FIXME?)
76 graphjs.h: static/graph.js c-ify
77 ./c-ify graph_js <static/graph.js >$@
78
79 stylecss.h: static/style.css c-ify
80 ./c-ify style_css <static/style.css >$@
81
82 c-ify: static/c-ify.c
83 @echo "==> Compiling $@"
84 @$(HOSTCC) $(HOSTCFLAGS) static/c-ify.c -o $@
85
86 install: darkstat
87 $(INSTALL) -d $(DESTDIR)$(sbindir)
88 $(INSTALL) -m 555 darkstat $(DESTDIR)$(sbindir)
89 $(INSTALL) -d $(DESTDIR)$(mandir)/man8
90 $(INSTALL) -m 444 darkstat.8 $(DESTDIR)$(mandir)/man8
91
92 # Automatically generated dependencies
93 acct.o: acct.c acct.h decode.h addr.h conv.h config.h daylog.h graph_db.h \
94 err.h cdefs.h hosts_db.h localip.h now.h opt.h
95 addr.o: addr.c addr.h
96 cap.o: cap.c cdefs.h cap.h config.h conv.h decode.h addr.h hosts_db.h \
97 localip.h opt.h err.h
98 conv.o: conv.c cdefs.h config.h conv.h err.h
99 darkstat.o: darkstat.c acct.h cap.h cdefs.h config.h conv.h daylog.h \
100 graph_db.h db.h dns.h err.h http.h hosts_db.h addr.h localip.h ncache.h \
101 pidfile.h now.h
102 daylog.o: daylog.c err.h cdefs.h daylog.h graph_db.h str.h now.h
103 db.o: db.c cdefs.h err.h hosts_db.h addr.h graph_db.h db.h
104 decode.o: decode.c cdefs.h acct.h cap.h config.h decode.h addr.h err.h \
105 opt.h
106 dns.o: dns.c cdefs.h conv.h config.h decode.h addr.h dns.h err.h \
107 hosts_db.h queue.h str.h tree.h
108 err.o: err.c cdefs.h conv.h config.h err.h opt.h pidfile.h
109 graph_db.o: graph_db.c cap.h conv.h config.h db.h acct.h err.h cdefs.h \
110 str.h html.h graph_db.h now.h opt.h
111 hosts_db.o: hosts_db.c cdefs.h conv.h config.h decode.h addr.h dns.h \
112 err.h hosts_db.h db.h html.h ncache.h now.h opt.h str.h
113 hosts_sort.o: hosts_sort.c cdefs.h err.h hosts_db.h addr.h
114 html.o: html.c config.h str.h html.h opt.h
115 http.o: http.c cdefs.h config.h conv.h err.h graph_db.h hosts_db.h addr.h \
116 http.h now.h queue.h str.h stylecss.h graphjs.h
117 localip.o: localip.c addr.h conv.h config.h err.h cdefs.h localip.h
118 ncache.o: ncache.c conv.h config.h err.h cdefs.h ncache.h tree.h
119 pidfile.o: pidfile.c err.h cdefs.h str.h pidfile.h
120 str.o: str.c conv.h config.h err.h cdefs.h str.h