# Optionen für den Compiler. Werden nur beachtet, wenn für die Regel kein
# Kommando angegeben ist.
INCLUDE_FLAGS =  -IFile-Date-StringUtils

# Search path for make (esp. for its dependencies)
VPATH = File-Date-StringUtils

# implizite Regel fürs Compilieren von C++-Programmen
# 
%.o : %.cpp
	$(CXX) -c $(GLOBAL_FLAGS) $(INCLUDE_FLAGS) $(CFLAGS) $(CPPFLAGS) $<

.PHONY : all deps clean doc

all :
	$(MAKE) -C File-Date-StringUtils ;
	$(MAKE) ndir

ndir : dir.o ColorSetup.o DirectoryList.o DirectoryList.o UnixFile.o UnixDirectoryLister.o Date.o StringUtils.o 
	$(CXX) $(GLOBAL_FLAGS) $(LDFLAGS) -o ndir \
      dir.o ColorSetup.o \
      File-Date-StringUtils/DirectoryList.o \
      File-Date-StringUtils/UnixFile.o \
      File-Date-StringUtils/UnixDirectoryLister.o \
      File-Date-StringUtils/Date.o \
      File-Date-StringUtils/StringUtils.o \
      File-Date-StringUtils/text/format.o
      

dir.o : dir.cpp DirectoryList.hpp UnixFile.hpp \
 UnixFile.hpp File.hpp \
 Date.hpp UnixDirectoryLister.hpp DirectoryList.hpp StringUtils.hpp \
 text/format.h

ColorSetup.o: ColorSetup.cpp ColorSetup.hpp UnixFile.hpp \
 File.hpp Date.hpp StringUtils.hpp text/format.h 


profiling : profiling.cpp
	$(CXX) -o profiling $(INCLUDE_FLAGS) profiling.cpp \
      File-Date-StringUtils/UnixFile.o \
      File-Date-StringUtils/Date.o \
      File-Date-StringUtils/StringUtils.o

deps : 
	$(CXX) -MM $(INCLUDE_FLAGS) *.cpp

clean :
	$(MAKE) clean -C File-Date-StringUtils ;
	rm -f *.o ndir profiling

doc :
	rm doc/* || true
	kdoc -p -d doc -n NDir  *hpp dir.cpp || true
#	/opt/doc++/doc++ -d doc -H   *.hpp dir.cpp
	$(MAKE) doc -C File-Date-StringUtils ;
