2 # copyright (c) 2001-2009 Emil Mikulic.
4 # You may use, modify and redistribute this file under the terms of the
5 # GNU General Public License version 2. (see COPYING.GPL)
16 HOSTCFLAGS ?
= $(CFLAGS
)
19 exec_prefix = @
exec_prefix@
21 datarootdir
= @datarootdir@
24 # Optimizations FIXME: dead code. push into autoconf?
25 #CPPFLAGS += -D__OPTIMIZE__
47 OBJS
= $(SRCS
:%.c
=%.o
)
53 $(CC
) $(CFLAGS
) $(OBJS
) $(LDFLAGS
) $(LIBS
) -o
$@
56 $(CC
) $(CPPFLAGS
) $(CFLAGS
) -c
$< -o
$@
59 rm -f darkstat
$(OBJS
) c-ify graphjs.h stylecss.h
61 depend
: stylecss.h graphjs.h config.status
62 cp Makefile.in Makefile.in.old
63 sed
'/^# Automatically generated dependencies$$/,$$d' \
64 <Makefile.in.old
>Makefile.in
65 echo
"# Automatically generated dependencies" >>Makefile.in
66 $(CPP
) $(CPPFLAGS
) -MM
$(SRCS
) >>Makefile.in
71 @echo
$(CPP
) $(CPPFLAGS
) -MM
$(SRCS
)
74 graphjs.h
: static
/graph.js c-ify
75 .
/c-ify graph_js
<static
/graph.js
>$@
77 stylecss.h
: static
/style.css c-ify
78 .
/c-ify style_css
<static
/style.css
>$@
81 $(HOSTCC
) $(HOSTCFLAGS
) static
/c-ify.c
-o
$@
84 $(INSTALL
) -d
$(DESTDIR
)$(sbindir
)
85 $(INSTALL
) -m
555 darkstat
$(DESTDIR
)$(sbindir
)
86 $(INSTALL
) -d
$(DESTDIR
)$(mandir)/man8
87 $(INSTALL
) -m
444 darkstat
.8 $(DESTDIR
)$(mandir)/man8
89 # Automatically generated dependencies
90 acct.o
: acct.c darkstat.h config.h acct.h decode.h conv.h daylog.h \
91 graph_db.h err.h hosts_db.h str.h localip.h now.h
92 cap.o
: cap.c darkstat.h config.h cap.h conv.h decode.h hosts_db.h str.h \
94 conv.o
: conv.c darkstat.h config.h conv.h err.h
95 darkstat.o
: darkstat.c darkstat.h config.h acct.h decode.h cap.h conv.h \
96 daylog.h graph_db.h db.h dns.h http.h hosts_db.h str.h localip.h \
97 ncache.h pidfile.h err.h now.h
98 daylog.o
: daylog.c darkstat.h config.h err.h daylog.h graph_db.h str.h \
100 db.o
: db.c darkstat.h config.h err.h hosts_db.h str.h graph_db.h db.h
101 decode.o
: decode.c darkstat.h config.h acct.h decode.h cap.h err.h
102 dns.o
: dns.c darkstat.h config.h conv.h decode.h dns.h err.h hosts_db.h \
104 err.o
: err.c darkstat.h config.h conv.h err.h pidfile.h
105 graph_db.o
: graph_db.c cap.h conv.h darkstat.h config.h db.h acct.h \
106 decode.h err.h str.h html.h graph_db.h now.h
107 hosts_db.o
: hosts_db.c darkstat.h config.h conv.h decode.h dns.h err.h \
108 hosts_db.h str.h db.h html.h ncache.h now.h
109 hosts_sort.o
: hosts_sort.c darkstat.h config.h hosts_db.h str.h err.h
110 http.o
: http.c darkstat.h config.h http.h conv.h hosts_db.h str.h \
111 graph_db.h err.h queue.h now.h stylecss.h graphjs.h
112 localip.o
: localip.c darkstat.h config.h conv.h decode.h err.h localip.h
113 ncache.o
: ncache.c darkstat.h config.h conv.h err.h ncache.h tree.h
114 pidfile.o
: pidfile.c darkstat.h config.h err.h str.h pidfile.h
115 str.o
: str.c darkstat.h config.h conv.h err.h str.h