# This is the Makefile for nc. 
# Don't forget to edit the settings in config.h before making !

CC=gcc
C++=g++
C++FLAGS=-Wall -static -DNCURSES -I.
LIBS=-lncurses
objects = nc.o welcome.o inithome.o debug.o softlabel.o TFileWindow.o readkeys.o

all :
	$(MAKE) nc
	$(MAKE) hd
	$(MAKE) ncds
#	$(MAKE) del
#	$(MAKE) undel
	$(MAKE) man
	$(MAKE) manual

nc : $(objects)
	$(CC) $(C++FLAGS) -fwritable_strings -o nc $(objects) $(LIBS)

man :
	groff -man nc.man > nc.n

manual:
	latex manual.tex

clean :
	rm -f nc $(objects) hd del undel ncds core manual.dvi

hd : hd.c
	$(CC) $(C++FLAGS) -o hd hd.c

ncds : ncds.cc globals.h config.h inithome.cc
	$(CC) $(C++FLAGS) -static -o ncds ncds.cc inithome.cc

#del : del.cc globals.h config.h inithome.cc
#	$(CC) $(C++FLAGS) -static -o del del.cc inithome.cc

#undel : undel.cc globals.h config.h inithome.cc
#	$(CC) $(C++FLAGS) -static -o undel undel.cc inithome.cc

nc.o : globals.h config.h TDir.h TList.h TPrompt.h welcome.h THistory.h TElem.h THistElem.h TFileWindow.h readkeys.h TArg.h TInfo.h
inithome.o : globals.h
softlabel.o : config.h globals.h softlabel.h
welcome.o : welcome.h globals.h
TFileWindow.o : globals.h config.h TDir.h TList.h TElem.h TFileWindow.h TInfo.h
readkeys.o : readkeys.h globals.h config.h



