PATH := $(CURDIR):$(PATH)
INSTDIR := /usr/local/bin
EXE=net2sh net2dot net_files net_graphs
SRC=net2sh_init net2sh_head net2dot_head Net net_graphs.make
.PHONY: default all boot graphs
.SECONDARY: 
default: boot
all: boot graphs
boot: .net2sh sub/.strip_trail_redir
.net2sh: boot/net2sh.sh
	cp -a "$<" "$@"
sub/.strip_trail_redir: boot/strip_trail_redir.sh
	cp -a "$<" "$@"
clean:
	rm -rf .g
	rm -f .net2dot .net2sh sub/.strip_trail_redir
	mkdir .g
devinst:
	for A in $(EXE) $(SRC); do ln -sf "$$PWD/$$A" "$(INSTDIR)/"; done
install:
	for A in $(EXE); do install "$$PWD/$$A" "$(INSTDIR)/"; done
	for A in $(SRC); do install --mode=644 "$$PWD/$$A" "$(INSTDIR)/"; done
graphs:
	net_graphs
include net_graphs.make
