CC = g++
CPPFLAGS = -Wall -Wstrict-prototypes
#DEBUG = -Ddebug
DEFINES = -D_EGCS $(DEBUG)
INCLUDES = -I.
OBJS = htnews.o
CFLAGS = $(INCLUDES) $(CPPFLAGS) $(DEFINES)
INSTALL = /usr/bin/install
PREFIX = /usr/sbin
all:    .depend $(OBJS)
	$(CC) $(LFLAGS) $(DB) htnews.o -o htnews $(LIBS)

	@echo -e "\nDone. Type make install.\n"

clean:
	rm -f *.o *~ .depend

install:
	$(INSTALL) -m 755 -o root -g root htnews $(PREFIX)
	$(INSTALL) -m 644 -o root -g root htnews.conf /etc
	$(INSTALL) -m 644 -o root -g root htnews.1 /usr/man/man1
	@echo -e "\nDone. Please don't forget to edit the config file!\n"

.depend:
#	*.h
	$(CC) $(CFLAGS) -M *.cc > .depend


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

ifeq (.depend,$(wildcard .depend))
include .depend
endif         
