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