1 # vim:set ts=8 sw=8 sts=8 noet: 2 # 3 # darkstat 3 4 # copyright (c) 2001-2016 Emil Mikulic. 5 # 6 # You may use, modify and redistribute this file under the terms of the 7 # GNU General Public License version 2. (see COPYING.GPL) 8 9 CC = @CC@ 10 CFLAGS = @CFLAGS@ 11 CPPFLAGS = @CPPFLAGS@ 12 INSTALL = @INSTALL@ 13 LDFLAGS = @LDFLAGS@ 14 LIBS = @LIBS@ 15 16 HOSTCC ?= $(CC) 17 HOSTCFLAGS ?= $(CFLAGS) 18 19 prefix = @prefix@ 20 exec_prefix = @exec_prefix@ 21 sbindir = @sbindir@ 22 datarootdir = @datarootdir@ 23 mandir = @mandir@ 24 25 SRCS = \ 26 acct.c \ 27 addr.c \ 28 bsd.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 html.c \ 41 http.c \ 42 localip.c \ 43 ncache.c \ 44 now.c \ 45 pidfile.c \ 46 str.c 47 48 OBJS = $(SRCS:%.c=%.o) 49 50 STATICHS = \ 51 favicon.h \ 52 stylecss.h \ 53 graphjs.h 54 55 all: darkstat 56 57 darkstat: $(OBJS) 58 $(AM_V_LINK) 59 $(AM_V_at)$(CC) $(CFLAGS) $(OBJS) $(LDFLAGS) $(LIBS) -o $@ 60 61 .c.o: 62 $(AM_V_CC) 63 $(AM_V_at)$(CC) $(CPPFLAGS) $(CFLAGS) -c $< -o $@ 64 65 clean: 66 rm -f darkstat 67 rm -f $(OBJS) 68 rm -f $(STATICHS) 69 rm -f hex-ify c-ify 70 71 depend: config.status $(STATICHS) 72 cp Makefile.in Makefile.in.old 73 sed '/^# Automatically generated dependencies$$/,$$d' \ 74 <Makefile.in.old >Makefile.in 75 echo "# Automatically generated dependencies" >>Makefile.in 76 $(CC) $(CPPFLAGS) -MM $(SRCS) >>Makefile.in 77 ./config.status 78 rm -f Makefile.in.old 79 80 favicon.h: static/favicon.png hex-ify 81 $(AM_V_HEXIFY) 82 $(AM_V_at)./hex-ify favicon_png <static/favicon.png >$@ 83 84 graphjs.h: static/graph.js c-ify 85 $(AM_V_CIFY) 86 $(AM_V_at)./c-ify graph_js <static/graph.js >$@ 87 88 stylecss.h: static/style.css c-ify 89 $(AM_V_CIFY) 90 $(AM_V_at)./c-ify style_css <static/style.css >$@ 91 92 hex-ify: static/hex-ify.c 93 $(AM_V_HOSTCC) 94 $(AM_V_at)$(HOSTCC) $(HOSTCFLAGS) static/hex-ify.c -o $@ 95 96 c-ify: static/c-ify.c 97 $(AM_V_HOSTCC) 98 $(AM_V_at)$(HOSTCC) $(HOSTCFLAGS) static/c-ify.c -o $@ 99 100 install: darkstat 101 $(INSTALL) -d $(DESTDIR)$(sbindir) 102 $(INSTALL) -m 555 darkstat $(DESTDIR)$(sbindir) 103 $(INSTALL) -d $(DESTDIR)$(mandir)/man8 104 $(INSTALL) -m 444 darkstat.8 $(DESTDIR)$(mandir)/man8 105 106 .PHONY: all install clean depend 107 108 # silent-rules 109 AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ 110 AM_V_CC = $(am__v_CC_$(V)) 111 am__v_CC_ = $(am__v_CC_$(AM_DEFAULT_VERBOSITY)) 112 am__v_CC_0 = @echo " CC " $@; 113 AM_V_LINK = $(am__v_LINK_$(V)) 114 am__v_LINK_ = $(am__v_LINK_$(AM_DEFAULT_VERBOSITY)) 115 am__v_LINK_0 = @echo " LINK " $@; 116 AM_V_HOSTCC = $(am__v_HOSTCC_$(V)) 117 am__v_HOSTCC_ = $(am__v_HOSTCC_$(AM_DEFAULT_VERBOSITY)) 118 am__v_HOSTCC_0 = @echo " HOSTCC" $@; 119 AM_V_CIFY = $(am__v_CIFY_$(V)) 120 am__v_CIFY_ = $(am__v_CIFY_$(AM_DEFAULT_VERBOSITY)) 121 am__v_CIFY_0 = @echo " C-IFY " $@; 122 AM_V_HEXIFY = $(am__v_HEXIFY_$(V)) 123 am__v_HEXIFY_ = $(am__v_HEXIFY_$(AM_DEFAULT_VERBOSITY)) 124 am__v_HEXIFY_0 = @echo " HEX-IFY " $@; 125 AM_V_at = $(am__v_at_$(V)) 126 am__v_at_ = $(am__v_at_$(AM_DEFAULT_VERBOSITY)) 127 am__v_at_0 = @ 128 129 # Automatically generated dependencies 130 acct.o: acct.c acct.h decode.h addr.h conv.h daylog.h graph_db.h err.h \ 131 cdefs.h hosts_db.h localip.h now.h opt.h 132 addr.o: addr.c addr.h 133 bsd.o: bsd.c bsd.h config.h cdefs.h 134 cap.o: cap.c acct.h cdefs.h cap.h config.h conv.h decode.h addr.h err.h \ 135 hosts_db.h localip.h now.h opt.h queue.h str.h 136 conv.o: conv.c conv.h err.h cdefs.h 137 darkstat.o: darkstat.c acct.h cap.h cdefs.h config.h conv.h daylog.h \ 138 graph_db.h db.h dns.h err.h hosts_db.h addr.h http.h localip.h ncache.h \ 139 now.h pidfile.h str.h 140 daylog.o: daylog.c cdefs.h err.h daylog.h graph_db.h str.h now.h 141 db.o: db.c err.h cdefs.h hosts_db.h addr.h graph_db.h db.h 142 decode.o: decode.c cdefs.h decode.h addr.h err.h opt.h 143 dns.o: dns.c cdefs.h cap.h conv.h decode.h addr.h dns.h err.h hosts_db.h \ 144 queue.h str.h tree.h bsd.h config.h 145 err.o: err.c cdefs.h err.h opt.h pidfile.h bsd.h config.h 146 graph_db.o: graph_db.c cap.h conv.h db.h acct.h err.h cdefs.h str.h \ 147 html.h graph_db.h now.h opt.h 148 hosts_db.o: hosts_db.c cdefs.h conv.h decode.h addr.h dns.h err.h \ 149 hosts_db.h db.h html.h ncache.h now.h opt.h str.h 150 hosts_sort.o: hosts_sort.c cdefs.h err.h hosts_db.h addr.h 151 html.o: html.c config.h str.h cdefs.h html.h opt.h 152 http.o: http.c cdefs.h config.h conv.h err.h graph_db.h hosts_db.h addr.h \ 153 http.h now.h queue.h str.h stylecss.h graphjs.h favicon.h 154 localip.o: localip.c addr.h bsd.h config.h conv.h err.h cdefs.h localip.h \ 155 now.h 156 ncache.o: ncache.c conv.h err.h cdefs.h ncache.h tree.h bsd.h config.h 157 now.o: now.c err.h cdefs.h now.h str.h 158 pidfile.o: pidfile.c err.h cdefs.h str.h pidfile.h 159 str.o: str.c conv.h err.h cdefs.h str.h