# Generated automatically from Makefile.in by configure.
# Makefile for traceroute-ulmo (well, now I named it tu)
# things to do:
# * follow FSSTND (/usr/sbin)

#### Start of system configuration section. ####

srcdir = .

# For Linux, try -pipe -O6.  Note, must use -fno-inline-functions for clone().
# must create test for gcc -O6 flags:
CC = gcc -pipe -O6
INSTALL = /usr/bin/ginstall -c
INSTALL_PROGRAM = ${INSTALL}
INSTALL_DATA = ${INSTALL} -m 644
LIBS = -lc  -lncurses
# must create test for GLIBC:
DEFS =  -DHAVE_LIBC=1 -DSTDC_HEADERS=1 -DHAVE_SYS_WAIT_H=1 -DHAVE_SYS_FILE_H=1 -DHAVE_SYS_IOCTL_H=1 -DHAVE_SYS_TIME_H=1 -DHAVE_UNISTD_H=1 -DTIME_WITH_SYS_TIME=1 -DHAVE_GETTIMEOFDAY=1 -DHAVE_SELECT=1 -DHAVE_SOCKET=1 -DHAVE_STRERROR=1  -DGLIBC

# Programs that are ALWAYS installed (and are created in the build dir).
OBJS = tu.o tu-hn.o
# All programs, including those only installed if you have perl.
PROG = tu

transform=s,x,x,

prefix = /usr/local
exec_prefix = ${prefix}

# Directory in which to install scripts.
bindir = ${exec_prefix}/bin

# Directory in which to install library files.
datadir = ${prefix}/share
acdatadir = $(datadir)/autoconf

# Directory in which to install documentation info files.
infodir = ${prefix}/info

#### End of system configuration section. ####

SHELL = /bin/sh

#SUBDIRS = testsuite

# Files that can be generated, but should be up to date for a distribution.
DISTDEP = info Makefile
# Files to distribute.
DISTFILES = README COPYRIGHTS \
	INSTALL Makefile.in configure configure.in install-sh mkinstalldirs \
	tu.c

all: $(PROG)

$(PROG): $(OBJS)
	$(CC) -o $@ $(OBJS) $(LIBS)

tu-hn.o: tu-hn.c
	$(CC) $(DEFS) -c -fno-inline-functions tu-hn.c

.SUFFIXES:
.SUFFIXES: .sh .pl

.sh:
	rm -f $@ $@.tmp
	$(editsh) $< > $@.tmp && chmod +x $@.tmp && mv $@.tmp $@

.pl:
	rm -f $@ $@.tmp
	$(editpl) $< > $@.tmp && chmod +x $@.tmp && mv $@.tmp $@

#info: autoconf.info @standards_info@ INSTALL

# Use --no-split to avoid creating filenames > 14 chars.
#autoconf.info: autoconf.texi install.texi
#	$(MAKEINFO) -I$(srcdir) $(srcdir)/autoconf.texi --no-split --output=$@

#INSTALL: install.texi
#	$(MAKEINFO) -I$(srcdir) $(srcdir)/install.texi --output=$@ \
#	--no-headers --no-validate

#standards.info: standards.texi make-stds.texi
#	$(MAKEINFO) -I$(srcdir) $(srcdir)/standards.texi --no-split --output=$@

#dvi: autoconf.dvi @standards_dvi@

#autoconf.dvi: autoconf.texi
#	$(TEXI2DVI) $(srcdir)/autoconf.texi

#standards.dvi: standards.texi make-stds.texi
#	$(TEXI2DVI) $(srcdir)/standards.texi

#check: all
#	rootme=`pwd`; srcrootme=`cd $(srcdir); pwd`; \
#	test -r install-sh || cp $(srcdir)/install-sh .; \
#	cd testsuite && ${MAKE} $@ AUTOCONF=$$rootme/autoconf \
#	AUTOCONFFLAGS="-m $$srcrootme"

