PATH :=$(CURDIR)/../bin:$(HOME)/DouglasThrift.net/WWW/util:$(HOME)/bin:$(PATH) SHELL :=$(shell which bash 2> /dev/null || echo /usr/local/bin/bash) HOST :=$(shell hostname -f 2> /dev/null || uname -n) ifneq ($(shell grep '^epee-.*\.ccs\.ucsb\.edu$$' <<<$(HOST)),) HOST :=epee.ccs.ucsb.edu endif ifneq ($(shell grep '^.*\.ccs\.ucsb\.edu$$' <<<$(HOST)),) MOTD := hosts/$(shell cut -d . -f 1 <<<$(HOST)).motd endif ifeq ($(HOST),slowhand.douglasthrift.net) ALL_AWSTATS := all-awstats CLEAN_AWSTATS := clean-awstats OUI_IAB := iab.txt oui.txt UPDATE := .feeds hosts/.computers else ifeq ($(HOST),wireless.ccs.ucsb.edu) OUI_IAB := iab.txt oui.txt endif endif .PHONY: all all-awstats ieee stats clean clean-awstats all: $(ALL_AWSTATS) $(MOTD) $(OUI_IAB) $(UPDATE) ifdef UPDATE chmod g+w images/webcam [[ `stat -f %Sg images/webcam` == www ]] || sudo chgrp www images/webcam endif ifdef ALL_AWSTATS all-awstats: $(MAKE) -C awstats endif ifdef UPDATE .feeds: $(wildcard ../templates/facebook/feed-*) feeds -D touch $@ hosts/.computers: ../bin/computers $(wildcard hosts/*.xml) \ $(wildcard hosts/*.motd) computers -D touch $@ endif ifdef OUI_IAB iab.txt oui.txt: $(MAKE) ieee-$(patsubst %.txt,%,$@) ieee: ieee-iab ieee-oui oui-iab ieee-iab: rm -f iab.txt wget -q http://standards.ieee.org/regauth/oui/iab.txt ieee-oui: rm -f oui.txt wget -q http://standards.ieee.org/regauth/oui/oui.txt endif ifdef MOTD $(MOTD): /etc/motd ifeq ($(shell file -bL /etc/motd),ISO-8859 English text) iconv -f ISO-8859-1 -t UTF-8 $< > $@ else cp -v $< $@ endif endif ifdef ALL_AWSTATS stats: $(MAKE) -C awstats $@ endif clean: $(CLEAN_AWSTATS) rm -f iab.txt oui.txt ifdef CLEAN_AWSTATS clean-awstats: $(MAKE) -C awstats clean endif