VERSION=0.8

DEBUG=-g -W -pedantic #-pg #-fprofile-arcs
LDFLAGS=-lncurses $(DEBUG)
CFLAGS+=-O2 -Wall -DVERSION=\"$(VERSION)\" $(DEBUG)

OBJS=at.o

all: andatool

andatool: $(OBJS)
	$(CC) -Wall -W $(OBJS) $(LDFLAGS) -o andatool

install: andatool
	cp andatool $(DESTDIR)/usr/bin
	cp andatool.1 $(DESTDIR)/usr/share/man/man1/andatool.1

uninstall: clean
	rm -f $(DESTDIR)/usr/bin/andatool
	rm -f $(DESTDIR)/usr/share/man/man1/andatool.1.gz

clean:
	rm -f $(OBJS) andatool core gmon.out *.da

package: clean
	# source package
	rm -rf andatool-$(VERSION)*
	mkdir andatool-$(VERSION)
	cp *.c* andatool.1 Makefile license.txt readme.txt andatool-$(VERSION)
	tar czf andatool-$(VERSION).tgz andatool-$(VERSION)
	rm -rf andatool-$(VERSION)
