#
# SellaNMS
# $Id: Makefile.in,v 2.6 2005/05/15 04:11:26 bill Exp $
# Copyright (c) 2001,2002 Digital Genesis Software, LLC. All Rights Reserved.
# Released under the GPL Version 2 License.
# http://www.digitalgenesis.com
#

# --------------------------------------
#                Source
# --------------------------------------

OBJS				=
EXTOBJS			=
LIBOBJS			=
SUBDIRS			= modtest mkvim
TARGET			=

# --------------------------------------
#                Programs
# --------------------------------------

CC					= @CC@
CXX				= @CXX@
CPP				= @CPP@
RANLIB			= @RANLIB@
INSTALL			= @INSTALL@
SHELL				= @SHELL@
LN_S				= @LN_S@

# --------------------------------------
#                Flags
# --------------------------------------

SRCDIR			= @srcdir@
DEFINES			= 
CPPFLAGS			= @CPPFLAGS@
CFLAGS			= @CFLAGS@ @CPPFLAGS@
CXXFLAGS			= @CXXFLAGS@ @CPPFLAGS@
LDFLAGS			= -Wl,-export-dynamic @LDFLAGS@
LIBS				= @LIBS@
VPATH				= .

# --------------------------------------
#                Targets
# --------------------------------------

.SUFFIXES: .c .cc .cxx .c++ .cpp .o
 
.c.o:
	$(CC) $(DEFINES) -c $(CFLAGS) $<
.cc.o:
	$(CXX) $(DEFINES) -c $(CXXFLAGS) $<
.cxx.o:
	$(CXX) $(DEFINES) -c $(CXXFLAGS) $<
.c++.o:
	$(CXX) $(DEFINES) -c $(CXXFLAGS) $<
.cpp.o:
	$(CPP) $(DEFINES) -c $(CPPFLAGS) $<

all: build

build: $(OBJS) $(LIBOBJS) $(TARGET)
	@SUBDIRS="$(SUBDIRS)"; \
	for DIR in $${SUBDIRS}; do \
		echo "@term_bold@==> $${DIR}@term_norm@"; \
		(cd $${DIR} && $(MAKE) $(MFLAGS) build); \
		echo "@term_bold@<== $${DIR}@term_norm@"; \
	done

$(TARGET): $(OBJS) $(EXTOBJS)
	$(CXX) $(CXXFLAGS) $(LDFLAGS) -o $@ $(OBJS) $(EXTOBJS) $(LIBS)

docs:
	@echo "Not done yet.."

install: build
	@echo "Not done yet.."

lines:
	@wc -l ${OBJS:.o=.c*} *.h
		
clean:
	-rm -f $(TARGET) $(LIBOBJS) *.o
	-@SUBDIRS="$(SUBDIRS)"; \
	for DIR in $${SUBDIRS}; do \
		echo "@term_bold@==> $${DIR}@term_norm@"; \
		(cd $${DIR} && $(MAKE) $(MFLAGS) clean); \
		echo "@term_bold@<== $${DIR}@term_norm@"; \
	done
