# $Id: Makefile,v 1.3 1998/02/23 13:52:35 moritz Exp $
SUBSTFILES=Makefile fetchipac ipacsum ipacset
INSTFILES=fetchipac ipacsum ipacset
CC=cc
CONFIG=config

# =()<INSTALLPATH=@<INSTALLPATH>@>()=
INSTALLPATH=/usr/local/bin

all: dosubst
	chmod +x $(INSTFILES)

dosubst: subst
	@for file in $(SUBSTFILES); do \
		./subst -f $(CONFIG) $$file || exit 1; \
	done

# subst may have changed Makefile!
install: dosubst
	make doinstall

doinstall:
	@for file in $(INSTFILES); do \
		echo "install -o root -g bin -m 755 $$file $(INSTALLPATH)/$$file"; \
		install -o root -g bin -m 755 $$file $(INSTALLPATH)/$$file || exit 1; \
	done

subst: subst.c
	$(CC) -o subst subst.c
clean:
	rm -f subst

