MASTERNICK = weasel CERT="$(HOME)/.irssi/oftc-weasel.pem" PKEY="$(HOME)/.irssi/oftc-weasel.key" CAFILE="$(HOME)/.irssi/oftc.crt" HOST="asteria.debian.or.at" WAIT=1000 config: config.tmp mv -f "$<" "$@" chmod -w "$@" .INTERMEDIATE: config.tmp config.tmp: config.in servers.tmp chatnets.tmp cat $? > "$@" .INTERMEDIATE: servers.tmp servers.tmp: ~/.oftc-hosts ~/.oftc-port ~/.oftc-testnet-port Makefile echo "servers = (" > "$@" while read name ip; do \ echo "# $$name" >> "$@" && \ printf '{ \ address = "%s"; \ chatnet = "OFTC-%s"; \ port = "%d"; \ use_ssl = "yes"; \ ssl_cert = $(CERT); \ ssl_pkey = $(PKEY); \ ssl_verify = "yes"; \ ssl_cafile = $(CAFILE); \ own_host = $(HOST); \ autoconnect = "no"; \ },\n' \ \ $$ip \ $$name \ "`cat ~/.oftc-port`" \ \ >> "$@" && \ \ \ printf '{ \ address = "%s"; \ chatnet = "TESTNET-%s"; \ port = "%d"; \ use_ssl = "yes"; \ ssl_cert = $(CERT); \ ssl_pkey = $(PKEY); \ ssl_verify = "yes"; \ ssl_cafile = $(CAFILE); \ own_host = $(HOST); \ autoconnect = "no"; \ },\n' \ \ $$ip \ $$name \ "`cat ~/.oftc-testnet-port`" \ \ >> "$@" ; \ \ done < ~/.oftc-hosts && echo built. echo ")" >> "$@" .INTERMEDIATE: chatnets.tmp chatnets.tmp: ~/.oftc-hosts ~/.oftc-port ~/.oftc-testnet-port Makefile echo "chatnets = {" > "$@" while read name ip; do \ echo "# $$name" >> "$@" && \ printf '"OFTC-%s" = { \ type = "IRC"; \ autosendcmd = "links; wait -OFTC-%s $(WAIT)"; \ cmdmax = "512"; \ cmdspeed = "10"; \ max_kicks = "1"; \ max_msgs = "100"; \ max_modes = "4"; \ nick = "$(MASTERNICK)-%s"; \ };\n' \ \ $$name \ $$name \ $$name \ \ >> "$@" && \ \ printf '"TESTNET-%s" = { \ type = "IRC"; \ autosendcmd = "links; wait -TESTNET-%s $(WAIT)"; \ cmdmax = "512"; \ cmdspeed = "10"; \ max_kicks = "1"; \ max_msgs = "100"; \ max_modes = "4"; \ nick = "$(MASTERNICK)-%s"; \ };\n' \ \ $$name \ $$name \ $$name \ \ >> "$@" ; \ \ done < ~/.oftc-hosts && echo built. echo "}" >> "$@"