#
#  Makefile for dwarfdump
#  This is made very simple so it should work with
#  any 'make'.
#  The Makefile does assume that libdwarf is at ../libdwarf
#  from the dwarfdump2 source directory.
#

srcdir =	@srcdir@
VPATH =		@srcdir@

prefix =	@prefix@
exec_prefix =	@exec_prefix@
bindir =	$(exec_prefix)/bin
libdir =	$(exec_prefix)/lib
mandir =        $(exec_prefix)/share/man
man1dir =       $(mandir)/man1


INSTALL =	@INSTALL@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_DATA =	@INSTALL_DATA@
DATAROOT =      @datarootdir@
SHELL =		/bin/sh
CC =		@CC@
AR =		@AR@
ARFLAGS =	@ARFLAGS@
RM =		rm
RANLIB =	@RANLIB@
DEFS =		@DEFS@
# ../libdwarf gets us to local headers and a libdwarf 
# archive, usually, so we assume it.
DIRINC =        $(srcdir)/../libdwarf 
dwfwall =       @dwfwall@
dwfsanitize =   @dwfsanitize@
dwfzlib =       @dwfzlib@
LIBS =		@LIBS@ -L../libdwarf -ldwarf -lelf $(dwfzlib)
INCLUDES =	-I. -I$(srcdir) -I../libdwarf -I$(srcdir)/../libdwarf
CFLAGS =	$(PREINCS) @CFLAGS@ $(INCLUDES) $(dwfwall) $(dwfsanitize) -DCONFPREFIX=${libdir} $(POSTINCS)
LDFLAGS =	$(PRELIBS) @LDFLAGS@ $(dwfsanitize) $(LIBS) $(POSTLIBS)
#VG =            valgrind --leak-check=full
VG =


INSTALL = cp

binprefix =

all: simplereader frame1

simplereader: $(srcdir)/simplereader.c
	$(CC) $(CFLAGS) $(srcdir)/simplereader.c -o simplereader $(LDFLAGS)
frame1: $(srcdir)/frame1.c
	$(CC) $(CFLAGS) $(srcdir)/frame1.c -o frame1 $(LDFLAGS)

install: all
	echo do no install

uninstall:
	echo do no uninstall

clean:
	rm -f *.o
	rm -f frame1
	rm -f simplereader
	rm -f *~

distclean: clean
	rm -f config.log config.h config.cache config.status 
	rm -rf autom4te.cache
	rm -rf Makefile

shar:
	@echo "shar not set up yet"
dist:
	@echo "dist not set up yet"
