# Makefile for newsfetch program
CC = gcc
BINDIR = /usr/local/bin
MANDIR = /usr/local/man/man1

CFLAGS= -O2 # inline opt

# uncomment this for strict checking
#CFLAGS = -O2 -Wall -pedantic -Wstrict-prototypes -fno-strength-reduce

# uncomment this if you do not want status meter
#CFLAGS = -O2 -DNO_STATUS_METER

all: newsfetch
objs = newsfetch.o nntp.o net.o opt.o util.o getopt.o
 
newsfetch: $(objs)
	$(CC) -o newsfetch $(objs)
	strip newsfetch

.c.o:
	$(CC) -c $(CFLAGS) $< 

clean:
	rm -f *.o newsfetch

install:
#	cp newsfetch $(BINDIR)/newsfetch
#	cp newsfetch.1 $(MANDIR)/newsfetch.1
	cp newsfetch /usr/local/bin
	cp newsfetch.1 /usr/local/man/man1

uninstall:
	rm -f $(BINDIR)/newsfetch
	rm -f $(MANDIR)/newsfetch.1
