#
# =======================================================================
# PACKAGE:	fstat -- File Status Information
# MK-FILE:	Makefile (compile programs and misc ops)
# VERSION:	%R% (%E%)
# =======================================================================
# Copyright (1994): Martin Weitzel, Darmstadt, Germany

SOURCES=\
	COPYING\
	README\
	INSTALL\
	COMPILE\
	fstat.c\
	demo1.sh\
	demo2.sh\
	demo3.sh\
	demo4.sh\
	Makefile

SCRATCH=\
	compile.h

PROGS=\
	fstat

# !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
# !!!!!!! below this line, things only change with dependencies !!!!!!!
# !!!!!!!   i.e. if you change something, do it with thought    !!!!!!!

$(PROGS): $$@.c compile.h
	$(CC) $(CFLAGS) $@.c -o $@

compile.h: COMPILE
	@while read name rest;\
	do case $$name in \#*|'');; *) echo "#define $$name"; esac;\
	done <COMPILE >$@

clean:
	rm -f a.out core *.o $(SCRATCH) $(PROGS)

# The following targets are contained only because the
# author was too lazy to delete them in the distribution
# version of this package; regular users normally will
# not need them.
#
fstat.tar: $(SOURCES)
	tar cvf $@ $(SOURCES)

fstat.tar.Z: fstat.tar
	compress -c fstat.tar >$@

PUBDIR=/usr/local/src/public
public: fstat.tar.Z
	cp fstat.tar.Z $(PUBDIR)/$(LOGNAME)
	chmod 644 $(PUBDIR)/$(LOGNAME)/fstat.tar.Z