#installcheck: all install
#	cd testsuite && ${MAKE} AUTOCONF=${bindir}/autoconf $@

installdirs:
	$(SHELL) ${srcdir}/mkinstalldirs $(bindir)

# Does this really need to be sgid too?  (I did for safety)
install: all installdirs
	for p in $(PROG); do \
	  $(INSTALL_PROGRAM) -s -o root -g root -m 6555 $$p $(bindir)/`echo $$p|sed '$(transform)'`; \
	done

# Don't cd, to avoid breaking install-sh references.
install-info: info installdirs
	if test -f autoconf.info; then \
	  for i in *.info*; do \
	    $(INSTALL_DATA) $$i $(infodir)/$$i; \
	  done; \
	else \
	  for i in $(srcdir)/*.info*; do \
	    $(INSTALL_DATA) $$i $(infodir)/`echo $$i | sed 's|^$(srcdir)/||'`; \
	  done; \
	fi

uninstall:
	for p in $(SCRIPTS); do \
	  rm -f $(bindir)/`echo $$p|sed '$(transform)'`; \
	done
	rm -fr $(acdatadir)
	cd $(infodir) && rm -f autoconf.info*
	if test -f standards.info || test -f $(srcdir)/standards.info; \
	then cd $(infodir) && rm -f standards.info*; fi

# use in place of autoconf line below:
#	$(M4) autoconf.m4 configure.in > configure.tmp && \

${srcdir}/configure: configure.in $(M4FILES)
	cd $(srcdir) && \
	rm -f configure configure.tmp && \
	autoconf configure.in > configure.tmp && \
	chmod +x configure.tmp && mv configure.tmp configure
Makefile: Makefile.in config.status
	./config.status
config.status: configure
	./config.status --recheck

maintainer-clean::
	@echo "This command is intended for maintainers to use;"
	@echo "rebuilding the deleted files requires makeinfo."
	rm -f TAGS *.info* INSTALL

clean mostlyclean distclean maintainer-clean::
	for dir in $(SUBDIRS); do \
	  echo making $@ in $$dir ; \
	  (cd $$dir && $(MAKE) $@) ; \
	done

#	rm -f *.aux *.cp *.cps *.dvi *.fn *.fns *.ky *.kys *.log
#	rm -f *.pg *.pgs *.toc *.tp *.tps *.vr *.vrs
#	rm -f *.ev *.evs *.ov *.ovs *.cv *.cvs *.ma *.mas

clean mostlyclean distclean maintainer-clean::
	rm -f $(OBJS) $(PROG) *.tmp *.log
	rm -f *.o

distclean maintainer-clean::
	rm -f Makefile config.status config.cache config.log *~

TAGS:
	etags ${srcdir}/*.m4 ${srcdir}/*.sh ${srcdir}/[a-z]*.in ${srcdir}/*.texi

# Don't depend on DISTFILES because there's no rule for "standards.info*".
dist: $(DISTDEP)
	distname=`sed -e '/define(AC_ACVERSION,/!d' \
	-e 's/[^0-9.]*\([0-9.]*\).*/autoconf-\1/' -e q acgeneral.m4`; \
	rm -fr $$distname; \
	mkdir $$distname $$distname/testsuite $$distname/testsuite/config \
	$$distname/testsuite/lib $$distname/testsuite/autoconf.g \
	$$distname/testsuite/autoconf.s; \
	for file in $(DISTFILES); do \
	  ln $$file $$distname/$$file \
	  || { echo copying $$file instead; cp -p $$file $$distname/$$file;}; \
	done; \
	chmod -R a+rX $$distname; \
	tar -chz -f $$distname.tar.gz $$distname; \
	rm -fr $$distname

#
# Common rules
#

%.s: %.c
	$(CC) $(CFLAGS) $(DEFS) -S $< -o $@

%.o: %.c
	$(CC) $(CFLAGS) $(DEFS) -c -o $@ $<

%.o: %.s
	$(AS) $(ASFLAGS) $(DEFS) -o $@ $<
