CXX = g++
CXXFLAGS = -g -Wall
LIBS = -lncurses
OBJFILES = lore.o widgets.o

VERSION=1.94
DEFINES=-DLORE_VERSION=\"$(VERSION)\"

all: print lore

print:
	@echo "Linux Omen Reader $(VERSION) - Compiling" 
	@echo "Copyrights (c) 1995 by Ville Hallivuori"
	@echo "This Makefile and LORE are distributed under Gnu General Public" 
	@echo "Licence version 2. See COPYING (file in this distribution) for more"
	@echo "information"
	@echo " "

lore: $(OBJFILES)
	$(CXX) -o lore $(OBJFILES) $(LIBS)

install:
	@echo "Linux Omen Reader $(VERSION) - installation" 
	@echo "Copyrights (c) 1995 by Ville Hallivuori"
	@echo "This Makefile and LORE are distributet under Gnu General Public" 
	@echo "Licence version 2. See COPYING (file in this distribution) for more"
	@echo "information"
	@echo " "
	@echo "NOTE: You have to bee ROOT to use this script.  PRESS ^C now if you"
	@echo "      you aren't root (use su to became root before installation"
	@echo "      or hit enter to continue."
	@echo "-------------------------------------------------------------------"
	@read dummy
	@echo "Installing LORE"
	@echo "  ...Copying ./lore to /usr/bin/lore"
	@cp lore /usr/bin/lore
	@echo "  ...Changin lores ownership"
	@chown root.users /usr/bin/lore
	@echo "  ...Changin lores permissions"
	@chmod 755 /usr/bin/lore
	@echo "Finished installation"
	@echo "-------------------------------------------------------------------"
	@echo "Remember to read README!"
	@echo " "

clean:
	@echo "Cleaning up directory"
	rm -f *.o

lore.o:	lore.cc lore.h widgets.h
	$(CXX) $(CXXFLAGS) -c lore.cc $(DEFINES)

widgets.o:	widgets.cc widgets.h lore.h
	$(CXX) $(CXXFLAGS) -c widgets.cc $(DEFINES)