# Makefile for switch testing module
#
# Author: Timo Pärnänen

# This is the name of the executable
TARGET = switchtest

# Object files
OBJS = switchtestimpl.o \
	switchtestmain.o

# Subdirs that contain necessary modules
SUBDIRS = $(TOVESRC)/sf \
	$(TOVESRC)/pf \
	$(TOVESRC)/common \
	$(TOVESRC)/iface/cpcsif \
	$(TOVESRC)/protocol/cpcs \
	$(TOVESRC)/mib \
	$(TOVESRC)/mgmt \
	$(TOVESRC)/protocol/ilmi/asn \
	$(TOVESRC)/protocol/ilmi
	

ALL_SUBDIRS = $(SUBDIRS)

# Names of the modules to be linked to the binary
MODULEFILES = $(TOVESRC)/protocol/ilmi/ilmi.a \
	$(TOVESRC)/protocol/ilmi/asn/ilmiasn.a \
	$(TOVESRC)/mgmt/mgmt.a \
	$(TOVESRC)/mib/mib.a \
        $(TOVESRC)/protocol/cpcs/cpcs.a \
        $(TOVESRC)/iface/cpcsif/cpcsif.a \
	$(TOVESRC)/common/common.a \
	$(TOVESRC)/pf/pf.a \
	$(TOVESRC)/sf/sf.a

# include a Rules file
include $(TOVESRC)/Rules.Make

# Do make in all subdirs, link the executable
$(TARGET): $(OBJS)
	for i in $(SUBDIRS); do make -C $$i; done
	$(CC) $(CCFLAGS) $(INC_DIRS) -o $(TARGET) $(OBJS) $(MODULEFILES) $(ORBLIB) $(NAMELIB) $(ASN1_LIB)

clean:
	rm -rf *~ *.o core $(TARGET)

# Make clean in all subdirs and in top level
# ('make clean' clears only top level)
deepclean:
	for i in $(ALL_SUBDIRS); do $(MAKE) -C $$i clean; done
	rm -rf *~ *.o $(TARGET)


# Make dependencies in all subdirs and in top level
# ('make dep' make dependencies only in top level)
deepdep:
	for i in $(ALL_SUBDIRS); do $(MAKE) -C $$i dep; done
	makedepend -Y $(INC_DIRS) $(DEFS) *.cpp 2> /dev/null


#
# Dependencies below, next line is used by makedepend, so
# DO NOT DELETE

